code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public Shape createScrollButtonTogetherDecrease(int x, int y, int w, int h) { path.reset(); path.moveTo(x + w, y); path.lineTo(x + w, y + h); path.lineTo(x, y + h); addScrollGapPath(x, y, w, h, false); path.closePath(); return path; }
class class_name[name] begin[{] method[createScrollButtonTogetherDecrease, return_type[type[Shape]], modifier[public], parameter[x, y, w, h]] begin[{] call[path.reset, parameter[]] call[path.moveTo, parameter[binary_operation[member[.x], +, member[.w]], member[.y]]] call[path.lineTo, parameter[binary_operation[member[.x], +, member[.w]], binary_operation[member[.y], +, member[.h]]]] call[path.lineTo, parameter[member[.x], binary_operation[member[.y], +, member[.h]]]] call[.addScrollGapPath, parameter[member[.x], member[.y], member[.w], member[.h], literal[false]]] call[path.closePath, parameter[]] return[member[.path]] end[}] END[}]
Keyword[public] identifier[Shape] identifier[createScrollButtonTogetherDecrease] operator[SEP] Keyword[int] identifier[x] , Keyword[int] identifier[y] , Keyword[int] identifier[w] , Keyword[int] identifier[h] operator[SEP] { identifier[path] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[moveTo] operator[SEP] identifier[x] operator[+] identifier[w] , identifier[y] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[lineTo] operator[SEP] identifier[x] operator[+] identifier[w] , identifier[y] operator[+] identifier[h] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[lineTo] operator[SEP] identifier[x] , identifier[y] operator[+] identifier[h] operator[SEP] operator[SEP] identifier[addScrollGapPath] operator[SEP] identifier[x] , identifier[y] , identifier[w] , identifier[h] , literal[boolean] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[closePath] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[path] operator[SEP] }
public static <T extends Number> WithinGroup<T> percentileCont(T arg) { if (arg.doubleValue() < 0.0 || arg.doubleValue() > 1.0) { throw new IllegalArgumentException("The percentile value should be a number between 0 and 1"); } return percentileCont(ConstantImpl.create(arg)); }
class class_name[name] begin[{] method[percentileCont, return_type[type[WithinGroup]], modifier[public static], parameter[arg]] begin[{] if[binary_operation[binary_operation[call[arg.doubleValue, parameter[]], <, literal[0.0]], ||, binary_operation[call[arg.doubleValue, parameter[]], >, literal[1.0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The percentile value should be a number between 0 and 1")], 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[call[.percentileCont, parameter[call[ConstantImpl.create, parameter[member[.arg]]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Number] operator[>] identifier[WithinGroup] operator[<] identifier[T] operator[>] identifier[percentileCont] operator[SEP] identifier[T] identifier[arg] operator[SEP] { Keyword[if] operator[SEP] identifier[arg] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[<] literal[Float] operator[||] identifier[arg] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[>] literal[Float] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[percentileCont] operator[SEP] identifier[ConstantImpl] operator[SEP] identifier[create] operator[SEP] identifier[arg] operator[SEP] operator[SEP] operator[SEP] }
private static SimpleStatsProducer<MBeanStats> buildProducer(MBeanServer server, ObjectInstance mBean) { final ObjectName mBeanName = mBean.getObjectName(); final String canonicalName = mBeanName.getCanonicalName(); final String producerId = normalize(canonicalName); final String subsystem = normalize(mBeanName.getDomain()); try { MBeanStats stats = MBeanStatsFactory.createMBeanStats( server, mBeanName, conf.isUpdateAutomatically(), conf.getDelayBeforeFirstUpdate() ); if(stats != null) return new SimpleStatsProducer<>( producerId, "mbean", subsystem, Collections.singletonList(stats) ); log.info("Failed to create stats object from mbean named " + mBean + " because no one attribute can not be parsed from that been"); return null; } catch (JMException e) { log.warn("Failed to create stats object from mbean named " + mBean, e); return null; } }
class class_name[name] begin[{] method[buildProducer, return_type[type[SimpleStatsProducer]], modifier[private static], parameter[server, mBean]] begin[{] local_variable[type[ObjectName], mBeanName] local_variable[type[String], canonicalName] local_variable[type[String], producerId] local_variable[type[String], subsystem] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=server, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mBeanName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=isUpdateAutomatically, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getDelayBeforeFirstUpdate, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[], type_arguments=None)], member=createMBeanStats, postfix_operators=[], prefix_operators=[], qualifier=MBeanStatsFactory, selectors=[], type_arguments=None), name=stats)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MBeanStats, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=stats, 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=ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=producerId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="mbean"), MemberReference(member=subsystem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=singletonList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=SimpleStatsProducer, sub_type=None)), label=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to create stats object from mbean named "), operandr=MemberReference(member=mBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" because no one attribute can not be parsed from that been"), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to create stats object from mbean named "), operandr=MemberReference(member=mBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['JMException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] identifier[SimpleStatsProducer] operator[<] identifier[MBeanStats] operator[>] identifier[buildProducer] operator[SEP] identifier[MBeanServer] identifier[server] , identifier[ObjectInstance] identifier[mBean] operator[SEP] { Keyword[final] identifier[ObjectName] identifier[mBeanName] operator[=] identifier[mBean] operator[SEP] identifier[getObjectName] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[canonicalName] operator[=] identifier[mBeanName] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[producerId] operator[=] identifier[normalize] operator[SEP] identifier[canonicalName] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[subsystem] operator[=] identifier[normalize] operator[SEP] identifier[mBeanName] operator[SEP] identifier[getDomain] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[MBeanStats] identifier[stats] operator[=] identifier[MBeanStatsFactory] operator[SEP] identifier[createMBeanStats] operator[SEP] identifier[server] , identifier[mBeanName] , identifier[conf] operator[SEP] identifier[isUpdateAutomatically] operator[SEP] operator[SEP] , identifier[conf] operator[SEP] identifier[getDelayBeforeFirstUpdate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stats] operator[!=] Other[null] operator[SEP] Keyword[return] Keyword[new] identifier[SimpleStatsProducer] operator[<] operator[>] operator[SEP] identifier[producerId] , literal[String] , identifier[subsystem] , identifier[Collections] operator[SEP] identifier[singletonList] operator[SEP] identifier[stats] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[mBean] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[catch] operator[SEP] identifier[JMException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[mBean] , identifier[e] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } }
public void setChildPropertySetter(final Object childPropertySetter) { if (childPropertySetter instanceof ChildPropertySetter) { this.childPropertySetter = (ChildPropertySetter) childPropertySetter; } else if (childPropertySetter instanceof Closure) { final ObjectGraphBuilder self = this; this.childPropertySetter = new ChildPropertySetter() { public void setChild(Object parent, Object child, String parentName, String propertyName) { Closure cls = (Closure) childPropertySetter; cls.setDelegate(self); cls.call(parent, child, parentName, propertyName); } }; } else { this.childPropertySetter = new DefaultChildPropertySetter(); } }
class class_name[name] begin[{] method[setChildPropertySetter, return_type[void], modifier[public], parameter[childPropertySetter]] begin[{] if[binary_operation[member[.childPropertySetter], instanceof, type[ChildPropertySetter]]] begin[{] assign[THIS[member[None.childPropertySetter]], Cast(expression=MemberReference(member=childPropertySetter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ChildPropertySetter, sub_type=None))] else begin[{] if[binary_operation[member[.childPropertySetter], instanceof, type[Closure]]] begin[{] local_variable[type[ObjectGraphBuilder], self] assign[THIS[member[None.childPropertySetter]], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=childPropertySetter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Closure, sub_type=None)), name=cls)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Closure, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=self, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDelegate, postfix_operators=[], prefix_operators=[], qualifier=cls, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parentName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=call, postfix_operators=[], prefix_operators=[], qualifier=cls, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=setChild, parameters=[FormalParameter(annotations=[], modifiers=set(), name=parent, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=child, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=parentName, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=propertyName, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ChildPropertySetter, sub_type=None))] else begin[{] assign[THIS[member[None.childPropertySetter]], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultChildPropertySetter, sub_type=None))] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setChildPropertySetter] operator[SEP] Keyword[final] identifier[Object] identifier[childPropertySetter] operator[SEP] { Keyword[if] operator[SEP] identifier[childPropertySetter] Keyword[instanceof] identifier[ChildPropertySetter] operator[SEP] { Keyword[this] operator[SEP] identifier[childPropertySetter] operator[=] operator[SEP] identifier[ChildPropertySetter] operator[SEP] identifier[childPropertySetter] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[childPropertySetter] Keyword[instanceof] identifier[Closure] operator[SEP] { Keyword[final] identifier[ObjectGraphBuilder] identifier[self] operator[=] Keyword[this] operator[SEP] Keyword[this] operator[SEP] identifier[childPropertySetter] operator[=] Keyword[new] identifier[ChildPropertySetter] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[setChild] operator[SEP] identifier[Object] identifier[parent] , identifier[Object] identifier[child] , identifier[String] identifier[parentName] , identifier[String] identifier[propertyName] operator[SEP] { identifier[Closure] identifier[cls] operator[=] operator[SEP] identifier[Closure] operator[SEP] identifier[childPropertySetter] operator[SEP] identifier[cls] operator[SEP] identifier[setDelegate] operator[SEP] identifier[self] operator[SEP] operator[SEP] identifier[cls] operator[SEP] identifier[call] operator[SEP] identifier[parent] , identifier[child] , identifier[parentName] , identifier[propertyName] operator[SEP] operator[SEP] } } operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[childPropertySetter] operator[=] Keyword[new] identifier[DefaultChildPropertySetter] operator[SEP] operator[SEP] operator[SEP] } }
private static void insertionSort(double[] keys, int[] vals, final int start, final int end) { // Classic insertion sort. for(int i = start + 1; i < end; i++) { for(int j = i; j > start; j--) { if(keys[j] >= keys[j - 1]) { break; } swap(keys, vals, j, j - 1); } } }
class class_name[name] begin[{] method[insertionSort, return_type[void], modifier[private static], parameter[keys, vals, start, end]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=vals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=swap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, 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=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), 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[static] Keyword[void] identifier[insertionSort] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[keys] , Keyword[int] operator[SEP] operator[SEP] identifier[vals] , Keyword[final] Keyword[int] identifier[start] , Keyword[final] Keyword[int] identifier[end] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[start] operator[+] Other[1] operator[SEP] identifier[i] operator[<] identifier[end] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[i] operator[SEP] identifier[j] operator[>] identifier[start] operator[SEP] identifier[j] operator[--] operator[SEP] { Keyword[if] operator[SEP] identifier[keys] operator[SEP] identifier[j] operator[SEP] operator[>=] identifier[keys] operator[SEP] identifier[j] operator[-] Other[1] operator[SEP] operator[SEP] { Keyword[break] operator[SEP] } identifier[swap] operator[SEP] identifier[keys] , identifier[vals] , identifier[j] , identifier[j] operator[-] Other[1] operator[SEP] operator[SEP] } } }
protected Image parseImage(final Element rssRoot) { Image image = null; final Element eImage = getImage(rssRoot); if (eImage != null) { image = new Image(); final Element title = eImage.getChild("title", getRSSNamespace()); if (title != null) { image.setTitle(title.getText()); } final Element url = eImage.getChild("url", getRSSNamespace()); if (url != null) { image.setUrl(url.getText()); } final Element link = eImage.getChild("link", getRSSNamespace()); if (link != null) { image.setLink(link.getText()); } } return image; }
class class_name[name] begin[{] method[parseImage, return_type[type[Image]], modifier[protected], parameter[rssRoot]] begin[{] local_variable[type[Image], image] local_variable[type[Element], eImage] if[binary_operation[member[.eImage], !=, literal[null]]] begin[{] assign[member[.image], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Image, sub_type=None))] local_variable[type[Element], title] if[binary_operation[member[.title], !=, literal[null]]] begin[{] call[image.setTitle, parameter[call[title.getText, parameter[]]]] else begin[{] None end[}] local_variable[type[Element], url] if[binary_operation[member[.url], !=, literal[null]]] begin[{] call[image.setUrl, parameter[call[url.getText, parameter[]]]] else begin[{] None end[}] local_variable[type[Element], link] if[binary_operation[member[.link], !=, literal[null]]] begin[{] call[image.setLink, parameter[call[link.getText, parameter[]]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.image]] end[}] END[}]
Keyword[protected] identifier[Image] identifier[parseImage] operator[SEP] Keyword[final] identifier[Element] identifier[rssRoot] operator[SEP] { identifier[Image] identifier[image] operator[=] Other[null] operator[SEP] Keyword[final] identifier[Element] identifier[eImage] operator[=] identifier[getImage] operator[SEP] identifier[rssRoot] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eImage] operator[!=] Other[null] operator[SEP] { identifier[image] operator[=] Keyword[new] identifier[Image] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Element] identifier[title] operator[=] identifier[eImage] operator[SEP] identifier[getChild] operator[SEP] literal[String] , identifier[getRSSNamespace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[title] operator[!=] Other[null] operator[SEP] { identifier[image] operator[SEP] identifier[setTitle] operator[SEP] identifier[title] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[Element] identifier[url] operator[=] identifier[eImage] operator[SEP] identifier[getChild] operator[SEP] literal[String] , identifier[getRSSNamespace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[url] operator[!=] Other[null] operator[SEP] { identifier[image] operator[SEP] identifier[setUrl] operator[SEP] identifier[url] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[Element] identifier[link] operator[=] identifier[eImage] operator[SEP] identifier[getChild] operator[SEP] literal[String] , identifier[getRSSNamespace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[link] operator[!=] Other[null] operator[SEP] { identifier[image] operator[SEP] identifier[setLink] operator[SEP] identifier[link] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[image] operator[SEP] }
public synchronized boolean isDeleteInProgress() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "isDeleteInProgress"); SibTr.exit(tc, "isDeleteInProgress", Boolean.valueOf(_deleteInProgress)); } return _deleteInProgress; }
class class_name[name] begin[{] method[isDeleteInProgress, return_type[type[boolean]], modifier[synchronized public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["isDeleteInProgress"]]] call[SibTr.exit, parameter[member[.tc], literal["isDeleteInProgress"], call[Boolean.valueOf, parameter[member[._deleteInProgress]]]]] else begin[{] None end[}] return[member[._deleteInProgress]] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[boolean] identifier[isDeleteInProgress] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[_deleteInProgress] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[_deleteInProgress] operator[SEP] }
private void parseQueryError(boolean lastChunk) { while (true) { int openBracketPos = findNextChar(responseContent, '{'); if (isEmptySection(openBracketPos) || (lastChunk && openBracketPos < 0)) { sectionDone(); queryParsingState = transitionToNextToken(lastChunk); //warnings or status break; } int closeBracketPos = findSectionClosingPosition(responseContent, '{', '}'); if (closeBracketPos == -1) { break; } int length = closeBracketPos - openBracketPos - responseContent.readerIndex() + 1; responseContent.skipBytes(openBracketPos); ByteBuf resultSlice = responseContent.readSlice(length); queryErrorObservable.onNext(resultSlice.copy()); } }
class class_name[name] begin[{] method[parseQueryError, return_type[void], modifier[private], parameter[lastChunk]] begin[{] while[literal[true]] begin[{] local_variable[type[int], openBracketPos] if[binary_operation[call[.isEmptySection, parameter[member[.openBracketPos]]], ||, binary_operation[member[.lastChunk], &&, binary_operation[member[.openBracketPos], <, literal[0]]]]] begin[{] call[.sectionDone, parameter[]] assign[member[.queryParsingState], call[.transitionToNextToken, parameter[member[.lastChunk]]]] BreakStatement(goto=None, label=None) else begin[{] None end[}] local_variable[type[int], closeBracketPos] if[binary_operation[member[.closeBracketPos], ==, literal[1]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] local_variable[type[int], length] call[responseContent.skipBytes, parameter[member[.openBracketPos]]] local_variable[type[ByteBuf], resultSlice] call[queryErrorObservable.onNext, parameter[call[resultSlice.copy, parameter[]]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[parseQueryError] operator[SEP] Keyword[boolean] identifier[lastChunk] operator[SEP] { Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[int] identifier[openBracketPos] operator[=] identifier[findNextChar] operator[SEP] identifier[responseContent] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isEmptySection] operator[SEP] identifier[openBracketPos] operator[SEP] operator[||] operator[SEP] identifier[lastChunk] operator[&&] identifier[openBracketPos] operator[<] Other[0] operator[SEP] operator[SEP] { identifier[sectionDone] operator[SEP] operator[SEP] operator[SEP] identifier[queryParsingState] operator[=] identifier[transitionToNextToken] operator[SEP] identifier[lastChunk] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[int] identifier[closeBracketPos] operator[=] identifier[findSectionClosingPosition] operator[SEP] identifier[responseContent] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[closeBracketPos] operator[==] operator[-] Other[1] operator[SEP] { Keyword[break] operator[SEP] } Keyword[int] identifier[length] operator[=] identifier[closeBracketPos] operator[-] identifier[openBracketPos] operator[-] identifier[responseContent] operator[SEP] identifier[readerIndex] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] identifier[responseContent] operator[SEP] identifier[skipBytes] operator[SEP] identifier[openBracketPos] operator[SEP] operator[SEP] identifier[ByteBuf] identifier[resultSlice] operator[=] identifier[responseContent] operator[SEP] identifier[readSlice] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[queryErrorObservable] operator[SEP] identifier[onNext] operator[SEP] identifier[resultSlice] operator[SEP] identifier[copy] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public AuthenticatedUser authenticateUser(Credentials credentials) throws GuacamoleException { // Pull HTTP header from request if present HttpServletRequest request = credentials.getRequest(); if (request != null) { // Get the username from the header configured in guacamole.properties String username = request.getHeader(confService.getHttpAuthHeader()); if (username != null) { AuthenticatedUser authenticatedUser = authenticatedUserProvider.get(); authenticatedUser.init(username, credentials); return authenticatedUser; } } // Authentication not provided via header, yet, so we request it. throw new GuacamoleInvalidCredentialsException("Invalid login.", CredentialsInfo.USERNAME_PASSWORD); }
class class_name[name] begin[{] method[authenticateUser, return_type[type[AuthenticatedUser]], modifier[public], parameter[credentials]] begin[{] local_variable[type[HttpServletRequest], request] if[binary_operation[member[.request], !=, literal[null]]] begin[{] local_variable[type[String], username] if[binary_operation[member[.username], !=, literal[null]]] begin[{] local_variable[type[AuthenticatedUser], authenticatedUser] call[authenticatedUser.init, parameter[member[.username], member[.credentials]]] return[member[.authenticatedUser]] else begin[{] None end[}] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid login."), MemberReference(member=USERNAME_PASSWORD, postfix_operators=[], prefix_operators=[], qualifier=CredentialsInfo, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GuacamoleInvalidCredentialsException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] identifier[AuthenticatedUser] identifier[authenticateUser] operator[SEP] identifier[Credentials] identifier[credentials] operator[SEP] Keyword[throws] identifier[GuacamoleException] { identifier[HttpServletRequest] identifier[request] operator[=] identifier[credentials] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[request] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[username] operator[=] identifier[request] operator[SEP] identifier[getHeader] operator[SEP] identifier[confService] operator[SEP] identifier[getHttpAuthHeader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[username] operator[!=] Other[null] operator[SEP] { identifier[AuthenticatedUser] identifier[authenticatedUser] operator[=] identifier[authenticatedUserProvider] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[authenticatedUser] operator[SEP] identifier[init] operator[SEP] identifier[username] , identifier[credentials] operator[SEP] operator[SEP] Keyword[return] identifier[authenticatedUser] operator[SEP] } } Keyword[throw] Keyword[new] identifier[GuacamoleInvalidCredentialsException] operator[SEP] literal[String] , identifier[CredentialsInfo] operator[SEP] identifier[USERNAME_PASSWORD] operator[SEP] operator[SEP] }
@Override public GetMetricStatisticsResult getMetricStatistics(GetMetricStatisticsRequest request) { request = beforeClientExecution(request); return executeGetMetricStatistics(request); }
class class_name[name] begin[{] method[getMetricStatistics, return_type[type[GetMetricStatisticsResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeGetMetricStatistics, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[GetMetricStatisticsResult] identifier[getMetricStatistics] operator[SEP] identifier[GetMetricStatisticsRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetMetricStatistics] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
@Override public Response<MapMatchingResponse> executeCall() throws IOException { Response<MapMatchingResponse> response = getCall().execute(); MatchingResponseFactory factory = new MatchingResponseFactory(MapboxMapMatching.this); return factory.generate(response); }
class class_name[name] begin[{] method[executeCall, return_type[type[Response]], modifier[public], parameter[]] begin[{] local_variable[type[Response], response] local_variable[type[MatchingResponseFactory], factory] return[call[factory.generate, parameter[member[.response]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Response] operator[<] identifier[MapMatchingResponse] operator[>] identifier[executeCall] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Response] operator[<] identifier[MapMatchingResponse] operator[>] identifier[response] operator[=] identifier[getCall] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] identifier[MatchingResponseFactory] identifier[factory] operator[=] Keyword[new] identifier[MatchingResponseFactory] operator[SEP] identifier[MapboxMapMatching] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[return] identifier[factory] operator[SEP] identifier[generate] operator[SEP] identifier[response] operator[SEP] operator[SEP] }
public InvocationHandler getInvocationHandler(Object proxy) { Field field = getInvocationHandlerField(); try { return (InvocationHandler) field.get(proxy); } catch (IllegalArgumentException e) { throw new RuntimeException("Object is not a proxy of correct type", e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } }
class class_name[name] begin[{] method[getInvocationHandler, return_type[type[InvocationHandler]], modifier[public], parameter[proxy]] begin[{] local_variable[type[Field], field] TryStatement(block=[ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[MemberReference(member=proxy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=InvocationHandler, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Object is not a proxy of correct type"), 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=['IllegalArgumentException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[InvocationHandler] identifier[getInvocationHandler] operator[SEP] identifier[Object] identifier[proxy] operator[SEP] { identifier[Field] identifier[field] operator[=] identifier[getInvocationHandlerField] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] operator[SEP] identifier[InvocationHandler] operator[SEP] identifier[field] operator[SEP] identifier[get] operator[SEP] identifier[proxy] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
private boolean prescreen(Method obj) { BitSet bytecodeSet = getClassContext().getBytecodeSet(obj); return (bytecodeSet != null) && ((bytecodeSet.get(Const.LDC) || (bytecodeSet.get(Const.LDC_W)))); }
class class_name[name] begin[{] method[prescreen, return_type[type[boolean]], modifier[private], parameter[obj]] begin[{] local_variable[type[BitSet], bytecodeSet] return[binary_operation[binary_operation[member[.bytecodeSet], !=, literal[null]], &&, binary_operation[call[bytecodeSet.get, parameter[member[Const.LDC]]], ||, call[bytecodeSet.get, parameter[member[Const.LDC_W]]]]]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[prescreen] operator[SEP] identifier[Method] identifier[obj] operator[SEP] { identifier[BitSet] identifier[bytecodeSet] operator[=] identifier[getClassContext] operator[SEP] operator[SEP] operator[SEP] identifier[getBytecodeSet] operator[SEP] identifier[obj] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[bytecodeSet] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] operator[SEP] identifier[bytecodeSet] operator[SEP] identifier[get] operator[SEP] identifier[Const] operator[SEP] identifier[LDC] operator[SEP] operator[||] operator[SEP] identifier[bytecodeSet] operator[SEP] identifier[get] operator[SEP] identifier[Const] operator[SEP] identifier[LDC_W] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static void shutdownNodeByFiringEvents(Node node, boolean terminate) { final HazelcastInstanceImpl hazelcastInstance = node.hazelcastInstance; final LifecycleServiceImpl lifecycleService = hazelcastInstance.getLifecycleService(); lifecycleService.fireLifecycleEvent(LifecycleEvent.LifecycleState.SHUTTING_DOWN); node.shutdown(terminate); lifecycleService.fireLifecycleEvent(LifecycleEvent.LifecycleState.SHUTDOWN); }
class class_name[name] begin[{] method[shutdownNodeByFiringEvents, return_type[void], modifier[public static], parameter[node, terminate]] begin[{] local_variable[type[HazelcastInstanceImpl], hazelcastInstance] local_variable[type[LifecycleServiceImpl], lifecycleService] call[lifecycleService.fireLifecycleEvent, parameter[member[LifecycleEvent.LifecycleState.SHUTTING_DOWN]]] call[node.shutdown, parameter[member[.terminate]]] call[lifecycleService.fireLifecycleEvent, parameter[member[LifecycleEvent.LifecycleState.SHUTDOWN]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[shutdownNodeByFiringEvents] operator[SEP] identifier[Node] identifier[node] , Keyword[boolean] identifier[terminate] operator[SEP] { Keyword[final] identifier[HazelcastInstanceImpl] identifier[hazelcastInstance] operator[=] identifier[node] operator[SEP] identifier[hazelcastInstance] operator[SEP] Keyword[final] identifier[LifecycleServiceImpl] identifier[lifecycleService] operator[=] identifier[hazelcastInstance] operator[SEP] identifier[getLifecycleService] operator[SEP] operator[SEP] operator[SEP] identifier[lifecycleService] operator[SEP] identifier[fireLifecycleEvent] operator[SEP] identifier[LifecycleEvent] operator[SEP] identifier[LifecycleState] operator[SEP] identifier[SHUTTING_DOWN] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[shutdown] operator[SEP] identifier[terminate] operator[SEP] operator[SEP] identifier[lifecycleService] operator[SEP] identifier[fireLifecycleEvent] operator[SEP] identifier[LifecycleEvent] operator[SEP] identifier[LifecycleState] operator[SEP] identifier[SHUTDOWN] operator[SEP] operator[SEP] }
public CreateFleetResult withErrors(CreateFleetError... errors) { if (this.errors == null) { setErrors(new com.amazonaws.internal.SdkInternalList<CreateFleetError>(errors.length)); } for (CreateFleetError ele : errors) { this.errors.add(ele); } return this; }
class class_name[name] begin[{] method[withErrors, return_type[type[CreateFleetResult]], modifier[public], parameter[errors]] begin[{] if[binary_operation[THIS[member[None.errors]], ==, literal[null]]] begin[{] call[.setErrors, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=errors, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CreateFleetError, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=errors, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CreateFleetError, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[CreateFleetResult] identifier[withErrors] operator[SEP] identifier[CreateFleetError] operator[...] identifier[errors] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[errors] operator[==] Other[null] operator[SEP] { identifier[setErrors] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[CreateFleetError] operator[>] operator[SEP] identifier[errors] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[CreateFleetError] identifier[ele] operator[:] identifier[errors] operator[SEP] { Keyword[this] operator[SEP] identifier[errors] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
@Override public void removeByCP_T(long CProductId, String type) { for (CPDefinitionLink cpDefinitionLink : findByCP_T(CProductId, type, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(cpDefinitionLink); } }
class class_name[name] begin[{] method[removeByCP_T, return_type[void], modifier[public], parameter[CProductId, type]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cpDefinitionLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=CProductId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ALL_POS, postfix_operators=[], prefix_operators=[], qualifier=QueryUtil, selectors=[]), MemberReference(member=ALL_POS, postfix_operators=[], prefix_operators=[], qualifier=QueryUtil, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=findByCP_T, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cpDefinitionLink)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CPDefinitionLink, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[removeByCP_T] operator[SEP] Keyword[long] identifier[CProductId] , identifier[String] identifier[type] operator[SEP] { Keyword[for] operator[SEP] identifier[CPDefinitionLink] identifier[cpDefinitionLink] operator[:] identifier[findByCP_T] operator[SEP] identifier[CProductId] , identifier[type] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , Other[null] operator[SEP] operator[SEP] { identifier[remove] operator[SEP] identifier[cpDefinitionLink] operator[SEP] operator[SEP] } }
public void setPassword(String username, String newPassword) throws CmsException { m_securityManager.setPassword(m_context, username, newPassword); }
class class_name[name] begin[{] method[setPassword, return_type[void], modifier[public], parameter[username, newPassword]] begin[{] call[m_securityManager.setPassword, parameter[member[.m_context], member[.username], member[.newPassword]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setPassword] operator[SEP] identifier[String] identifier[username] , identifier[String] identifier[newPassword] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[m_securityManager] operator[SEP] identifier[setPassword] operator[SEP] identifier[m_context] , identifier[username] , identifier[newPassword] operator[SEP] operator[SEP] }
void fill(int depth) { long seed = clusteringSeeds[depth - 1]; Generator gen = generator.clusteringComponents.get(depth); gen.setSeed(seed); clusteringSeeds[depth] = seed(clusteringComponents[depth - 1].peek(), generator.clusteringComponents.get(depth - 1).type, seed); fill(clusteringComponents[depth], (int) gen.clusteringDistribution.next(), gen); }
class class_name[name] begin[{] method[fill, return_type[void], modifier[default], parameter[depth]] begin[{] local_variable[type[long], seed] local_variable[type[Generator], gen] call[gen.setSeed, parameter[member[.seed]]] assign[member[.clusteringSeeds], call[.seed, parameter[member[.clusteringComponents], call[generator.clusteringComponents.get, parameter[binary_operation[member[.depth], -, literal[1]]]], member[.seed]]]] call[.fill, parameter[member[.clusteringComponents], Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=gen.clusteringDistribution, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), member[.gen]]] end[}] END[}]
Keyword[void] identifier[fill] operator[SEP] Keyword[int] identifier[depth] operator[SEP] { Keyword[long] identifier[seed] operator[=] identifier[clusteringSeeds] operator[SEP] identifier[depth] operator[-] Other[1] operator[SEP] operator[SEP] identifier[Generator] identifier[gen] operator[=] identifier[generator] operator[SEP] identifier[clusteringComponents] operator[SEP] identifier[get] operator[SEP] identifier[depth] operator[SEP] operator[SEP] identifier[gen] operator[SEP] identifier[setSeed] operator[SEP] identifier[seed] operator[SEP] operator[SEP] identifier[clusteringSeeds] operator[SEP] identifier[depth] operator[SEP] operator[=] identifier[seed] operator[SEP] identifier[clusteringComponents] operator[SEP] identifier[depth] operator[-] Other[1] operator[SEP] operator[SEP] identifier[peek] operator[SEP] operator[SEP] , identifier[generator] operator[SEP] identifier[clusteringComponents] operator[SEP] identifier[get] operator[SEP] identifier[depth] operator[-] Other[1] operator[SEP] operator[SEP] identifier[type] , identifier[seed] operator[SEP] operator[SEP] identifier[fill] operator[SEP] identifier[clusteringComponents] operator[SEP] identifier[depth] operator[SEP] , operator[SEP] Keyword[int] operator[SEP] identifier[gen] operator[SEP] identifier[clusteringDistribution] operator[SEP] identifier[next] operator[SEP] operator[SEP] , identifier[gen] operator[SEP] operator[SEP] }
@Override protected double scoreImpl(List<Word> words1, List<Word> words2){ //文本1 StringBuilder text1 = new StringBuilder(); words1.forEach(word -> text1.append(word.getText())); //文本2 StringBuilder text2 = new StringBuilder(); words2.forEach(word -> text2.append(word.getText())); //计算文本1和文本2的Jaro距离 //Jaro距离也就是相似度分值 double score = jaroDistance(text1.toString(), text2.toString()); if(LOGGER.isDebugEnabled()){ LOGGER.debug("文本1:"+text1.toString()); LOGGER.debug("文本2:"+text2.toString()); LOGGER.debug("文本1和文本2的相似度分值:"+score); } return score; }
class class_name[name] begin[{] method[scoreImpl, return_type[type[double]], modifier[protected], parameter[words1, words2]] begin[{] local_variable[type[StringBuilder], text1] call[words1.forEach, parameter[LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=word, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=text1, selectors=[], type_arguments=None), parameters=[MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] local_variable[type[StringBuilder], text2] call[words2.forEach, parameter[LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=word, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=text2, selectors=[], type_arguments=None), parameters=[MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] local_variable[type[double], score] if[call[LOGGER.isDebugEnabled, parameter[]]] begin[{] call[LOGGER.debug, parameter[binary_operation[literal["文本1:"], +, call[text1.toString, parameter[]]]]] call[LOGGER.debug, parameter[binary_operation[literal["文本2:"], +, call[text2.toString, parameter[]]]]] call[LOGGER.debug, parameter[binary_operation[literal["文本1和文本2的相似度分值:"], +, member[.score]]]] else begin[{] None end[}] return[member[.score]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[double] identifier[scoreImpl] operator[SEP] identifier[List] operator[<] identifier[Word] operator[>] identifier[words1] , identifier[List] operator[<] identifier[Word] operator[>] identifier[words2] operator[SEP] { identifier[StringBuilder] identifier[text1] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[words1] operator[SEP] identifier[forEach] operator[SEP] identifier[word] operator[->] identifier[text1] operator[SEP] identifier[append] operator[SEP] identifier[word] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[text2] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[words2] operator[SEP] identifier[forEach] operator[SEP] identifier[word] operator[->] identifier[text2] operator[SEP] identifier[append] operator[SEP] identifier[word] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[score] operator[=] identifier[jaroDistance] operator[SEP] identifier[text1] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[text2] operator[SEP] identifier[toString] operator[SEP] 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[text1] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[text2] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[score] operator[SEP] operator[SEP] } Keyword[return] identifier[score] operator[SEP] }
private static Geometry shadowPolygon(Polygon polygon, double[] shadowOffset, GeometryFactory factory, boolean doUnion) { Coordinate[] shellCoords = polygon.getExteriorRing().getCoordinates(); Collection<Polygon> shadows = new ArrayList<Polygon>(); createShadowPolygons(shadows, shellCoords, shadowOffset, factory); final int nbOfHoles = polygon.getNumInteriorRing(); for (int i = 0; i < nbOfHoles; i++) { createShadowPolygons(shadows, polygon.getInteriorRingN(i).getCoordinates(), shadowOffset, factory); } if (!doUnion) { return factory.buildGeometry(shadows); } else { if (!shadows.isEmpty()) { Collection<Geometry> shadowParts = new ArrayList<Geometry>(); for (Polygon shadowPolygon : shadows) { shadowParts.add(shadowPolygon.difference(polygon)); } Geometry allShadowParts = factory.buildGeometry(shadowParts); Geometry union = allShadowParts.buffer(0); union.apply(new UpdateZCoordinateSequenceFilter(0, 1)); return union; } return null; } }
class class_name[name] begin[{] method[shadowPolygon, return_type[type[Geometry]], modifier[private static], parameter[polygon, shadowOffset, factory, doUnion]] begin[{] local_variable[type[Coordinate], shellCoords] local_variable[type[Collection], shadows] call[.createShadowPolygons, parameter[member[.shadows], member[.shellCoords], member[.shadowOffset], member[.factory]]] local_variable[type[int], nbOfHoles] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=shadows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInteriorRingN, postfix_operators=[], prefix_operators=[], qualifier=polygon, selectors=[MethodInvocation(arguments=[], member=getCoordinates, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=shadowOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=factory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createShadowPolygons, 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=nbOfHoles, 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) if[member[.doUnion]] begin[{] return[call[factory.buildGeometry, parameter[member[.shadows]]]] else begin[{] if[call[shadows.isEmpty, parameter[]]] begin[{] local_variable[type[Collection], shadowParts] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=polygon, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=difference, postfix_operators=[], prefix_operators=[], qualifier=shadowPolygon, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=shadowParts, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=shadows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=shadowPolygon)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Polygon, sub_type=None))), label=None) local_variable[type[Geometry], allShadowParts] local_variable[type[Geometry], union] call[union.apply, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UpdateZCoordinateSequenceFilter, sub_type=None))]] return[member[.union]] else begin[{] None end[}] return[literal[null]] end[}] end[}] END[}]
Keyword[private] Keyword[static] identifier[Geometry] identifier[shadowPolygon] operator[SEP] identifier[Polygon] identifier[polygon] , Keyword[double] operator[SEP] operator[SEP] identifier[shadowOffset] , identifier[GeometryFactory] identifier[factory] , Keyword[boolean] identifier[doUnion] operator[SEP] { identifier[Coordinate] operator[SEP] operator[SEP] identifier[shellCoords] operator[=] identifier[polygon] operator[SEP] identifier[getExteriorRing] operator[SEP] operator[SEP] operator[SEP] identifier[getCoordinates] operator[SEP] operator[SEP] operator[SEP] identifier[Collection] operator[<] identifier[Polygon] operator[>] identifier[shadows] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Polygon] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[createShadowPolygons] operator[SEP] identifier[shadows] , identifier[shellCoords] , identifier[shadowOffset] , identifier[factory] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[nbOfHoles] operator[=] identifier[polygon] operator[SEP] identifier[getNumInteriorRing] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[nbOfHoles] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[createShadowPolygons] operator[SEP] identifier[shadows] , identifier[polygon] operator[SEP] identifier[getInteriorRingN] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getCoordinates] operator[SEP] operator[SEP] , identifier[shadowOffset] , identifier[factory] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[doUnion] operator[SEP] { Keyword[return] identifier[factory] operator[SEP] identifier[buildGeometry] operator[SEP] identifier[shadows] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] operator[!] identifier[shadows] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[Collection] operator[<] identifier[Geometry] operator[>] identifier[shadowParts] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Geometry] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Polygon] identifier[shadowPolygon] operator[:] identifier[shadows] operator[SEP] { identifier[shadowParts] operator[SEP] identifier[add] operator[SEP] identifier[shadowPolygon] operator[SEP] identifier[difference] operator[SEP] identifier[polygon] operator[SEP] operator[SEP] operator[SEP] } identifier[Geometry] identifier[allShadowParts] operator[=] identifier[factory] operator[SEP] identifier[buildGeometry] operator[SEP] identifier[shadowParts] operator[SEP] operator[SEP] identifier[Geometry] identifier[union] operator[=] identifier[allShadowParts] operator[SEP] identifier[buffer] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[union] operator[SEP] identifier[apply] operator[SEP] Keyword[new] identifier[UpdateZCoordinateSequenceFilter] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[union] operator[SEP] } Keyword[return] Other[null] operator[SEP] } }
private String getFilenameInVfs(File res) { String resname = res.getAbsolutePath(); if (res.isDirectory()) { resname += "/"; } // translate the folder separator if necessary resname = resname.replace(File.separatorChar, '/'); return resname.substring(m_destinationPathInRfs.length()); }
class class_name[name] begin[{] method[getFilenameInVfs, return_type[type[String]], modifier[private], parameter[res]] begin[{] local_variable[type[String], resname] if[call[res.isDirectory, parameter[]]] begin[{] assign[member[.resname], literal["/"]] else begin[{] None end[}] assign[member[.resname], call[resname.replace, parameter[member[File.separatorChar], literal['/']]]] return[call[resname.substring, parameter[call[m_destinationPathInRfs.length, parameter[]]]]] end[}] END[}]
Keyword[private] identifier[String] identifier[getFilenameInVfs] operator[SEP] identifier[File] identifier[res] operator[SEP] { identifier[String] identifier[resname] operator[=] identifier[res] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[res] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] { identifier[resname] operator[+=] literal[String] operator[SEP] } identifier[resname] operator[=] identifier[resname] operator[SEP] identifier[replace] operator[SEP] identifier[File] operator[SEP] identifier[separatorChar] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[resname] operator[SEP] identifier[substring] operator[SEP] identifier[m_destinationPathInRfs] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); jTextField3 = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jTextField4 = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel1.setText("Name:"); jLabel2.setText("Date:"); jTextField2.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { dateFocusLost(evt); } }); jLabel3.setText("Time:"); jTextField3.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { timeFocusLost(evt); } }); jLabel4.setText("Date and Time:"); jTextField4.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { dateTimeFocusLost(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(26, 26, 26) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jLabel1) .addComponent(jLabel3) .addComponent(jLabel4)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE) .addComponent(jTextField4) .addComponent(jTextField3) .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)) .addContainerGap(124, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(33, 33, 33) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(59, Short.MAX_VALUE)) ); pack(); }
class class_name[name] begin[{] method[initComponents, return_type[void], modifier[private], parameter[]] begin[{] assign[member[.jLabel1], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JLabel, sub_type=None))))] assign[member[.jTextField1], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JTextField, sub_type=None))))] assign[member[.jLabel2], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JLabel, sub_type=None))))] assign[member[.jTextField2], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JTextField, sub_type=None))))] assign[member[.jLabel3], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JLabel, sub_type=None))))] assign[member[.jTextField3], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JTextField, sub_type=None))))] assign[member[.jLabel4], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JLabel, sub_type=None))))] assign[member[.jTextField4], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JTextField, sub_type=None))))] call[.setDefaultCloseOperation, parameter[member[javax.swing.WindowConstants.EXIT_ON_CLOSE]]] call[jLabel1.setText, parameter[literal["Name:"]]] call[jLabel2.setText, parameter[literal["Date:"]]] call[jTextField2.addFocusListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=evt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=dateFocusLost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=focusLost, parameters=[FormalParameter(annotations=[], modifiers=set(), name=evt, type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=FocusEvent, sub_type=None)))), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=FocusAdapter, sub_type=None)))))]] call[jLabel3.setText, parameter[literal["Time:"]]] call[jTextField3.addFocusListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=evt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=timeFocusLost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=focusLost, parameters=[FormalParameter(annotations=[], modifiers=set(), name=evt, type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=FocusEvent, sub_type=None)))), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=FocusAdapter, sub_type=None)))))]] call[jLabel4.setText, parameter[literal["Date and Time:"]]] call[jTextField4.addFocusListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=evt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=dateTimeFocusLost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=focusLost, parameters=[FormalParameter(annotations=[], modifiers=set(), name=evt, type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=FocusEvent, sub_type=None)))), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=FocusAdapter, sub_type=None)))))]] local_variable[type[javax], layout] call[.getContentPane, parameter[]] call[layout.setHorizontalGroup, parameter[call[layout.createParallelGroup, parameter[member[javax.swing.GroupLayout.Alignment.LEADING]]]]] call[layout.setVerticalGroup, parameter[call[layout.createParallelGroup, parameter[member[javax.swing.GroupLayout.Alignment.LEADING]]]]] call[.pack, parameter[]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[void] identifier[initComponents] operator[SEP] operator[SEP] { identifier[jLabel1] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JLabel] operator[SEP] operator[SEP] operator[SEP] identifier[jTextField1] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JTextField] operator[SEP] operator[SEP] operator[SEP] identifier[jLabel2] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JLabel] operator[SEP] operator[SEP] operator[SEP] identifier[jTextField2] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JTextField] operator[SEP] operator[SEP] operator[SEP] identifier[jLabel3] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JLabel] operator[SEP] operator[SEP] operator[SEP] identifier[jTextField3] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JTextField] operator[SEP] operator[SEP] operator[SEP] identifier[jLabel4] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JLabel] operator[SEP] operator[SEP] operator[SEP] identifier[jTextField4] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JTextField] operator[SEP] operator[SEP] operator[SEP] identifier[setDefaultCloseOperation] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[WindowConstants] operator[SEP] identifier[EXIT_ON_CLOSE] operator[SEP] operator[SEP] identifier[jLabel1] operator[SEP] identifier[setText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[jLabel2] operator[SEP] identifier[setText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[jTextField2] operator[SEP] identifier[addFocusListener] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[FocusAdapter] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[focusLost] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[FocusEvent] identifier[evt] operator[SEP] { identifier[dateFocusLost] operator[SEP] identifier[evt] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[jLabel3] operator[SEP] identifier[setText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[jTextField3] operator[SEP] identifier[addFocusListener] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[FocusAdapter] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[focusLost] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[FocusEvent] identifier[evt] operator[SEP] { identifier[timeFocusLost] operator[SEP] identifier[evt] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[jLabel4] operator[SEP] identifier[setText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[jTextField4] operator[SEP] identifier[addFocusListener] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[FocusAdapter] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[focusLost] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[FocusEvent] identifier[evt] operator[SEP] { identifier[dateTimeFocusLost] operator[SEP] identifier[evt] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] identifier[layout] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[getContentPane] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getContentPane] operator[SEP] operator[SEP] operator[SEP] identifier[setLayout] operator[SEP] identifier[layout] operator[SEP] operator[SEP] identifier[layout] operator[SEP] identifier[setHorizontalGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createParallelGroup] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[Alignment] operator[SEP] identifier[LEADING] operator[SEP] operator[SEP] identifier[addGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createSequentialGroup] operator[SEP] operator[SEP] operator[SEP] identifier[addGap] operator[SEP] Other[26] , Other[26] , Other[26] operator[SEP] operator[SEP] identifier[addGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createParallelGroup] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[Alignment] operator[SEP] identifier[LEADING] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jLabel2] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jLabel1] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jLabel3] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jLabel4] operator[SEP] operator[SEP] operator[SEP] identifier[addPreferredGap] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[LayoutStyle] operator[SEP] identifier[ComponentPlacement] operator[SEP] identifier[RELATED] , Other[18] , identifier[Short] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] identifier[addGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createParallelGroup] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[Alignment] operator[SEP] identifier[LEADING] , literal[boolean] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jTextField1] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[DEFAULT_SIZE] , Other[226] , identifier[Short] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jTextField4] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jTextField3] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jTextField2] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[DEFAULT_SIZE] , Other[130] , identifier[Short] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] operator[SEP] identifier[addContainerGap] operator[SEP] Other[124] , identifier[Short] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[layout] operator[SEP] identifier[setVerticalGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createParallelGroup] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[Alignment] operator[SEP] identifier[LEADING] operator[SEP] operator[SEP] identifier[addGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createSequentialGroup] operator[SEP] operator[SEP] operator[SEP] identifier[addGap] operator[SEP] Other[33] , Other[33] , Other[33] operator[SEP] operator[SEP] identifier[addGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createParallelGroup] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[Alignment] operator[SEP] identifier[BASELINE] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jLabel1] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jTextField1] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[DEFAULT_SIZE] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] operator[SEP] operator[SEP] operator[SEP] identifier[addPreferredGap] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[LayoutStyle] operator[SEP] identifier[ComponentPlacement] operator[SEP] identifier[RELATED] operator[SEP] operator[SEP] identifier[addGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createParallelGroup] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[Alignment] operator[SEP] identifier[BASELINE] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jLabel2] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jTextField2] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[DEFAULT_SIZE] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] operator[SEP] operator[SEP] operator[SEP] identifier[addPreferredGap] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[LayoutStyle] operator[SEP] identifier[ComponentPlacement] operator[SEP] identifier[RELATED] operator[SEP] operator[SEP] identifier[addGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createParallelGroup] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[Alignment] operator[SEP] identifier[BASELINE] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jLabel3] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jTextField3] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[DEFAULT_SIZE] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] operator[SEP] operator[SEP] operator[SEP] identifier[addPreferredGap] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[LayoutStyle] operator[SEP] identifier[ComponentPlacement] operator[SEP] identifier[RELATED] operator[SEP] operator[SEP] identifier[addGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createParallelGroup] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[Alignment] operator[SEP] identifier[BASELINE] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jLabel4] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[jTextField4] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[DEFAULT_SIZE] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] operator[SEP] operator[SEP] operator[SEP] identifier[addContainerGap] operator[SEP] Other[59] , identifier[Short] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pack] operator[SEP] operator[SEP] operator[SEP] }
public FSArray getDocuments() { if (SourceFile_Type.featOkTst && ((SourceFile_Type)jcasType).casFeat_documents == null) jcasType.jcas.throwFeatMissing("documents", "de.julielab.jules.types.ace.SourceFile"); return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((SourceFile_Type)jcasType).casFeatCode_documents)));}
class class_name[name] begin[{] method[getDocuments, return_type[type[FSArray]], modifier[public], parameter[]] begin[{] if[binary_operation[member[SourceFile_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SourceFile_Type, sub_type=None)), ==, literal[null]]]] begin[{] call[jcasType.jcas.throwFeatMissing, parameter[literal["documents"], literal["de.julielab.jules.types.ace.SourceFile"]]] else begin[{] None end[}] return[Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=addr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SourceFile_Type, sub_type=None))], member=ll_getRefValue, postfix_operators=[], prefix_operators=[], qualifier=jcasType.ll_cas, selectors=[], type_arguments=None)], member=ll_getFSForRef, postfix_operators=[], prefix_operators=[], qualifier=jcasType.ll_cas, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=FSArray, sub_type=None))] end[}] END[}]
Keyword[public] identifier[FSArray] identifier[getDocuments] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[SourceFile_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[SourceFile_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_documents] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[FSArray] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getFSForRef] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getRefValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[SourceFile_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_documents] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override protected Result check() throws Exception { Runtime runtime = Runtime.getRuntime(); long freeMemory = runtime.freeMemory(); long totalMemory = runtime.totalMemory(); long maxMemory = runtime.maxMemory(); boolean ok = maxMemory - (totalMemory - freeMemory) > avalibleMemthreshold; // 剩余空间小于2M报警 if (ok) { return Result.healthy(); } else { String msg = "max:" + (maxMemory / 1024 / 1024) + "M,total:" + (totalMemory / 1024 / 1024) + "M,used:" + ((totalMemory / 1024 / 1024) - (freeMemory / 1024 / 1024)) + "M,free:" + (freeMemory / 1024 / 1024) + "M"; return Result.unhealthy(msg); } }
class class_name[name] begin[{] method[check, return_type[type[Result]], modifier[protected], parameter[]] begin[{] local_variable[type[Runtime], runtime] local_variable[type[long], freeMemory] local_variable[type[long], totalMemory] local_variable[type[long], maxMemory] local_variable[type[boolean], ok] if[member[.ok]] begin[{] return[call[Result.healthy, parameter[]]] else begin[{] local_variable[type[String], msg] return[call[Result.unhealthy, parameter[member[.msg]]]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[Result] identifier[check] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Runtime] identifier[runtime] operator[=] identifier[Runtime] operator[SEP] identifier[getRuntime] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[freeMemory] operator[=] identifier[runtime] operator[SEP] identifier[freeMemory] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[totalMemory] operator[=] identifier[runtime] operator[SEP] identifier[totalMemory] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[maxMemory] operator[=] identifier[runtime] operator[SEP] identifier[maxMemory] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[ok] operator[=] identifier[maxMemory] operator[-] operator[SEP] identifier[totalMemory] operator[-] identifier[freeMemory] operator[SEP] operator[>] identifier[avalibleMemthreshold] operator[SEP] Keyword[if] operator[SEP] identifier[ok] operator[SEP] { Keyword[return] identifier[Result] operator[SEP] identifier[healthy] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[String] identifier[msg] operator[=] literal[String] operator[+] operator[SEP] identifier[maxMemory] operator[/] Other[1024] operator[/] Other[1024] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[totalMemory] operator[/] Other[1024] operator[/] Other[1024] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] operator[SEP] identifier[totalMemory] operator[/] Other[1024] operator[/] Other[1024] operator[SEP] operator[-] operator[SEP] identifier[freeMemory] operator[/] Other[1024] operator[/] Other[1024] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[freeMemory] operator[/] Other[1024] operator[/] Other[1024] operator[SEP] operator[+] literal[String] operator[SEP] Keyword[return] identifier[Result] operator[SEP] identifier[unhealthy] operator[SEP] identifier[msg] operator[SEP] operator[SEP] } }
public Deployment deploy(URL url, Context context, ClassLoader parent) throws DeployException { FileInputStream fis = null; try { File dashRaXml = new File(url.toURI()); ResourceAdapterParser parser = new ResourceAdapterParser(); fis = new FileInputStream(dashRaXml); XMLStreamReader xsr = XMLInputFactory.newInstance().createXMLStreamReader(fis); Activations activations = parser.parse(xsr); Merger merger = new Merger(); ClassLoaderDeployer classLoaderDeployer = context.getKernel().getBean("ClassLoaderDeployer", ClassLoaderDeployer.class); List<org.ironjacamar.core.api.deploymentrepository.Deployment> deployments = new ArrayList<org.ironjacamar.core.api.deploymentrepository.Deployment>(); for (Activation activation : activations.getActivations()) { Metadata metadata = metadataRepository.findByName(activation.getArchive()); if (metadata == null) throw new DeployException("Deployment " + activation.getArchive() + " not found"); Connector c = metadata.getMetadata(); File archive = metadata.getArchive(); Connector actC = merger.merge(c.copy(), activation); // Create a class loader for the archive context.put(Constants.ATTACHMENT_ARCHIVE, archive); classLoaderDeployer.clone().deploy(url, context, parent); KernelClassLoader cl = (KernelClassLoader)context.get(Constants.ATTACHMENT_CLASSLOADER); deployments.add(activate(actC, activation, activation.getArchive(), archive, cl)); } return new ActivationDeployment(url, deployments, deploymentRepository, deployments.get(0).getClassLoader()); } catch (DeployException de) { log.error(de.getMessage(), de); throw de; } catch (Throwable t) { log.error(t.getMessage(), t); throw new DeployException("Deployment " + url.toExternalForm() + " failed", t); } finally { if (fis != null) { try { fis.close(); } catch (IOException ignore) { // Ignore } } } }
class class_name[name] begin[{] method[deploy, return_type[type[Deployment]], modifier[public], parameter[url, context, parent]] begin[{] local_variable[type[FileInputStream], fis] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toURI, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=dashRaXml)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ResourceAdapterParser, sub_type=None)), name=parser)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResourceAdapterParser, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=dashRaXml, 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), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=XMLInputFactory, selectors=[MethodInvocation(arguments=[MemberReference(member=fis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createXMLStreamReader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=xsr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XMLStreamReader, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=xsr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None), name=activations)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Activations, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Merger, sub_type=None)), name=merger)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Merger, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKernel, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ClassLoaderDeployer"), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClassLoaderDeployer, sub_type=None))], member=getBean, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=classLoaderDeployer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClassLoaderDeployer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=ironjacamar, sub_type=ReferenceType(arguments=None, dimensions=None, name=core, sub_type=ReferenceType(arguments=None, dimensions=None, name=api, sub_type=ReferenceType(arguments=None, dimensions=None, name=deploymentrepository, sub_type=ReferenceType(arguments=None, dimensions=None, name=Deployment, sub_type=None)))))))], dimensions=None, name=ArrayList, sub_type=None)), name=deployments)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=ironjacamar, sub_type=ReferenceType(arguments=None, dimensions=None, name=core, sub_type=ReferenceType(arguments=None, dimensions=None, name=api, sub_type=ReferenceType(arguments=None, dimensions=None, name=deploymentrepository, sub_type=ReferenceType(arguments=None, dimensions=None, name=Deployment, sub_type=None)))))))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getArchive, postfix_operators=[], prefix_operators=[], qualifier=activation, selectors=[], type_arguments=None)], member=findByName, postfix_operators=[], prefix_operators=[], qualifier=metadataRepository, selectors=[], type_arguments=None), name=metadata)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Metadata, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Deployment "), operandr=MethodInvocation(arguments=[], member=getArchive, postfix_operators=[], prefix_operators=[], qualifier=activation, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" not found"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DeployException, sub_type=None)), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMetadata, postfix_operators=[], prefix_operators=[], qualifier=metadata, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Connector, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getArchive, postfix_operators=[], prefix_operators=[], qualifier=metadata, selectors=[], type_arguments=None), name=archive)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=copy, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), MemberReference(member=activation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=merge, postfix_operators=[], prefix_operators=[], qualifier=merger, selectors=[], type_arguments=None), name=actC)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Connector, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ATTACHMENT_ARCHIVE, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), MemberReference(member=archive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=classLoaderDeployer, selectors=[MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deploy, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=ATTACHMENT_CLASSLOADER, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=KernelClassLoader, sub_type=None)), name=cl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KernelClassLoader, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=actC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=activation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getArchive, postfix_operators=[], prefix_operators=[], qualifier=activation, selectors=[], type_arguments=None), MemberReference(member=archive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=activate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=deployments, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getActivations, postfix_operators=[], prefix_operators=[], qualifier=activations, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=activation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Activation, sub_type=None))), label=None), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=deployments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=deploymentRepository, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=deployments, selectors=[MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ActivationDeployment, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=de, selectors=[], type_arguments=None), MemberReference(member=de, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=de, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=de, types=['DeployException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Deployment "), operandr=MethodInvocation(arguments=[], member=toExternalForm, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" failed"), operator=+), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DeployException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=fis, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['IOException']))], finally_block=None, label=None, resources=None)]))], label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Deployment] identifier[deploy] operator[SEP] identifier[URL] identifier[url] , identifier[Context] identifier[context] , identifier[ClassLoader] identifier[parent] operator[SEP] Keyword[throws] identifier[DeployException] { identifier[FileInputStream] identifier[fis] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[File] identifier[dashRaXml] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[url] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ResourceAdapterParser] identifier[parser] operator[=] Keyword[new] identifier[ResourceAdapterParser] operator[SEP] operator[SEP] operator[SEP] identifier[fis] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[dashRaXml] operator[SEP] operator[SEP] identifier[XMLStreamReader] identifier[xsr] operator[=] identifier[XMLInputFactory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[createXMLStreamReader] operator[SEP] identifier[fis] operator[SEP] operator[SEP] identifier[Activations] identifier[activations] operator[=] identifier[parser] operator[SEP] identifier[parse] operator[SEP] identifier[xsr] operator[SEP] operator[SEP] identifier[Merger] identifier[merger] operator[=] Keyword[new] identifier[Merger] operator[SEP] operator[SEP] operator[SEP] identifier[ClassLoaderDeployer] identifier[classLoaderDeployer] operator[=] identifier[context] operator[SEP] identifier[getKernel] operator[SEP] operator[SEP] operator[SEP] identifier[getBean] operator[SEP] literal[String] , identifier[ClassLoaderDeployer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[org] operator[SEP] identifier[ironjacamar] operator[SEP] identifier[core] operator[SEP] identifier[api] operator[SEP] identifier[deploymentrepository] operator[SEP] identifier[Deployment] operator[>] identifier[deployments] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[org] operator[SEP] identifier[ironjacamar] operator[SEP] identifier[core] operator[SEP] identifier[api] operator[SEP] identifier[deploymentrepository] operator[SEP] identifier[Deployment] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Activation] identifier[activation] operator[:] identifier[activations] operator[SEP] identifier[getActivations] operator[SEP] operator[SEP] operator[SEP] { identifier[Metadata] identifier[metadata] operator[=] identifier[metadataRepository] operator[SEP] identifier[findByName] operator[SEP] identifier[activation] operator[SEP] identifier[getArchive] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[metadata] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[DeployException] operator[SEP] literal[String] operator[+] identifier[activation] operator[SEP] identifier[getArchive] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[Connector] identifier[c] operator[=] identifier[metadata] operator[SEP] identifier[getMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[archive] operator[=] identifier[metadata] operator[SEP] identifier[getArchive] operator[SEP] operator[SEP] operator[SEP] identifier[Connector] identifier[actC] operator[=] identifier[merger] operator[SEP] identifier[merge] operator[SEP] identifier[c] operator[SEP] identifier[copy] operator[SEP] operator[SEP] , identifier[activation] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[put] operator[SEP] identifier[Constants] operator[SEP] identifier[ATTACHMENT_ARCHIVE] , identifier[archive] operator[SEP] operator[SEP] identifier[classLoaderDeployer] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] identifier[deploy] operator[SEP] identifier[url] , identifier[context] , identifier[parent] operator[SEP] operator[SEP] identifier[KernelClassLoader] identifier[cl] operator[=] operator[SEP] identifier[KernelClassLoader] operator[SEP] identifier[context] operator[SEP] identifier[get] operator[SEP] identifier[Constants] operator[SEP] identifier[ATTACHMENT_CLASSLOADER] operator[SEP] operator[SEP] identifier[deployments] operator[SEP] identifier[add] operator[SEP] identifier[activate] operator[SEP] identifier[actC] , identifier[activation] , identifier[activation] operator[SEP] identifier[getArchive] operator[SEP] operator[SEP] , identifier[archive] , identifier[cl] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[ActivationDeployment] operator[SEP] identifier[url] , identifier[deployments] , identifier[deploymentRepository] , identifier[deployments] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[DeployException] identifier[de] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] identifier[de] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[de] operator[SEP] operator[SEP] Keyword[throw] identifier[de] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[t] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[DeployException] operator[SEP] literal[String] operator[+] identifier[url] operator[SEP] identifier[toExternalForm] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[t] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[fis] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[fis] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ignore] operator[SEP] { } } } }
public static void setBeanProperty(Object object, String prop, String value, Map<String, Object> objects) { prop = makePropertyName(prop); try { boolean found = false; Method[] methods = object.getClass().getMethods(); for (int ix = 0; ix < methods.length && !found; ix++) { if (!methods[ix].getName().equals(prop)) continue; if (methods[ix].getParameterTypes().length != 1) continue; Class type = methods[ix].getParameterTypes()[0]; methods[ix].invoke(object, convertToType(value, type, objects)); found = true; } if (!found) throw new DukeConfigException("Couldn't find method '" + prop + "' in " + "class " + object.getClass()); } catch (IllegalArgumentException e) { throw new DukeConfigException("Couldn't set bean property " + prop + " on object of class " + object.getClass() + ": " + e); } catch (IllegalAccessException e) { throw new DukeException(e); } catch (InvocationTargetException e) { throw new DukeConfigException("Couldn't set bean property " + prop + " on object of class " + object.getClass() + ": " + e); } }
class class_name[name] begin[{] method[setBeanProperty, return_type[void], modifier[public static], parameter[object, prop, value, objects]] begin[{] assign[member[.prop], call[.makePropertyName, parameter[member[.prop]]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=found)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[MethodInvocation(arguments=[], member=getMethods, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=methods)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Method, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=methods, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=methods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=methods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), StatementExpression(expression=MemberReference(member=methods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=objects, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertToType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=invoke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=found, 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=BinaryOperation(operandl=MemberReference(member=ix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=methods, selectors=[]), operator=<), operandr=MemberReference(member=found, 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=ix)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ix, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), IfStatement(condition=MemberReference(member=found, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Couldn't find method '"), operandr=MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' in "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="class "), operator=+), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DukeConfigException, sub_type=None)), label=None))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Couldn't set bean property "), operandr=MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" on object of class "), operator=+), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MemberReference(member=e, 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=DukeConfigException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalArgumentException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DukeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Couldn't set bean property "), operandr=MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" on object of class "), operator=+), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MemberReference(member=e, 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=DukeConfigException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InvocationTargetException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setBeanProperty] operator[SEP] identifier[Object] identifier[object] , identifier[String] identifier[prop] , identifier[String] identifier[value] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[objects] operator[SEP] { identifier[prop] operator[=] identifier[makePropertyName] operator[SEP] identifier[prop] operator[SEP] operator[SEP] Keyword[try] { Keyword[boolean] identifier[found] operator[=] literal[boolean] operator[SEP] identifier[Method] operator[SEP] operator[SEP] identifier[methods] operator[=] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getMethods] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ix] operator[=] Other[0] operator[SEP] identifier[ix] operator[<] identifier[methods] operator[SEP] identifier[length] operator[&&] operator[!] identifier[found] operator[SEP] identifier[ix] operator[++] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[methods] operator[SEP] identifier[ix] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[prop] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[methods] operator[SEP] identifier[ix] operator[SEP] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[!=] Other[1] operator[SEP] Keyword[continue] operator[SEP] identifier[Class] identifier[type] operator[=] identifier[methods] operator[SEP] identifier[ix] operator[SEP] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[methods] operator[SEP] identifier[ix] operator[SEP] operator[SEP] identifier[invoke] operator[SEP] identifier[object] , identifier[convertToType] operator[SEP] identifier[value] , identifier[type] , identifier[objects] operator[SEP] operator[SEP] operator[SEP] identifier[found] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[found] operator[SEP] Keyword[throw] Keyword[new] identifier[DukeConfigException] operator[SEP] literal[String] operator[+] identifier[prop] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[DukeConfigException] operator[SEP] literal[String] operator[+] identifier[prop] operator[+] literal[String] operator[+] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[DukeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InvocationTargetException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[DukeConfigException] operator[SEP] literal[String] operator[+] identifier[prop] operator[+] literal[String] operator[+] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[e] operator[SEP] operator[SEP] } }
public Color getColorOrDefault() { Color color = getColor(); if (color == null) { color = new Color(); } return color; }
class class_name[name] begin[{] method[getColorOrDefault, return_type[type[Color]], modifier[public], parameter[]] begin[{] local_variable[type[Color], color] if[binary_operation[member[.color], ==, literal[null]]] begin[{] assign[member[.color], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Color, sub_type=None))] else begin[{] None end[}] return[member[.color]] end[}] END[}]
Keyword[public] identifier[Color] identifier[getColorOrDefault] operator[SEP] operator[SEP] { identifier[Color] identifier[color] operator[=] identifier[getColor] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[color] operator[==] Other[null] operator[SEP] { identifier[color] operator[=] Keyword[new] identifier[Color] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[color] operator[SEP] }
public void setReservedInstancesListings(java.util.Collection<ReservedInstancesListing> reservedInstancesListings) { if (reservedInstancesListings == null) { this.reservedInstancesListings = null; return; } this.reservedInstancesListings = new com.amazonaws.internal.SdkInternalList<ReservedInstancesListing>(reservedInstancesListings); }
class class_name[name] begin[{] method[setReservedInstancesListings, return_type[void], modifier[public], parameter[reservedInstancesListings]] begin[{] if[binary_operation[member[.reservedInstancesListings], ==, literal[null]]] begin[{] assign[THIS[member[None.reservedInstancesListings]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.reservedInstancesListings]], ClassCreator(arguments=[MemberReference(member=reservedInstancesListings, 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=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ReservedInstancesListing, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setReservedInstancesListings] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[ReservedInstancesListing] operator[>] identifier[reservedInstancesListings] operator[SEP] { Keyword[if] operator[SEP] identifier[reservedInstancesListings] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[reservedInstancesListings] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[reservedInstancesListings] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[ReservedInstancesListing] operator[>] operator[SEP] identifier[reservedInstancesListings] operator[SEP] operator[SEP] }
@NonNull public Transition setMatchOrder(@Nullable int... matches) { if (matches == null || matches.length == 0) { mMatchOrder = DEFAULT_MATCH_ORDER; } else { for (int i = 0; i < matches.length; i++) { int match = matches[i]; if (!isValidMatch(match)) { throw new IllegalArgumentException("matches contains invalid value"); } if (alreadyContains(matches, i)) { throw new IllegalArgumentException("matches contains a duplicate value"); } } mMatchOrder = matches.clone(); } return this; }
class class_name[name] begin[{] method[setMatchOrder, return_type[type[Transition]], modifier[public], parameter[matches]] begin[{] if[binary_operation[binary_operation[member[.matches], ==, literal[null]], ||, binary_operation[member[matches.length], ==, literal[0]]]] begin[{] assign[member[.mMatchOrder], member[.DEFAULT_MATCH_ORDER]] else begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=matches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=match)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isValidMatch, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="matches contains invalid value")], 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)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=matches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=alreadyContains, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="matches contains a duplicate value")], 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)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=matches, 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[.mMatchOrder], call[matches.clone, parameter[]]] end[}] return[THIS[]] end[}] END[}]
annotation[@] identifier[NonNull] Keyword[public] identifier[Transition] identifier[setMatchOrder] operator[SEP] annotation[@] identifier[Nullable] Keyword[int] operator[...] identifier[matches] operator[SEP] { Keyword[if] operator[SEP] identifier[matches] operator[==] Other[null] operator[||] identifier[matches] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { identifier[mMatchOrder] operator[=] identifier[DEFAULT_MATCH_ORDER] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[matches] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[match] operator[=] identifier[matches] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isValidMatch] operator[SEP] identifier[match] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[alreadyContains] operator[SEP] identifier[matches] , identifier[i] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } identifier[mMatchOrder] operator[=] identifier[matches] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
private static String printStatements(Context context, Iterable<JCStatement> statements) { StringWriter writer = new StringWriter(); try { pretty(context, writer).printStats(com.sun.tools.javac.util.List.from(statements)); } catch (IOException e) { throw new AssertionError("StringWriter cannot throw IOExceptions"); } return writer.toString(); }
class class_name[name] begin[{] method[printStatements, return_type[type[String]], modifier[private static], parameter[context, statements]] begin[{] local_variable[type[StringWriter], writer] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pretty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=statements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=from, postfix_operators=[], prefix_operators=[], qualifier=com.sun.tools.javac.util.List, selectors=[], type_arguments=None)], member=printStats, 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="StringWriter cannot throw IOExceptions")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AssertionError, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) return[call[writer.toString, parameter[]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[printStatements] operator[SEP] identifier[Context] identifier[context] , identifier[Iterable] operator[<] identifier[JCStatement] operator[>] identifier[statements] operator[SEP] { identifier[StringWriter] identifier[writer] operator[=] Keyword[new] identifier[StringWriter] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[pretty] operator[SEP] identifier[context] , identifier[writer] operator[SEP] operator[SEP] identifier[printStats] operator[SEP] identifier[com] operator[SEP] identifier[sun] operator[SEP] identifier[tools] operator[SEP] identifier[javac] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[SEP] identifier[from] operator[SEP] identifier[statements] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[AssertionError] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[writer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
static ModifiableKeyStoreService getModifiableKeyStoreService(OperationContext context) throws OperationFailedException { ServiceRegistry serviceRegistry = context.getServiceRegistry(true); PathAddress currentAddress = context.getCurrentAddress(); RuntimeCapability<Void> runtimeCapability = KEY_STORE_RUNTIME_CAPABILITY.fromBaseCapability(currentAddress.getLastElement().getValue()); ServiceName serviceName = runtimeCapability.getCapabilityServiceName(); ServiceController<KeyStore> serviceContainer = getRequiredService(serviceRegistry, serviceName, KeyStore.class); ServiceController.State serviceState = serviceContainer.getState(); if (serviceState != ServiceController.State.UP) { throw ROOT_LOGGER.requiredServiceNotUp(serviceName, serviceState); } return (ModifiableKeyStoreService) serviceContainer.getService(); }
class class_name[name] begin[{] method[getModifiableKeyStoreService, return_type[type[ModifiableKeyStoreService]], modifier[static], parameter[context]] begin[{] local_variable[type[ServiceRegistry], serviceRegistry] local_variable[type[PathAddress], currentAddress] local_variable[type[RuntimeCapability], runtimeCapability] local_variable[type[ServiceName], serviceName] local_variable[type[ServiceController], serviceContainer] local_variable[type[ServiceController], serviceState] if[binary_operation[member[.serviceState], !=, member[ServiceController.State.UP]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=serviceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=serviceState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=requiredServiceNotUp, postfix_operators=[], prefix_operators=[], qualifier=ROOT_LOGGER, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] return[Cast(expression=MethodInvocation(arguments=[], member=getService, postfix_operators=[], prefix_operators=[], qualifier=serviceContainer, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ModifiableKeyStoreService, sub_type=None))] end[}] END[}]
Keyword[static] identifier[ModifiableKeyStoreService] identifier[getModifiableKeyStoreService] operator[SEP] identifier[OperationContext] identifier[context] operator[SEP] Keyword[throws] identifier[OperationFailedException] { identifier[ServiceRegistry] identifier[serviceRegistry] operator[=] identifier[context] operator[SEP] identifier[getServiceRegistry] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[PathAddress] identifier[currentAddress] operator[=] identifier[context] operator[SEP] identifier[getCurrentAddress] operator[SEP] operator[SEP] operator[SEP] identifier[RuntimeCapability] operator[<] identifier[Void] operator[>] identifier[runtimeCapability] operator[=] identifier[KEY_STORE_RUNTIME_CAPABILITY] operator[SEP] identifier[fromBaseCapability] operator[SEP] identifier[currentAddress] operator[SEP] identifier[getLastElement] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ServiceName] identifier[serviceName] operator[=] identifier[runtimeCapability] operator[SEP] identifier[getCapabilityServiceName] operator[SEP] operator[SEP] operator[SEP] identifier[ServiceController] operator[<] identifier[KeyStore] operator[>] identifier[serviceContainer] operator[=] identifier[getRequiredService] operator[SEP] identifier[serviceRegistry] , identifier[serviceName] , identifier[KeyStore] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[ServiceController] operator[SEP] identifier[State] identifier[serviceState] operator[=] identifier[serviceContainer] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[serviceState] operator[!=] identifier[ServiceController] operator[SEP] identifier[State] operator[SEP] identifier[UP] operator[SEP] { Keyword[throw] identifier[ROOT_LOGGER] operator[SEP] identifier[requiredServiceNotUp] operator[SEP] identifier[serviceName] , identifier[serviceState] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[ModifiableKeyStoreService] operator[SEP] identifier[serviceContainer] operator[SEP] identifier[getService] operator[SEP] operator[SEP] operator[SEP] }
public void delete_property(String name, String propname) throws DevFailed { databaseDAO.delete_property(this, name, propname); }
class class_name[name] begin[{] method[delete_property, return_type[void], modifier[public], parameter[name, propname]] begin[{] call[databaseDAO.delete_property, parameter[THIS[], member[.name], member[.propname]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[delete_property] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[propname] operator[SEP] Keyword[throws] identifier[DevFailed] { identifier[databaseDAO] operator[SEP] identifier[delete_property] operator[SEP] Keyword[this] , identifier[name] , identifier[propname] operator[SEP] operator[SEP] }
public static Boolean getBooleanSetting(Map<String, Object> settings, String key, Boolean defaultVal) { final Object value = settings.get(key); if (value == null) { return defaultVal; } if (value instanceof Boolean) { return (Boolean) value; } if (value instanceof String) { return Boolean.valueOf((String) value); } return defaultVal; }
class class_name[name] begin[{] method[getBooleanSetting, return_type[type[Boolean]], modifier[public static], parameter[settings, key, defaultVal]] begin[{] local_variable[type[Object], value] if[binary_operation[member[.value], ==, literal[null]]] begin[{] return[member[.defaultVal]] else begin[{] None end[}] if[binary_operation[member[.value], instanceof, type[Boolean]]] begin[{] return[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.value], instanceof, type[String]]] begin[{] return[call[Boolean.valueOf, parameter[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]]] else begin[{] None end[}] return[member[.defaultVal]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Boolean] identifier[getBooleanSetting] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[settings] , identifier[String] identifier[key] , identifier[Boolean] identifier[defaultVal] operator[SEP] { Keyword[final] identifier[Object] identifier[value] operator[=] identifier[settings] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[defaultVal] operator[SEP] } Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Boolean] operator[SEP] { Keyword[return] operator[SEP] identifier[Boolean] operator[SEP] identifier[value] operator[SEP] } Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[String] operator[SEP] { Keyword[return] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[value] operator[SEP] operator[SEP] } Keyword[return] identifier[defaultVal] operator[SEP] }
protected ComponentView getComponentView() { ComponentView cv = componentView; // we need to check both, otherwise it is possible for // componentView to be initialized before reference if (cv == null) { synchronized (this) { cv = componentView; if (cv == null) { cv = getMSCService(componentViewName, ComponentView.class); if (cv == null) { throw WSLogger.ROOT_LOGGER.cannotFindComponentView(componentViewName); } if (reference == null) { try { reference = cv.createInstance(); } catch (Exception e) { throw new RuntimeException(e); } } componentView = cv; } } } return cv; }
class class_name[name] begin[{] method[getComponentView, return_type[type[ComponentView]], modifier[protected], parameter[]] begin[{] local_variable[type[ComponentView], cv] if[binary_operation[member[.cv], ==, literal[null]]] begin[{] SYNCHRONIZED[THIS[]] BEGIN[{] assign[member[.cv], member[.componentView]] if[binary_operation[member[.cv], ==, literal[null]]] begin[{] assign[member[.cv], call[.getMSCService, parameter[member[.componentViewName], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ComponentView, sub_type=None))]]] if[binary_operation[member[.cv], ==, literal[null]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=componentViewName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cannotFindComponentView, postfix_operators=[], prefix_operators=[], qualifier=WSLogger.ROOT_LOGGER, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] if[binary_operation[member[.reference], ==, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=reference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=createInstance, postfix_operators=[], prefix_operators=[], qualifier=cv, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] assign[member[.componentView], member[.cv]] else begin[{] None end[}] END[}] else begin[{] None end[}] return[member[.cv]] end[}] END[}]
Keyword[protected] identifier[ComponentView] identifier[getComponentView] operator[SEP] operator[SEP] { identifier[ComponentView] identifier[cv] operator[=] identifier[componentView] operator[SEP] Keyword[if] operator[SEP] identifier[cv] operator[==] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { identifier[cv] operator[=] identifier[componentView] operator[SEP] Keyword[if] operator[SEP] identifier[cv] operator[==] Other[null] operator[SEP] { identifier[cv] operator[=] identifier[getMSCService] operator[SEP] identifier[componentViewName] , identifier[ComponentView] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cv] operator[==] Other[null] operator[SEP] { Keyword[throw] identifier[WSLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[cannotFindComponentView] operator[SEP] identifier[componentViewName] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[reference] operator[==] Other[null] operator[SEP] { Keyword[try] { identifier[reference] operator[=] identifier[cv] operator[SEP] identifier[createInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } identifier[componentView] operator[=] identifier[cv] operator[SEP] } } } Keyword[return] identifier[cv] operator[SEP] }
static boolean isGetOrSetKey(Node node) { switch (node.getToken()) { case GETTER_DEF: case SETTER_DEF: return true; case COMPUTED_PROP: return node.getBooleanProp(Node.COMPUTED_PROP_GETTER) || node.getBooleanProp(Node.COMPUTED_PROP_SETTER); default: break; } return false; }
class class_name[name] begin[{] method[isGetOrSetKey, return_type[type[boolean]], modifier[static], parameter[node]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['GETTER_DEF', 'SETTER_DEF'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]), SwitchStatementCase(case=['COMPUTED_PROP'], statements=[ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=COMPUTED_PROP_GETTER, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[])], member=getBooleanProp, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=COMPUTED_PROP_SETTER, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[])], member=getBooleanProp, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), operator=||), label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[], member=getToken, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), label=None) return[literal[false]] end[}] END[}]
Keyword[static] Keyword[boolean] identifier[isGetOrSetKey] operator[SEP] identifier[Node] identifier[node] operator[SEP] { Keyword[switch] operator[SEP] identifier[node] operator[SEP] identifier[getToken] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[GETTER_DEF] operator[:] Keyword[case] identifier[SETTER_DEF] operator[:] Keyword[return] literal[boolean] operator[SEP] Keyword[case] identifier[COMPUTED_PROP] operator[:] Keyword[return] identifier[node] operator[SEP] identifier[getBooleanProp] operator[SEP] identifier[Node] operator[SEP] identifier[COMPUTED_PROP_GETTER] operator[SEP] operator[||] identifier[node] operator[SEP] identifier[getBooleanProp] operator[SEP] identifier[Node] operator[SEP] identifier[COMPUTED_PROP_SETTER] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[break] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static ParametricFactorGraph buildSequenceModel(Iterable<String> emissionFeatureLines, String featureDelimiter) { // Read in the possible values of each variable. List<String> words = StringUtils.readColumnFromDelimitedLines(emissionFeatureLines, 0, featureDelimiter); List<String> labels = StringUtils.readColumnFromDelimitedLines(emissionFeatureLines, 1, featureDelimiter); List<String> emissionFeatures = StringUtils.readColumnFromDelimitedLines(emissionFeatureLines, 2, featureDelimiter); // Create dictionaries for each variable's values. DiscreteVariable wordType = new DiscreteVariable("word", words); DiscreteVariable labelType = new DiscreteVariable("label", labels); DiscreteVariable emissionFeatureType = new DiscreteVariable("emissionFeature", emissionFeatures); // Create a dynamic factor graph with a single plate replicating // the input/output variables. ParametricFactorGraphBuilder builder = new ParametricFactorGraphBuilder(); builder.addPlate(PLATE_NAME, new VariableNumMap(Ints.asList(1, 2), Arrays.asList(INPUT_NAME, OUTPUT_NAME), Arrays.asList(wordType, labelType)), 10000); String inputPattern = PLATE_NAME + "/?(0)/" + INPUT_NAME; String outputPattern = PLATE_NAME + "/?(0)/" + OUTPUT_NAME; String nextOutputPattern = PLATE_NAME + "/?(1)/" + OUTPUT_NAME; VariableNumMap plateVars = new VariableNumMap(Ints.asList(1, 2), Arrays.asList(inputPattern, outputPattern), Arrays.asList(wordType, labelType)); // Read in the emission features (for the word/label weights). VariableNumMap x = plateVars.getVariablesByName(inputPattern); VariableNumMap y = plateVars.getVariablesByName(outputPattern); VariableNumMap emissionFeatureVar = VariableNumMap.singleton(0, "emissionFeature", emissionFeatureType); TableFactor emissionFeatureFactor = TableFactor.fromDelimitedFile( Arrays.asList(x, y, emissionFeatureVar), emissionFeatureLines, featureDelimiter, false, SparseTensorBuilder.getFactory()) .cacheWeightPermutations(); System.out.println(emissionFeatureFactor.getVars()); // Add a parametric factor for the word/label weights DiscreteLogLinearFactor emissionFactor = new DiscreteLogLinearFactor(x.union(y), emissionFeatureVar, emissionFeatureFactor); builder.addFactor(WORD_LABEL_FACTOR, emissionFactor, VariableNamePattern.fromTemplateVariables(plateVars, VariableNumMap.EMPTY)); // Create a factor connecting adjacent labels VariableNumMap adjacentVars = new VariableNumMap(Ints.asList(0, 1), Arrays.asList(outputPattern, nextOutputPattern), Arrays.asList(labelType, labelType)); builder.addFactor(TRANSITION_FACTOR, DiscreteLogLinearFactor.createIndicatorFactor(adjacentVars), VariableNamePattern.fromTemplateVariables(adjacentVars, VariableNumMap.EMPTY)); return builder.build(); }
class class_name[name] begin[{] method[buildSequenceModel, return_type[type[ParametricFactorGraph]], modifier[public static], parameter[emissionFeatureLines, featureDelimiter]] begin[{] local_variable[type[List], words] local_variable[type[List], labels] local_variable[type[List], emissionFeatures] local_variable[type[DiscreteVariable], wordType] local_variable[type[DiscreteVariable], labelType] local_variable[type[DiscreteVariable], emissionFeatureType] local_variable[type[ParametricFactorGraphBuilder], builder] call[builder.addPlate, parameter[member[.PLATE_NAME], ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Ints, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=INPUT_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=OUTPUT_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=wordType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=labelType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VariableNumMap, sub_type=None)), literal[10000]]] local_variable[type[String], inputPattern] local_variable[type[String], outputPattern] local_variable[type[String], nextOutputPattern] local_variable[type[VariableNumMap], plateVars] local_variable[type[VariableNumMap], x] local_variable[type[VariableNumMap], y] local_variable[type[VariableNumMap], emissionFeatureVar] local_variable[type[TableFactor], emissionFeatureFactor] call[System.out.println, parameter[call[emissionFeatureFactor.getVars, parameter[]]]] local_variable[type[DiscreteLogLinearFactor], emissionFactor] call[builder.addFactor, parameter[member[.WORD_LABEL_FACTOR], member[.emissionFactor], call[VariableNamePattern.fromTemplateVariables, parameter[member[.plateVars], member[VariableNumMap.EMPTY]]]]] local_variable[type[VariableNumMap], adjacentVars] call[builder.addFactor, parameter[member[.TRANSITION_FACTOR], call[DiscreteLogLinearFactor.createIndicatorFactor, parameter[member[.adjacentVars]]], call[VariableNamePattern.fromTemplateVariables, parameter[member[.adjacentVars], member[VariableNumMap.EMPTY]]]]] return[call[builder.build, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ParametricFactorGraph] identifier[buildSequenceModel] operator[SEP] identifier[Iterable] operator[<] identifier[String] operator[>] identifier[emissionFeatureLines] , identifier[String] identifier[featureDelimiter] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[words] operator[=] identifier[StringUtils] operator[SEP] identifier[readColumnFromDelimitedLines] operator[SEP] identifier[emissionFeatureLines] , Other[0] , identifier[featureDelimiter] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[labels] operator[=] identifier[StringUtils] operator[SEP] identifier[readColumnFromDelimitedLines] operator[SEP] identifier[emissionFeatureLines] , Other[1] , identifier[featureDelimiter] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[emissionFeatures] operator[=] identifier[StringUtils] operator[SEP] identifier[readColumnFromDelimitedLines] operator[SEP] identifier[emissionFeatureLines] , Other[2] , identifier[featureDelimiter] operator[SEP] operator[SEP] identifier[DiscreteVariable] identifier[wordType] operator[=] Keyword[new] identifier[DiscreteVariable] operator[SEP] literal[String] , identifier[words] operator[SEP] operator[SEP] identifier[DiscreteVariable] identifier[labelType] operator[=] Keyword[new] identifier[DiscreteVariable] operator[SEP] literal[String] , identifier[labels] operator[SEP] operator[SEP] identifier[DiscreteVariable] identifier[emissionFeatureType] operator[=] Keyword[new] identifier[DiscreteVariable] operator[SEP] literal[String] , identifier[emissionFeatures] operator[SEP] operator[SEP] identifier[ParametricFactorGraphBuilder] identifier[builder] operator[=] Keyword[new] identifier[ParametricFactorGraphBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[addPlate] operator[SEP] identifier[PLATE_NAME] , Keyword[new] identifier[VariableNumMap] operator[SEP] identifier[Ints] operator[SEP] identifier[asList] operator[SEP] Other[1] , Other[2] operator[SEP] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[INPUT_NAME] , identifier[OUTPUT_NAME] operator[SEP] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[wordType] , identifier[labelType] operator[SEP] operator[SEP] , Other[10000] operator[SEP] operator[SEP] identifier[String] identifier[inputPattern] operator[=] identifier[PLATE_NAME] operator[+] literal[String] operator[+] identifier[INPUT_NAME] operator[SEP] identifier[String] identifier[outputPattern] operator[=] identifier[PLATE_NAME] operator[+] literal[String] operator[+] identifier[OUTPUT_NAME] operator[SEP] identifier[String] identifier[nextOutputPattern] operator[=] identifier[PLATE_NAME] operator[+] literal[String] operator[+] identifier[OUTPUT_NAME] operator[SEP] identifier[VariableNumMap] identifier[plateVars] operator[=] Keyword[new] identifier[VariableNumMap] operator[SEP] identifier[Ints] operator[SEP] identifier[asList] operator[SEP] Other[1] , Other[2] operator[SEP] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[inputPattern] , identifier[outputPattern] operator[SEP] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[wordType] , identifier[labelType] operator[SEP] operator[SEP] operator[SEP] identifier[VariableNumMap] identifier[x] operator[=] identifier[plateVars] operator[SEP] identifier[getVariablesByName] operator[SEP] identifier[inputPattern] operator[SEP] operator[SEP] identifier[VariableNumMap] identifier[y] operator[=] identifier[plateVars] operator[SEP] identifier[getVariablesByName] operator[SEP] identifier[outputPattern] operator[SEP] operator[SEP] identifier[VariableNumMap] identifier[emissionFeatureVar] operator[=] identifier[VariableNumMap] operator[SEP] identifier[singleton] operator[SEP] Other[0] , literal[String] , identifier[emissionFeatureType] operator[SEP] operator[SEP] identifier[TableFactor] identifier[emissionFeatureFactor] operator[=] identifier[TableFactor] operator[SEP] identifier[fromDelimitedFile] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[x] , identifier[y] , identifier[emissionFeatureVar] operator[SEP] , identifier[emissionFeatureLines] , identifier[featureDelimiter] , literal[boolean] , identifier[SparseTensorBuilder] operator[SEP] identifier[getFactory] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cacheWeightPermutations] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[emissionFeatureFactor] operator[SEP] identifier[getVars] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[DiscreteLogLinearFactor] identifier[emissionFactor] operator[=] Keyword[new] identifier[DiscreteLogLinearFactor] operator[SEP] identifier[x] operator[SEP] identifier[union] operator[SEP] identifier[y] operator[SEP] , identifier[emissionFeatureVar] , identifier[emissionFeatureFactor] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[addFactor] operator[SEP] identifier[WORD_LABEL_FACTOR] , identifier[emissionFactor] , identifier[VariableNamePattern] operator[SEP] identifier[fromTemplateVariables] operator[SEP] identifier[plateVars] , identifier[VariableNumMap] operator[SEP] identifier[EMPTY] operator[SEP] operator[SEP] operator[SEP] identifier[VariableNumMap] identifier[adjacentVars] operator[=] Keyword[new] identifier[VariableNumMap] operator[SEP] identifier[Ints] operator[SEP] identifier[asList] operator[SEP] Other[0] , Other[1] operator[SEP] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[outputPattern] , identifier[nextOutputPattern] operator[SEP] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[labelType] , identifier[labelType] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[addFactor] operator[SEP] identifier[TRANSITION_FACTOR] , identifier[DiscreteLogLinearFactor] operator[SEP] identifier[createIndicatorFactor] operator[SEP] identifier[adjacentVars] operator[SEP] , identifier[VariableNamePattern] operator[SEP] identifier[fromTemplateVariables] operator[SEP] identifier[adjacentVars] , identifier[VariableNumMap] operator[SEP] identifier[EMPTY] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(RequestCertificateRequest requestCertificateRequest, ProtocolMarshaller protocolMarshaller) { if (requestCertificateRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(requestCertificateRequest.getDomainName(), DOMAINNAME_BINDING); protocolMarshaller.marshall(requestCertificateRequest.getValidationMethod(), VALIDATIONMETHOD_BINDING); protocolMarshaller.marshall(requestCertificateRequest.getSubjectAlternativeNames(), SUBJECTALTERNATIVENAMES_BINDING); protocolMarshaller.marshall(requestCertificateRequest.getIdempotencyToken(), IDEMPOTENCYTOKEN_BINDING); protocolMarshaller.marshall(requestCertificateRequest.getDomainValidationOptions(), DOMAINVALIDATIONOPTIONS_BINDING); protocolMarshaller.marshall(requestCertificateRequest.getOptions(), OPTIONS_BINDING); protocolMarshaller.marshall(requestCertificateRequest.getCertificateAuthorityArn(), CERTIFICATEAUTHORITYARN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[requestCertificateRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.requestCertificateRequest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDomainName, postfix_operators=[], prefix_operators=[], qualifier=requestCertificateRequest, selectors=[], type_arguments=None), MemberReference(member=DOMAINNAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValidationMethod, postfix_operators=[], prefix_operators=[], qualifier=requestCertificateRequest, selectors=[], type_arguments=None), MemberReference(member=VALIDATIONMETHOD_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSubjectAlternativeNames, postfix_operators=[], prefix_operators=[], qualifier=requestCertificateRequest, selectors=[], type_arguments=None), MemberReference(member=SUBJECTALTERNATIVENAMES_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIdempotencyToken, postfix_operators=[], prefix_operators=[], qualifier=requestCertificateRequest, selectors=[], type_arguments=None), MemberReference(member=IDEMPOTENCYTOKEN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDomainValidationOptions, postfix_operators=[], prefix_operators=[], qualifier=requestCertificateRequest, selectors=[], type_arguments=None), MemberReference(member=DOMAINVALIDATIONOPTIONS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOptions, postfix_operators=[], prefix_operators=[], qualifier=requestCertificateRequest, selectors=[], type_arguments=None), MemberReference(member=OPTIONS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCertificateAuthorityArn, postfix_operators=[], prefix_operators=[], qualifier=requestCertificateRequest, selectors=[], type_arguments=None), MemberReference(member=CERTIFICATEAUTHORITYARN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[RequestCertificateRequest] identifier[requestCertificateRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[requestCertificateRequest] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[requestCertificateRequest] operator[SEP] identifier[getDomainName] operator[SEP] operator[SEP] , identifier[DOMAINNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[requestCertificateRequest] operator[SEP] identifier[getValidationMethod] operator[SEP] operator[SEP] , identifier[VALIDATIONMETHOD_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[requestCertificateRequest] operator[SEP] identifier[getSubjectAlternativeNames] operator[SEP] operator[SEP] , identifier[SUBJECTALTERNATIVENAMES_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[requestCertificateRequest] operator[SEP] identifier[getIdempotencyToken] operator[SEP] operator[SEP] , identifier[IDEMPOTENCYTOKEN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[requestCertificateRequest] operator[SEP] identifier[getDomainValidationOptions] operator[SEP] operator[SEP] , identifier[DOMAINVALIDATIONOPTIONS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[requestCertificateRequest] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] , identifier[OPTIONS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[requestCertificateRequest] operator[SEP] identifier[getCertificateAuthorityArn] operator[SEP] operator[SEP] , identifier[CERTIFICATEAUTHORITYARN_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public long getFirstExpiry() { final SQLiteDatabase db = getDb(); if (db == null || !db.isOpen()) { return 0; } try { Cursor cursor = db.rawQuery("select min(" + COLUMN_EXPIRES + ") from " + TABLE, null); cursor.moveToFirst(); long time = cursor.getLong(0); cursor.close(); return time; } catch (Exception ex) { Log.e(IMapView.LOGTAG, "Unable to query for oldest tile", ex); catchException(ex); } return 0; }
class class_name[name] begin[{] method[getFirstExpiry, return_type[type[long]], modifier[public], parameter[]] begin[{] local_variable[type[SQLiteDatabase], db] if[binary_operation[binary_operation[member[.db], ==, literal[null]], ||, call[db.isOpen, parameter[]]]] begin[{] return[literal[0]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="select min("), operandr=MemberReference(member=COLUMN_EXPIRES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") from "), operator=+), operandr=MemberReference(member=TABLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=rawQuery, postfix_operators=[], prefix_operators=[], qualifier=db, selectors=[], type_arguments=None), name=cursor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Cursor, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=moveToFirst, postfix_operators=[], prefix_operators=[], qualifier=cursor, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getLong, postfix_operators=[], prefix_operators=[], qualifier=cursor, selectors=[], type_arguments=None), name=time)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=cursor, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LOGTAG, postfix_operators=[], prefix_operators=[], qualifier=IMapView, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to query for oldest tile"), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=e, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=catchException, 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) return[literal[0]] end[}] END[}]
Keyword[public] Keyword[long] identifier[getFirstExpiry] operator[SEP] operator[SEP] { Keyword[final] identifier[SQLiteDatabase] identifier[db] operator[=] identifier[getDb] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[db] operator[==] Other[null] operator[||] operator[!] identifier[db] operator[SEP] identifier[isOpen] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[0] operator[SEP] } Keyword[try] { identifier[Cursor] identifier[cursor] operator[=] identifier[db] operator[SEP] identifier[rawQuery] operator[SEP] literal[String] operator[+] identifier[COLUMN_EXPIRES] operator[+] literal[String] operator[+] identifier[TABLE] , Other[null] operator[SEP] operator[SEP] identifier[cursor] operator[SEP] identifier[moveToFirst] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[time] operator[=] identifier[cursor] operator[SEP] identifier[getLong] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[cursor] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[time] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[IMapView] operator[SEP] identifier[LOGTAG] , literal[String] , identifier[ex] operator[SEP] operator[SEP] identifier[catchException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } Keyword[return] Other[0] operator[SEP] }
private Version parseValidSemVer() { NormalVersion normal = parseVersionCore(); MetadataVersion preRelease = MetadataVersion.NULL; MetadataVersion build = MetadataVersion.NULL; Character next = consumeNextCharacter(CharType.HYPHEN, CharType.PLUS, CharType.EOL); if (CharType.HYPHEN.isMatchedBy(next)) { preRelease = parsePreRelease(); next = consumeNextCharacter(CharType.PLUS, CharType.EOL); if (CharType.PLUS.isMatchedBy(next)) { build = parseBuild(); } } else if (CharType.PLUS.isMatchedBy(next)) { build = parseBuild(); } consumeNextCharacter(CharType.EOL); return new Version(normal, preRelease, build); }
class class_name[name] begin[{] method[parseValidSemVer, return_type[type[Version]], modifier[private], parameter[]] begin[{] local_variable[type[NormalVersion], normal] local_variable[type[MetadataVersion], preRelease] local_variable[type[MetadataVersion], build] local_variable[type[Character], next] if[call[CharType.HYPHEN.isMatchedBy, parameter[member[.next]]]] begin[{] assign[member[.preRelease], call[.parsePreRelease, parameter[]]] assign[member[.next], call[.consumeNextCharacter, parameter[member[CharType.PLUS], member[CharType.EOL]]]] if[call[CharType.PLUS.isMatchedBy, parameter[member[.next]]]] begin[{] assign[member[.build], call[.parseBuild, parameter[]]] else begin[{] None end[}] else begin[{] if[call[CharType.PLUS.isMatchedBy, parameter[member[.next]]]] begin[{] assign[member[.build], call[.parseBuild, parameter[]]] else begin[{] None end[}] end[}] call[.consumeNextCharacter, parameter[member[CharType.EOL]]] return[ClassCreator(arguments=[MemberReference(member=normal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=preRelease, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=build, 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=Version, sub_type=None))] end[}] END[}]
Keyword[private] identifier[Version] identifier[parseValidSemVer] operator[SEP] operator[SEP] { identifier[NormalVersion] identifier[normal] operator[=] identifier[parseVersionCore] operator[SEP] operator[SEP] operator[SEP] identifier[MetadataVersion] identifier[preRelease] operator[=] identifier[MetadataVersion] operator[SEP] identifier[NULL] operator[SEP] identifier[MetadataVersion] identifier[build] operator[=] identifier[MetadataVersion] operator[SEP] identifier[NULL] operator[SEP] identifier[Character] identifier[next] operator[=] identifier[consumeNextCharacter] operator[SEP] identifier[CharType] operator[SEP] identifier[HYPHEN] , identifier[CharType] operator[SEP] identifier[PLUS] , identifier[CharType] operator[SEP] identifier[EOL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CharType] operator[SEP] identifier[HYPHEN] operator[SEP] identifier[isMatchedBy] operator[SEP] identifier[next] operator[SEP] operator[SEP] { identifier[preRelease] operator[=] identifier[parsePreRelease] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[=] identifier[consumeNextCharacter] operator[SEP] identifier[CharType] operator[SEP] identifier[PLUS] , identifier[CharType] operator[SEP] identifier[EOL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CharType] operator[SEP] identifier[PLUS] operator[SEP] identifier[isMatchedBy] operator[SEP] identifier[next] operator[SEP] operator[SEP] { identifier[build] operator[=] identifier[parseBuild] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[CharType] operator[SEP] identifier[PLUS] operator[SEP] identifier[isMatchedBy] operator[SEP] identifier[next] operator[SEP] operator[SEP] { identifier[build] operator[=] identifier[parseBuild] operator[SEP] operator[SEP] operator[SEP] } identifier[consumeNextCharacter] operator[SEP] identifier[CharType] operator[SEP] identifier[EOL] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Version] operator[SEP] identifier[normal] , identifier[preRelease] , identifier[build] operator[SEP] operator[SEP] }
protected DERObject buildObject( int tag, byte[] bytes) throws IOException { if ((tag & APPLICATION) != 0) { return new DERApplicationSpecific(tag, bytes); } switch (tag) { case NULL: return new DERNull(); case SEQUENCE | CONSTRUCTED: ByteArrayInputStream bIn = new ByteArrayInputStream(bytes); ASN1InputStream aIn = new ASN1InputStream(bIn); ASN1EncodableVector v = new ASN1EncodableVector(); DERObject obj = aIn.readObject(); while (obj != null) { v.add(obj); obj = aIn.readObject(); } return new DERSequence(v); case SET | CONSTRUCTED: bIn = new ByteArrayInputStream(bytes); aIn = new ASN1InputStream(bIn); v = new ASN1EncodableVector(); obj = aIn.readObject(); while (obj != null) { v.add(obj); obj = aIn.readObject(); } return new DERSet(v, false); case BOOLEAN: return new DERBoolean(bytes); case INTEGER: return new DERInteger(bytes); case ENUMERATED: return new DEREnumerated(bytes); case OBJECT_IDENTIFIER: return new DERObjectIdentifier(bytes); case BIT_STRING: int padBits = bytes[0]; byte[] data = new byte[bytes.length - 1]; System.arraycopy(bytes, 1, data, 0, bytes.length - 1); return new DERBitString(data, padBits); case NUMERIC_STRING: return new DERNumericString(bytes); case UTF8_STRING: return new DERUTF8String(bytes); case PRINTABLE_STRING: return new DERPrintableString(bytes); case IA5_STRING: return new DERIA5String(bytes); case T61_STRING: return new DERT61String(bytes); case VISIBLE_STRING: return new DERVisibleString(bytes); case GENERAL_STRING: return new DERGeneralString(bytes); case UNIVERSAL_STRING: return new DERUniversalString(bytes); case BMP_STRING: return new DERBMPString(bytes); case OCTET_STRING: return new DEROctetString(bytes); case UTC_TIME: return new DERUTCTime(bytes); case GENERALIZED_TIME: return new DERGeneralizedTime(bytes); default: // // with tagged object tag number is bottom 5 bits // if ((tag & TAGGED) != 0) { int tagNo = tag & 0x1f; if (tagNo == 0x1f) { int idx = 0; tagNo = 0; while ((bytes[idx] & 0x80) != 0) { tagNo |= (bytes[idx++] & 0x7f); tagNo <<= 7; } tagNo |= (bytes[idx] & 0x7f); byte[] tmp = bytes; bytes = new byte[tmp.length - (idx + 1)]; System.arraycopy(tmp, idx + 1, bytes, 0, bytes.length); } if (bytes.length == 0) // empty tag! { if ((tag & CONSTRUCTED) == 0) { return new DERTaggedObject(false, tagNo, new DERNull()); } else { return new DERTaggedObject(false, tagNo, new DERSequence()); } } // // simple type - implicit... return an octet string // if ((tag & CONSTRUCTED) == 0) { return new DERTaggedObject(false, tagNo, new DEROctetString(bytes)); } bIn = new ByteArrayInputStream(bytes); aIn = new ASN1InputStream(bIn); DEREncodable dObj = aIn.readObject(); // // explicitly tagged (probably!) - if it isn't we'd have to // tell from the context // if (aIn.available() == 0) { return new DERTaggedObject(tagNo, dObj); } // // another implicit object, we'll create a sequence... // v = new ASN1EncodableVector(); while (dObj != null) { v.add(dObj); dObj = aIn.readObject(); } return new DERTaggedObject(false, tagNo, new DERSequence(v)); } return new DERUnknownTag(tag, bytes); } }
class class_name[name] begin[{] method[buildObject, return_type[type[DERObject]], modifier[protected], parameter[tag, bytes]] begin[{] if[binary_operation[binary_operation[member[.tag], &, member[.APPLICATION]], !=, literal[0]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bytes, 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=DERApplicationSpecific, sub_type=None))] else begin[{] None end[}] SwitchStatement(cases=[SwitchStatementCase(case=['NULL'], statements=[ReturnStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DERNull, sub_type=None)), label=None)]), SwitchStatementCase(case=[BinaryOperation(operandl=MemberReference(member=SEQUENCE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=CONSTRUCTED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|)], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=bytes, 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=ByteArrayInputStream, sub_type=None)), name=bIn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayInputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=bIn, 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=ASN1InputStream, sub_type=None)), name=aIn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ASN1InputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ASN1EncodableVector, sub_type=None)), name=v)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ASN1EncodableVector, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=aIn, selectors=[], type_arguments=None), name=obj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DERObject, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=aIn, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=v, 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=DERSequence, sub_type=None)), label=None)]), SwitchStatementCase(case=[BinaryOperation(operandl=MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=CONSTRUCTED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=bytes, 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=ByteArrayInputStream, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=bIn, 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=ASN1InputStream, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=v, 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=ASN1EncodableVector, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=aIn, selectors=[], type_arguments=None)), label=None), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=aIn, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DERSet, sub_type=None)), label=None)]), SwitchStatementCase(case=['BOOLEAN'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DERBoolean, sub_type=None)), label=None)]), SwitchStatementCase(case=['INTEGER'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DERInteger, sub_type=None)), label=None)]), SwitchStatementCase(case=['ENUMERATED'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DEREnumerated, sub_type=None)), label=None)]), SwitchStatementCase(case=['OBJECT_IDENTIFIER'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DERObjectIdentifier, sub_type=None)), label=None)]), SwitchStatementCase(case=['BIT_STRING'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), name=padBits)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bytes, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=data)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bytes, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=padBits, 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=DERBitString, sub_type=None)), label=None)]), SwitchStatementCase(case=['NUMERIC_STRING'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DERNumericString, sub_type=None)), label=None)]), SwitchStatementCase(case=['UTF8_STRING'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DERUTF8String, sub_type=None)), label=None)]), SwitchStatementCase(case=['PRINTABLE_STRING'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DERPrintableString, sub_type=None)), label=None)]), SwitchStatementCase(case=['IA5_STRING'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DERIA5String, sub_type=None)), label=None)]), SwitchStatementCase(case=['T61_STRING'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DERT61String, sub_type=None)), label=None)]), SwitchStatementCase(case=['VISIBLE_STRING'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DERVisibleString, sub_type=None)), label=None)]), SwitchStatementCase(case=['GENERAL_STRING'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DERGeneralString, sub_type=None)), label=None)]), SwitchStatementCase(case=['UNIVERSAL_STRING'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DERUniversalString, sub_type=None)), label=None)]), SwitchStatementCase(case=['BMP_STRING'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DERBMPString, sub_type=None)), label=None)]), SwitchStatementCase(case=['OCTET_STRING'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DEROctetString, sub_type=None)), label=None)]), SwitchStatementCase(case=['UTC_TIME'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DERUTCTime, sub_type=None)), label=None)]), SwitchStatementCase(case=['GENERALIZED_TIME'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=bytes, 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=DERGeneralizedTime, sub_type=None)), label=None)]), SwitchStatementCase(case=[], statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TAGGED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x1f), operator=&), name=tagNo)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tagNo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x1f), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=idx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tagNo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tagNo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=BinaryOperation(operandl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=idx, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x7f), operator=&)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tagNo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=<<=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=7)), label=None)]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x80), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tagNo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=BinaryOperation(operandl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x7f), operator=&)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=tmp)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ArrayCreator(dimensions=[BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator=-)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bytes, selectors=[])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bytes, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=CONSTRUCTED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=tagNo, 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=DERSequence, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DERTaggedObject, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=tagNo, 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=DERNull, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DERTaggedObject, sub_type=None)), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=CONSTRUCTED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=tagNo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=bytes, 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=DEROctetString, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DERTaggedObject, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=bytes, 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=ByteArrayInputStream, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=aIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=bIn, 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=ASN1InputStream, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=aIn, selectors=[], type_arguments=None), name=dObj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DEREncodable, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=available, postfix_operators=[], prefix_operators=[], qualifier=aIn, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=tagNo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dObj, 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=DERTaggedObject, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=v, 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=ASN1EncodableVector, sub_type=None))), label=None), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=aIn, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=dObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), ReturnStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=tagNo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=v, 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=DERSequence, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DERTaggedObject, sub_type=None)), label=None)])), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bytes, 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=DERUnknownTag, sub_type=None)), label=None)])], expression=MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[protected] identifier[DERObject] identifier[buildObject] operator[SEP] Keyword[int] identifier[tag] , Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[SEP] identifier[tag] operator[&] identifier[APPLICATION] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[return] Keyword[new] identifier[DERApplicationSpecific] operator[SEP] identifier[tag] , identifier[bytes] operator[SEP] operator[SEP] } Keyword[switch] operator[SEP] identifier[tag] operator[SEP] { Keyword[case] identifier[NULL] operator[:] Keyword[return] Keyword[new] identifier[DERNull] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[SEQUENCE] operator[|] identifier[CONSTRUCTED] operator[:] identifier[ByteArrayInputStream] identifier[bIn] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] identifier[ASN1InputStream] identifier[aIn] operator[=] Keyword[new] identifier[ASN1InputStream] operator[SEP] identifier[bIn] operator[SEP] operator[SEP] identifier[ASN1EncodableVector] identifier[v] operator[=] Keyword[new] identifier[ASN1EncodableVector] operator[SEP] operator[SEP] operator[SEP] identifier[DERObject] identifier[obj] operator[=] identifier[aIn] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[obj] operator[!=] Other[null] operator[SEP] { identifier[v] operator[SEP] identifier[add] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[obj] operator[=] identifier[aIn] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[DERSequence] operator[SEP] identifier[v] operator[SEP] operator[SEP] Keyword[case] identifier[SET] operator[|] identifier[CONSTRUCTED] operator[:] identifier[bIn] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] identifier[aIn] operator[=] Keyword[new] identifier[ASN1InputStream] operator[SEP] identifier[bIn] operator[SEP] operator[SEP] identifier[v] operator[=] Keyword[new] identifier[ASN1EncodableVector] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[=] identifier[aIn] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[obj] operator[!=] Other[null] operator[SEP] { identifier[v] operator[SEP] identifier[add] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[obj] operator[=] identifier[aIn] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[DERSet] operator[SEP] identifier[v] , literal[boolean] operator[SEP] operator[SEP] Keyword[case] identifier[BOOLEAN] operator[:] Keyword[return] Keyword[new] identifier[DERBoolean] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[INTEGER] operator[:] Keyword[return] Keyword[new] identifier[DERInteger] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[ENUMERATED] operator[:] Keyword[return] Keyword[new] identifier[DEREnumerated] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[OBJECT_IDENTIFIER] operator[:] Keyword[return] Keyword[new] identifier[DERObjectIdentifier] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[BIT_STRING] operator[:] Keyword[int] identifier[padBits] operator[=] identifier[bytes] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[bytes] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[bytes] , Other[1] , identifier[data] , Other[0] , identifier[bytes] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[DERBitString] operator[SEP] identifier[data] , identifier[padBits] operator[SEP] operator[SEP] Keyword[case] identifier[NUMERIC_STRING] operator[:] Keyword[return] Keyword[new] identifier[DERNumericString] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[UTF8_STRING] operator[:] Keyword[return] Keyword[new] identifier[DERUTF8String] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[PRINTABLE_STRING] operator[:] Keyword[return] Keyword[new] identifier[DERPrintableString] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[IA5_STRING] operator[:] Keyword[return] Keyword[new] identifier[DERIA5String] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[T61_STRING] operator[:] Keyword[return] Keyword[new] identifier[DERT61String] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[VISIBLE_STRING] operator[:] Keyword[return] Keyword[new] identifier[DERVisibleString] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[GENERAL_STRING] operator[:] Keyword[return] Keyword[new] identifier[DERGeneralString] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[UNIVERSAL_STRING] operator[:] Keyword[return] Keyword[new] identifier[DERUniversalString] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[BMP_STRING] operator[:] Keyword[return] Keyword[new] identifier[DERBMPString] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[OCTET_STRING] operator[:] Keyword[return] Keyword[new] identifier[DEROctetString] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[UTC_TIME] operator[:] Keyword[return] Keyword[new] identifier[DERUTCTime] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[case] identifier[GENERALIZED_TIME] operator[:] Keyword[return] Keyword[new] identifier[DERGeneralizedTime] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[if] operator[SEP] operator[SEP] identifier[tag] operator[&] identifier[TAGGED] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[int] identifier[tagNo] operator[=] identifier[tag] operator[&] literal[Integer] operator[SEP] Keyword[if] operator[SEP] identifier[tagNo] operator[==] literal[Integer] operator[SEP] { Keyword[int] identifier[idx] operator[=] Other[0] operator[SEP] identifier[tagNo] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] identifier[idx] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[tagNo] operator[|=] operator[SEP] identifier[bytes] operator[SEP] identifier[idx] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[tagNo] operator[<<=] Other[7] operator[SEP] } identifier[tagNo] operator[|=] operator[SEP] identifier[bytes] operator[SEP] identifier[idx] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[tmp] operator[=] identifier[bytes] operator[SEP] identifier[bytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[tmp] operator[SEP] identifier[length] operator[-] operator[SEP] identifier[idx] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[tmp] , identifier[idx] operator[+] Other[1] , identifier[bytes] , Other[0] , identifier[bytes] operator[SEP] identifier[length] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[bytes] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[tag] operator[&] identifier[CONSTRUCTED] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] Keyword[new] identifier[DERTaggedObject] operator[SEP] literal[boolean] , identifier[tagNo] , Keyword[new] identifier[DERNull] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[DERTaggedObject] operator[SEP] literal[boolean] , identifier[tagNo] , Keyword[new] identifier[DERSequence] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] operator[SEP] identifier[tag] operator[&] identifier[CONSTRUCTED] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] Keyword[new] identifier[DERTaggedObject] operator[SEP] literal[boolean] , identifier[tagNo] , Keyword[new] identifier[DEROctetString] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] operator[SEP] } identifier[bIn] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] identifier[aIn] operator[=] Keyword[new] identifier[ASN1InputStream] operator[SEP] identifier[bIn] operator[SEP] operator[SEP] identifier[DEREncodable] identifier[dObj] operator[=] identifier[aIn] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aIn] operator[SEP] identifier[available] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] Keyword[new] identifier[DERTaggedObject] operator[SEP] identifier[tagNo] , identifier[dObj] operator[SEP] operator[SEP] } identifier[v] operator[=] Keyword[new] identifier[ASN1EncodableVector] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[dObj] operator[!=] Other[null] operator[SEP] { identifier[v] operator[SEP] identifier[add] operator[SEP] identifier[dObj] operator[SEP] operator[SEP] identifier[dObj] operator[=] identifier[aIn] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[DERTaggedObject] operator[SEP] literal[boolean] , identifier[tagNo] , Keyword[new] identifier[DERSequence] operator[SEP] identifier[v] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[DERUnknownTag] operator[SEP] identifier[tag] , identifier[bytes] operator[SEP] operator[SEP] } }
public static LocalDate fromCalendarFields(Calendar calendar) { if (calendar == null) { throw new IllegalArgumentException("The calendar must not be null"); } int era = calendar.get(Calendar.ERA); int yearOfEra = calendar.get(Calendar.YEAR); return new LocalDate( (era == GregorianCalendar.AD ? yearOfEra : 1 - yearOfEra), calendar.get(Calendar.MONTH) + 1, calendar.get(Calendar.DAY_OF_MONTH) ); }
class class_name[name] begin[{] method[fromCalendarFields, return_type[type[LocalDate]], modifier[public static], parameter[calendar]] begin[{] if[binary_operation[member[.calendar], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The calendar 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[}] local_variable[type[int], era] local_variable[type[int], yearOfEra] return[ClassCreator(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=era, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=AD, postfix_operators=[], prefix_operators=[], qualifier=GregorianCalendar, selectors=[]), operator===), if_false=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MemberReference(member=yearOfEra, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), if_true=MemberReference(member=yearOfEra, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=MONTH, postfix_operators=[], prefix_operators=[], qualifier=Calendar, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=calendar, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MethodInvocation(arguments=[MemberReference(member=DAY_OF_MONTH, postfix_operators=[], prefix_operators=[], qualifier=Calendar, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=calendar, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LocalDate, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[LocalDate] identifier[fromCalendarFields] operator[SEP] identifier[Calendar] identifier[calendar] operator[SEP] { Keyword[if] operator[SEP] identifier[calendar] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[era] operator[=] identifier[calendar] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[ERA] operator[SEP] operator[SEP] Keyword[int] identifier[yearOfEra] operator[=] identifier[calendar] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[YEAR] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[LocalDate] operator[SEP] operator[SEP] identifier[era] operator[==] identifier[GregorianCalendar] operator[SEP] identifier[AD] operator[?] identifier[yearOfEra] operator[:] Other[1] operator[-] identifier[yearOfEra] operator[SEP] , identifier[calendar] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[MONTH] operator[SEP] operator[+] Other[1] , identifier[calendar] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[DAY_OF_MONTH] operator[SEP] operator[SEP] operator[SEP] }
public final void removeElementsAt(int firstindex, int count) { if (tc.isEntryEnabled()) SibTr.entry( tc, "removeElementsAt", new Object[] { new Integer(firstindex), new Integer(count)}); removeRange(firstindex, firstindex + count); if (tc.isEntryEnabled()) SibTr.exit(tc, "removeElementsAt"); }
class class_name[name] begin[{] method[removeElementsAt, return_type[void], modifier[final public], parameter[firstindex, count]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["removeElementsAt"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassCreator(arguments=[MemberReference(member=firstindex, 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)), ClassCreator(arguments=[MemberReference(member=count, 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))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] call[.removeRange, parameter[member[.firstindex], binary_operation[member[.firstindex], +, member[.count]]]] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["removeElementsAt"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[removeElementsAt] operator[SEP] Keyword[int] identifier[firstindex] , Keyword[int] identifier[count] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { Keyword[new] identifier[Integer] operator[SEP] identifier[firstindex] operator[SEP] , Keyword[new] identifier[Integer] operator[SEP] identifier[count] operator[SEP] } operator[SEP] operator[SEP] identifier[removeRange] operator[SEP] identifier[firstindex] , identifier[firstindex] operator[+] identifier[count] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
private int readID3v2Header(InputStream in) throws IOException { byte[] id3header = new byte[4]; int size = -10; in.read(id3header,0,3); // Look for ID3v2 if ( (id3header[0]=='I') && (id3header[1]=='D') && (id3header[2]=='3')) { in.read(id3header,0,3); //int majorVersion = id3header[0]; //int revision = id3header[1]; in.read(id3header,0,4); size = (int) (id3header[0] << 21) + (id3header[1] << 14) + (id3header[2] << 7) + (id3header[3]); } return (size+10); }
class class_name[name] begin[{] method[readID3v2Header, return_type[type[int]], modifier[private], parameter[in]] begin[{] local_variable[type[byte], id3header] local_variable[type[int], size] call[in.read, parameter[member[.id3header], literal[0], literal[3]]] if[binary_operation[binary_operation[binary_operation[member[.id3header], ==, literal['I']], &&, binary_operation[member[.id3header], ==, literal['D']]], &&, binary_operation[member[.id3header], ==, literal['3']]]] begin[{] call[in.read, parameter[member[.id3header], literal[0], literal[3]]] call[in.read, parameter[member[.id3header], literal[0], literal[4]]] assign[member[.size], binary_operation[binary_operation[binary_operation[Cast(expression=BinaryOperation(operandl=MemberReference(member=id3header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=21), operator=<<), type=BasicType(dimensions=[], name=int)), +, binary_operation[member[.id3header], <<, literal[14]]], +, binary_operation[member[.id3header], <<, literal[7]]], +, member[.id3header]]] else begin[{] None end[}] return[binary_operation[member[.size], +, literal[10]]] end[}] END[}]
Keyword[private] Keyword[int] identifier[readID3v2Header] operator[SEP] identifier[InputStream] identifier[in] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[byte] operator[SEP] operator[SEP] identifier[id3header] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[4] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] operator[-] Other[10] operator[SEP] identifier[in] operator[SEP] identifier[read] operator[SEP] identifier[id3header] , Other[0] , Other[3] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[id3header] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[id3header] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[id3header] operator[SEP] Other[2] operator[SEP] operator[==] literal[String] operator[SEP] operator[SEP] { identifier[in] operator[SEP] identifier[read] operator[SEP] identifier[id3header] , Other[0] , Other[3] operator[SEP] operator[SEP] identifier[in] operator[SEP] identifier[read] operator[SEP] identifier[id3header] , Other[0] , Other[4] operator[SEP] operator[SEP] identifier[size] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[id3header] operator[SEP] Other[0] operator[SEP] operator[<<] Other[21] operator[SEP] operator[+] operator[SEP] identifier[id3header] operator[SEP] Other[1] operator[SEP] operator[<<] Other[14] operator[SEP] operator[+] operator[SEP] identifier[id3header] operator[SEP] Other[2] operator[SEP] operator[<<] Other[7] operator[SEP] operator[+] operator[SEP] identifier[id3header] operator[SEP] Other[3] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[size] operator[+] Other[10] operator[SEP] operator[SEP] }
public URIBuilder setQuery(final String query) { this.queryParams = parseQuery(query, Consts.UTF_8); this.encodedQuery = null; this.encodedSchemeSpecificPart = null; return this; }
class class_name[name] begin[{] method[setQuery, return_type[type[URIBuilder]], modifier[public], parameter[query]] begin[{] assign[THIS[member[None.queryParams]], call[.parseQuery, parameter[member[.query], member[Consts.UTF_8]]]] assign[THIS[member[None.encodedQuery]], literal[null]] assign[THIS[member[None.encodedSchemeSpecificPart]], literal[null]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[URIBuilder] identifier[setQuery] operator[SEP] Keyword[final] identifier[String] identifier[query] operator[SEP] { Keyword[this] operator[SEP] identifier[queryParams] operator[=] identifier[parseQuery] operator[SEP] identifier[query] , identifier[Consts] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[encodedQuery] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[encodedSchemeSpecificPart] operator[=] Other[null] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private static String join(long[] a) { assert (a.length > 0); StringBuilder builder = new StringBuilder(); builder.append(a[0]); for (int i = 1; i < a.length; ++i) { builder.append(','); builder.append(a[i]); } return builder.toString(); }
class class_name[name] begin[{] method[join, return_type[type[String]], modifier[private static], parameter[a]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None, value=None) local_variable[type[StringBuilder], builder] call[builder.append, parameter[member[.a]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=',')], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, 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=a, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) return[call[builder.toString, parameter[]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[join] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[a] operator[SEP] { Keyword[assert] operator[SEP] identifier[a] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[a] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[a] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[a] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private Object[] convertToSingleElementArray(Object value) { final Object[] singleElementArray = ArrayUtil.newArray(targetComponentType, 1); singleElementArray[0] = ConverterRegistry.getInstance().convert(targetComponentType, value); return singleElementArray; }
class class_name[name] begin[{] method[convertToSingleElementArray, return_type[type[Object]], modifier[private], parameter[value]] begin[{] local_variable[type[Object], singleElementArray] assign[member[.singleElementArray], call[ConverterRegistry.getInstance, parameter[]]] return[member[.singleElementArray]] end[}] END[}]
Keyword[private] identifier[Object] operator[SEP] operator[SEP] identifier[convertToSingleElementArray] operator[SEP] identifier[Object] identifier[value] operator[SEP] { Keyword[final] identifier[Object] operator[SEP] operator[SEP] identifier[singleElementArray] operator[=] identifier[ArrayUtil] operator[SEP] identifier[newArray] operator[SEP] identifier[targetComponentType] , Other[1] operator[SEP] operator[SEP] identifier[singleElementArray] operator[SEP] Other[0] operator[SEP] operator[=] identifier[ConverterRegistry] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[convert] operator[SEP] identifier[targetComponentType] , identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[singleElementArray] operator[SEP] }
public final Date getCreationDate(String alias) throws KeyStoreException { if (!initialized) { throw new KeyStoreException("Uninitialized keystore"); } return keyStoreSpi.engineGetCreationDate(alias); }
class class_name[name] begin[{] method[getCreationDate, return_type[type[Date]], modifier[final public], parameter[alias]] begin[{] if[member[.initialized]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Uninitialized keystore")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KeyStoreException, sub_type=None)), label=None) else begin[{] None end[}] return[call[keyStoreSpi.engineGetCreationDate, parameter[member[.alias]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[Date] identifier[getCreationDate] operator[SEP] identifier[String] identifier[alias] operator[SEP] Keyword[throws] identifier[KeyStoreException] { Keyword[if] operator[SEP] operator[!] identifier[initialized] operator[SEP] { Keyword[throw] Keyword[new] identifier[KeyStoreException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[keyStoreSpi] operator[SEP] identifier[engineGetCreationDate] operator[SEP] identifier[alias] operator[SEP] operator[SEP] }
public void notationDecl(String name, String pubID, String sysID) throws SAXException { // TODO Auto-generated method stub try { DTDprolog(); m_writer.write("<!NOTATION "); m_writer.write(name); if (pubID != null) { m_writer.write(" PUBLIC \""); m_writer.write(pubID); } else { m_writer.write(" SYSTEM \""); m_writer.write(sysID); } m_writer.write("\" >"); m_writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
class class_name[name] begin[{] method[notationDecl, return_type[void], modifier[public], parameter[name, pubID, sysID]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=DTDprolog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<!NOTATION ")], member=write, postfix_operators=[], prefix_operators=[], qualifier=m_writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=m_writer, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pubID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" SYSTEM \"")], member=write, postfix_operators=[], prefix_operators=[], qualifier=m_writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sysID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=m_writer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" PUBLIC \"")], member=write, postfix_operators=[], prefix_operators=[], qualifier=m_writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pubID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=m_writer, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" >")], member=write, postfix_operators=[], prefix_operators=[], qualifier=m_writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m_lineSep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=m_lineSepLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=m_writer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[notationDecl] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[pubID] , identifier[String] identifier[sysID] operator[SEP] Keyword[throws] identifier[SAXException] { Keyword[try] { identifier[DTDprolog] operator[SEP] operator[SEP] operator[SEP] identifier[m_writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[m_writer] operator[SEP] identifier[write] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pubID] operator[!=] Other[null] operator[SEP] { identifier[m_writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[m_writer] operator[SEP] identifier[write] operator[SEP] identifier[pubID] operator[SEP] operator[SEP] } Keyword[else] { identifier[m_writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[m_writer] operator[SEP] identifier[write] operator[SEP] identifier[sysID] operator[SEP] operator[SEP] } identifier[m_writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[m_writer] operator[SEP] identifier[write] operator[SEP] identifier[m_lineSep] , Other[0] , identifier[m_lineSepLen] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } }
@Override public EClass getIfcLightSourceGoniometric() { if (ifcLightSourceGoniometricEClass == null) { ifcLightSourceGoniometricEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(347); } return ifcLightSourceGoniometricEClass; }
class class_name[name] begin[{] method[getIfcLightSourceGoniometric, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcLightSourceGoniometricEClass], ==, literal[null]]] begin[{] assign[member[.ifcLightSourceGoniometricEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=347)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcLightSourceGoniometricEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcLightSourceGoniometric] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcLightSourceGoniometricEClass] operator[==] Other[null] operator[SEP] { identifier[ifcLightSourceGoniometricEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[347] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcLightSourceGoniometricEClass] operator[SEP] }
public FaunusPipeline dedup() { this.state.assertNotLocked(); this.state.assertNoProperty(); this.compiler.addMap(DuplicateFilterMap.Map.class, NullWritable.class, FaunusVertex.class, DuplicateFilterMap.createConfiguration(this.state.getElementType())); makeMapReduceString(DuplicateFilterMap.class); return this; }
class class_name[name] begin[{] method[dedup, return_type[type[FaunusPipeline]], modifier[public], parameter[]] begin[{] THIS[member[None.state]call[None.assertNotLocked, parameter[]]] THIS[member[None.state]call[None.assertNoProperty, parameter[]]] THIS[member[None.compiler]call[None.addMap, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=DuplicateFilterMap, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Map, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullWritable, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FaunusVertex, sub_type=None)), call[DuplicateFilterMap.createConfiguration, parameter[THIS[member[None.state]call[None.getElementType, parameter[]]]]]]]] call[.makeMapReduceString, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DuplicateFilterMap, sub_type=None))]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[FaunusPipeline] identifier[dedup] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[state] operator[SEP] identifier[assertNotLocked] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[state] operator[SEP] identifier[assertNoProperty] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[compiler] operator[SEP] identifier[addMap] operator[SEP] identifier[DuplicateFilterMap] operator[SEP] identifier[Map] operator[SEP] Keyword[class] , identifier[NullWritable] operator[SEP] Keyword[class] , identifier[FaunusVertex] operator[SEP] Keyword[class] , identifier[DuplicateFilterMap] operator[SEP] identifier[createConfiguration] operator[SEP] Keyword[this] operator[SEP] identifier[state] operator[SEP] identifier[getElementType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[makeMapReduceString] operator[SEP] identifier[DuplicateFilterMap] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static void writeHttp2Headers(ChannelHandlerContext ctx, Http2ConnectionEncoder encoder, HttpResponseFuture outboundRespStatusFuture, int streamId, Http2Headers http2Headers, boolean endStream) throws Http2Exception { ChannelFuture channelFuture = encoder.writeHeaders( ctx, streamId, http2Headers, 0, endStream, ctx.newPromise()); encoder.flowController().writePendingBytes(); ctx.flush(); Util.addResponseWriteFailureListener(outboundRespStatusFuture, channelFuture); }
class class_name[name] begin[{] method[writeHttp2Headers, return_type[void], modifier[public static], parameter[ctx, encoder, outboundRespStatusFuture, streamId, http2Headers, endStream]] begin[{] local_variable[type[ChannelFuture], channelFuture] call[encoder.flowController, parameter[]] call[ctx.flush, parameter[]] call[Util.addResponseWriteFailureListener, parameter[member[.outboundRespStatusFuture], member[.channelFuture]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[writeHttp2Headers] operator[SEP] identifier[ChannelHandlerContext] identifier[ctx] , identifier[Http2ConnectionEncoder] identifier[encoder] , identifier[HttpResponseFuture] identifier[outboundRespStatusFuture] , Keyword[int] identifier[streamId] , identifier[Http2Headers] identifier[http2Headers] , Keyword[boolean] identifier[endStream] operator[SEP] Keyword[throws] identifier[Http2Exception] { identifier[ChannelFuture] identifier[channelFuture] operator[=] identifier[encoder] operator[SEP] identifier[writeHeaders] operator[SEP] identifier[ctx] , identifier[streamId] , identifier[http2Headers] , Other[0] , identifier[endStream] , identifier[ctx] operator[SEP] identifier[newPromise] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[encoder] operator[SEP] identifier[flowController] operator[SEP] operator[SEP] operator[SEP] identifier[writePendingBytes] operator[SEP] operator[SEP] operator[SEP] identifier[ctx] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[Util] operator[SEP] identifier[addResponseWriteFailureListener] operator[SEP] identifier[outboundRespStatusFuture] , identifier[channelFuture] operator[SEP] operator[SEP] }
public VarSet addMember( IVarDef var) { assert var != null; assert var.getName() != null; if( findMember( var.getName()) >= 0) { throw new IllegalStateException( "Member=" + var.getName() + " already defined for varSet=" + getPathName()); } members_.add( var); var.setParent( this); var.setSeqNum( getNextSeqNum()); return this; }
class class_name[name] begin[{] method[addMember, return_type[type[VarSet]], modifier[public], parameter[var]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=var, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=var, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) if[binary_operation[call[.findMember, parameter[call[var.getName, parameter[]]]], >=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Member="), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=var, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" already defined for varSet="), operator=+), operandr=MethodInvocation(arguments=[], member=getPathName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] call[members_.add, parameter[member[.var]]] call[var.setParent, parameter[THIS[]]] call[var.setSeqNum, parameter[call[.getNextSeqNum, parameter[]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[VarSet] identifier[addMember] operator[SEP] identifier[IVarDef] identifier[var] operator[SEP] { Keyword[assert] identifier[var] operator[!=] Other[null] operator[SEP] Keyword[assert] identifier[var] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[findMember] operator[SEP] identifier[var] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[var] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[getPathName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[members_] operator[SEP] identifier[add] operator[SEP] identifier[var] operator[SEP] operator[SEP] identifier[var] operator[SEP] identifier[setParent] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[var] operator[SEP] identifier[setSeqNum] operator[SEP] identifier[getNextSeqNum] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void threadStarted(ThreadPool tp, int activeThreads, int maxThreads) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "threadStarted", new Object[]{tp, new Integer(activeThreads), new Integer(maxThreads)}); if (TraceComponent.isAnyTracingEnabled() && (tc.isDebugEnabled() || tc.isDumpEnabled() || tc.isEntryEnabled() || tc.isEventEnabled())) SibTr.push(_messageProcessor.getMessagingEngine()); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "threadStarted"); }
class class_name[name] begin[{] method[threadStarted, return_type[void], modifier[public], parameter[tp, activeThreads, maxThreads]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["threadStarted"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=tp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=activeThreads, 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)), ClassCreator(arguments=[MemberReference(member=maxThreads, 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))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, binary_operation[binary_operation[binary_operation[call[tc.isDebugEnabled, parameter[]], ||, call[tc.isDumpEnabled, parameter[]]], ||, call[tc.isEntryEnabled, parameter[]]], ||, call[tc.isEventEnabled, parameter[]]]]] begin[{] call[SibTr.push, parameter[call[_messageProcessor.getMessagingEngine, parameter[]]]] else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["threadStarted"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[threadStarted] operator[SEP] identifier[ThreadPool] identifier[tp] , Keyword[int] identifier[activeThreads] , Keyword[int] identifier[maxThreads] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[tp] , Keyword[new] identifier[Integer] operator[SEP] identifier[activeThreads] operator[SEP] , Keyword[new] identifier[Integer] operator[SEP] identifier[maxThreads] operator[SEP] } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[||] identifier[tc] operator[SEP] identifier[isDumpEnabled] operator[SEP] operator[SEP] operator[||] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[||] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[push] operator[SEP] identifier[_messageProcessor] operator[SEP] identifier[getMessagingEngine] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
public EClass getIfcDistributionPort() { if (ifcDistributionPortEClass == null) { ifcDistributionPortEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(165); } return ifcDistributionPortEClass; }
class class_name[name] begin[{] method[getIfcDistributionPort, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcDistributionPortEClass], ==, literal[null]]] begin[{] assign[member[.ifcDistributionPortEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=165)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcDistributionPortEClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getIfcDistributionPort] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcDistributionPortEClass] operator[==] Other[null] operator[SEP] { identifier[ifcDistributionPortEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[165] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcDistributionPortEClass] operator[SEP] }
private void readFromTempFile(int at_offset, byte[] data, int offset, int len) throws IOException { if (_file_pos != at_offset) { _tempfile.seek((long)at_offset); } _tempfile.readFully(data,offset,len); _file_pos = at_offset+len; }
class class_name[name] begin[{] method[readFromTempFile, return_type[void], modifier[private], parameter[at_offset, data, offset, len]] begin[{] if[binary_operation[member[._file_pos], !=, member[.at_offset]]] begin[{] call[_tempfile.seek, parameter[Cast(expression=MemberReference(member=at_offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=long))]] else begin[{] None end[}] call[_tempfile.readFully, parameter[member[.data], member[.offset], member[.len]]] assign[member[._file_pos], binary_operation[member[.at_offset], +, member[.len]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[readFromTempFile] operator[SEP] Keyword[int] identifier[at_offset] , Keyword[byte] operator[SEP] operator[SEP] identifier[data] , Keyword[int] identifier[offset] , Keyword[int] identifier[len] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[_file_pos] operator[!=] identifier[at_offset] operator[SEP] { identifier[_tempfile] operator[SEP] identifier[seek] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[at_offset] operator[SEP] operator[SEP] } identifier[_tempfile] operator[SEP] identifier[readFully] operator[SEP] identifier[data] , identifier[offset] , identifier[len] operator[SEP] operator[SEP] identifier[_file_pos] operator[=] identifier[at_offset] operator[+] identifier[len] operator[SEP] }
public void setPromptView(View prompt) { boolean showing = isShowing(); if (showing) { removePromptView(); } mPromptView = prompt; if (showing) { show(); } }
class class_name[name] begin[{] method[setPromptView, return_type[void], modifier[public], parameter[prompt]] begin[{] local_variable[type[boolean], showing] if[member[.showing]] begin[{] call[.removePromptView, parameter[]] else begin[{] None end[}] assign[member[.mPromptView], member[.prompt]] if[member[.showing]] begin[{] call[.show, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setPromptView] operator[SEP] identifier[View] identifier[prompt] operator[SEP] { Keyword[boolean] identifier[showing] operator[=] identifier[isShowing] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[showing] operator[SEP] { identifier[removePromptView] operator[SEP] operator[SEP] operator[SEP] } identifier[mPromptView] operator[=] identifier[prompt] operator[SEP] Keyword[if] operator[SEP] identifier[showing] operator[SEP] { identifier[show] operator[SEP] operator[SEP] operator[SEP] } }
protected void bind(EbeanQueryWrapper query, Parameter parameter, Object value, int position) { if (parameter.isNamedParameter()) { query.setParameter(parameter.getName().get(), value); } else { query.setParameter(position, value); } }
class class_name[name] begin[{] method[bind, return_type[void], modifier[protected], parameter[query, parameter, value, position]] begin[{] if[call[parameter.isNamedParameter, parameter[]]] begin[{] call[query.setParameter, parameter[call[parameter.getName, parameter[]], member[.value]]] else begin[{] call[query.setParameter, parameter[member[.position], member[.value]]] end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[bind] operator[SEP] identifier[EbeanQueryWrapper] identifier[query] , identifier[Parameter] identifier[parameter] , identifier[Object] identifier[value] , Keyword[int] identifier[position] operator[SEP] { Keyword[if] operator[SEP] identifier[parameter] operator[SEP] identifier[isNamedParameter] operator[SEP] operator[SEP] operator[SEP] { identifier[query] operator[SEP] identifier[setParameter] operator[SEP] identifier[parameter] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] , identifier[value] operator[SEP] operator[SEP] } Keyword[else] { identifier[query] operator[SEP] identifier[setParameter] operator[SEP] identifier[position] , identifier[value] operator[SEP] operator[SEP] } }
private static boolean hasJavaWebstartLibrary() { boolean hasWebStartLibrary = true; try { Class.forName("com.sun.jnlp.JNLPClassLoaderIf"); } catch (final ClassNotFoundException e) { hasWebStartLibrary = false; } return hasWebStartLibrary; }
class class_name[name] begin[{] method[hasJavaWebstartLibrary, return_type[type[boolean]], modifier[private static], parameter[]] begin[{] local_variable[type[boolean], hasWebStartLibrary] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.sun.jnlp.JNLPClassLoaderIf")], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hasWebStartLibrary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None) return[member[.hasWebStartLibrary]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[hasJavaWebstartLibrary] operator[SEP] operator[SEP] { Keyword[boolean] identifier[hasWebStartLibrary] operator[=] literal[boolean] operator[SEP] Keyword[try] { identifier[Class] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[ClassNotFoundException] identifier[e] operator[SEP] { identifier[hasWebStartLibrary] operator[=] literal[boolean] operator[SEP] } Keyword[return] identifier[hasWebStartLibrary] operator[SEP] }
public void start() throws Throwable { Preconditions.checkState(serverAddress == null && serverShutdownFuture.get() == null, serverName + " is already running @ " + serverAddress + ". "); Iterator<Integer> portIterator = bindPortRange.iterator(); while (portIterator.hasNext() && !attemptToBind(portIterator.next())) {} if (serverAddress != null) { log.info("Started {} @ {}.", serverName, serverAddress); } else { log.info("Unable to start {}. All ports in provided range ({}) are occupied.", serverName, bindPortRange); throw new FlinkRuntimeException("Unable to start " + serverName + ". All ports in provided range are occupied."); } }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[]] begin[{] call[Preconditions.checkState, parameter[binary_operation[binary_operation[member[.serverAddress], ==, literal[null]], &&, binary_operation[call[serverShutdownFuture.get, parameter[]], ==, literal[null]]], binary_operation[binary_operation[binary_operation[member[.serverName], +, literal[" is already running @ "]], +, member[.serverAddress]], +, literal[". "]]]] local_variable[type[Iterator], portIterator] while[binary_operation[call[portIterator.hasNext, parameter[]], &&, call[.attemptToBind, parameter[call[portIterator.next, parameter[]]]]]] begin[{] end[}] if[binary_operation[member[.serverAddress], !=, literal[null]]] begin[{] call[log.info, parameter[literal["Started {} @ {}."], member[.serverName], member[.serverAddress]]] else begin[{] call[log.info, parameter[literal["Unable to start {}. All ports in provided range ({}) are occupied."], member[.serverName], member[.bindPortRange]]] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to start "), operandr=MemberReference(member=serverName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". All ports in provided range are occupied."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FlinkRuntimeException, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[start] operator[SEP] operator[SEP] Keyword[throws] identifier[Throwable] { identifier[Preconditions] operator[SEP] identifier[checkState] operator[SEP] identifier[serverAddress] operator[==] Other[null] operator[&&] identifier[serverShutdownFuture] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[==] Other[null] , identifier[serverName] operator[+] literal[String] operator[+] identifier[serverAddress] operator[+] literal[String] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[Integer] operator[>] identifier[portIterator] operator[=] identifier[bindPortRange] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[portIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[attemptToBind] operator[SEP] identifier[portIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { } Keyword[if] operator[SEP] identifier[serverAddress] operator[!=] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[serverName] , identifier[serverAddress] operator[SEP] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[serverName] , identifier[bindPortRange] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[FlinkRuntimeException] operator[SEP] literal[String] operator[+] identifier[serverName] operator[+] literal[String] operator[SEP] operator[SEP] } }
public void finish( boolean addButtons, String where) { if (finished) throw new IllegalStateException("PrefPanel "+name+": already called finish()"); StringBuilder sbuff = new StringBuilder(); // column layout, first sort by col Collections.sort(layoutComponents, new Comparator<LayoutComponent>() { public int compare(LayoutComponent o1, LayoutComponent o2) { return o1.col - o2.col; } public boolean equals(Object o1) { return o1 == this; } }); // now create column layout spec and x cell constraint sbuff.setLength(0); int currCol = -1; Iterator iter = layoutComponents.iterator(); while (iter.hasNext()) { LayoutComponent lc = (LayoutComponent) iter.next(); if (lc.col > currCol) { if (currCol >= 0) sbuff.append(", 5dlu, "); else sbuff.append("3dlu, "); sbuff.append( "right:default, 3dlu, default:grow"); currCol += 2; } lc.ccLabel.gridX = 2*lc.col+2; lc.cc.gridX = 2*lc.col+4; } String colSpec = sbuff.toString(); if (debugLayout) System.out.println(" column layout = "+ colSpec); int ncols = 2*currCol; // row layout, first sort by row Collections.sort(layoutComponents, new Comparator<LayoutComponent>() { public int compare(LayoutComponent o1, LayoutComponent o2) { return o1.row - o2.row; } public boolean equals(Object o1) { return o1 == this; } }); // now adjust for any headings, put into y cell constraint int incr = 0; iter = layoutComponents.iterator(); while (iter.hasNext()) { LayoutComponent lc = (LayoutComponent) iter.next(); if ((lc.comp instanceof String) && (lc.row > 0)) // its a header, not in first position incr++; // leave space by adding a row lc.cc.gridY = lc.row + incr + 1; // adjust downward lc.ccLabel.gridY = lc.cc.gridY; if (debugLayout) System.out.println(lc+" constraint = "+ lc.cc); } // now create row layout spec sbuff.setLength(0); int currRow = -1; iter = layoutComponents.iterator(); while (iter.hasNext()) { LayoutComponent lc = (LayoutComponent) iter.next(); while (lc.row > currRow) { if ((lc.comp instanceof String) && (lc.row > 0)) { sbuff.append( ", 5dlu, default"); } else if ((lc.comp == null)) { sbuff.append(", ").append(lc.col).append("dlu"); } else { if (currRow >= 0) sbuff.append(", "); sbuff.append("default"); } currRow++; } } String rowSpec = sbuff.toString(); if (debugLayout) System.out.println(" row layout = "+ rowSpec); // the jgoodies form layout FormLayout layout = new FormLayout( colSpec, rowSpec); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); // now add each component with correct constraint iter = layoutComponents.iterator(); while (iter.hasNext()) { LayoutComponent lc = (LayoutComponent) iter.next(); if (lc.comp instanceof Field) { Field fld = (Field) lc.comp; builder.addLabel( fld.getLabel()+":", lc.ccLabel); Component comp = fld.getEditComponent(); if (lc.comp instanceof Field.TextArea) comp= new JScrollPane( comp); builder.add( comp, lc.cc); } else if (lc.comp instanceof String) { String header = (String) lc.comp; builder.addSeparator(header, cc.xyw(1, lc.cc.gridY, ncols)); } else if (lc.comp instanceof Component) { builder.add( (Component) lc.comp, lc.cc); } } mainPanel = builder.getPanel(); // button panel JPanel buttPanel = new JPanel(); JButton acceptButton = new JButton("Apply"); buttPanel.add(acceptButton, null); for (JComponent auxButton : auxButtons) buttPanel.add( auxButton, null); // button listeners acceptButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { accept(); } }); setLayout( new BorderLayout()); add(mainPanel, BorderLayout.CENTER); if (addButtons) { if (where.equals( BorderLayout.SOUTH)) { JPanel south = new JPanel(); south.setLayout(new BoxLayout( south, BoxLayout.Y_AXIS)); south.add( new JSeparator(SwingConstants.HORIZONTAL)); south.add( buttPanel); add( south, BorderLayout.SOUTH); } else add(buttPanel, where); } finished = true; }
class class_name[name] begin[{] method[finish, return_type[void], modifier[public], parameter[addButtons, where]] begin[{] if[member[.finished]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PrefPanel "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": already called finish()"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[StringBuilder], sbuff] call[Collections.sort, parameter[member[.layoutComponents], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=o1, selectors=[]), operandr=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=o2, selectors=[]), operator=-), label=None)], documentation=None, modifiers={'public'}, name=compare, parameters=[FormalParameter(annotations=[], modifiers=set(), name=o1, type=ReferenceType(arguments=None, dimensions=[], name=LayoutComponent, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=o2, type=ReferenceType(arguments=None, dimensions=[], name=LayoutComponent, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=int), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), operator===), label=None)], documentation=None, modifiers={'public'}, name=equals, parameters=[FormalParameter(annotations=[], modifiers=set(), name=o1, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), 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=LayoutComponent, sub_type=None))], dimensions=None, name=Comparator, sub_type=None))]] call[sbuff.setLength, parameter[literal[0]]] local_variable[type[int], currCol] local_variable[type[Iterator], iter] while[call[iter.hasNext, parameter[]]] begin[{] local_variable[type[LayoutComponent], lc] if[binary_operation[member[lc.col], >, member[.currCol]]] begin[{] if[binary_operation[member[.currCol], >=, literal[0]]] begin[{] call[sbuff.append, parameter[literal[", 5dlu, "]]] else begin[{] call[sbuff.append, parameter[literal["3dlu, "]]] end[}] call[sbuff.append, parameter[literal["right:default, 3dlu, default:grow"]]] assign[member[.currCol], literal[2]] else begin[{] None end[}] assign[member[lc.ccLabel.gridX], binary_operation[binary_operation[literal[2], *, member[lc.col]], +, literal[2]]] assign[member[lc.cc.gridX], binary_operation[binary_operation[literal[2], *, member[lc.col]], +, literal[4]]] end[}] local_variable[type[String], colSpec] if[member[.debugLayout]] begin[{] call[System.out.println, parameter[binary_operation[literal[" column layout = "], +, member[.colSpec]]]] else begin[{] None end[}] local_variable[type[int], ncols] call[Collections.sort, parameter[member[.layoutComponents], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=o1, selectors=[]), operandr=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=o2, selectors=[]), operator=-), label=None)], documentation=None, modifiers={'public'}, name=compare, parameters=[FormalParameter(annotations=[], modifiers=set(), name=o1, type=ReferenceType(arguments=None, dimensions=[], name=LayoutComponent, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=o2, type=ReferenceType(arguments=None, dimensions=[], name=LayoutComponent, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=int), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), operator===), label=None)], documentation=None, modifiers={'public'}, name=equals, parameters=[FormalParameter(annotations=[], modifiers=set(), name=o1, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), 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=LayoutComponent, sub_type=None))], dimensions=None, name=Comparator, sub_type=None))]] local_variable[type[int], incr] assign[member[.iter], call[layoutComponents.iterator, parameter[]]] while[call[iter.hasNext, parameter[]]] begin[{] local_variable[type[LayoutComponent], lc] if[binary_operation[binary_operation[member[lc.comp], instanceof, type[String]], &&, binary_operation[member[lc.row], >, literal[0]]]] begin[{] member[.incr] else begin[{] None end[}] assign[member[lc.cc.gridY], binary_operation[binary_operation[member[lc.row], +, member[.incr]], +, literal[1]]] assign[member[lc.ccLabel.gridY], member[lc.cc.gridY]] if[member[.debugLayout]] begin[{] call[System.out.println, parameter[binary_operation[binary_operation[member[.lc], +, literal[" constraint = "]], +, member[lc.cc]]]] else begin[{] None end[}] end[}] call[sbuff.setLength, parameter[literal[0]]] local_variable[type[int], currRow] assign[member[.iter], call[layoutComponents.iterator, parameter[]]] while[call[iter.hasNext, parameter[]]] begin[{] local_variable[type[LayoutComponent], lc] while[binary_operation[member[lc.row], >, member[.currRow]]] begin[{] if[binary_operation[binary_operation[member[lc.comp], instanceof, type[String]], &&, binary_operation[member[lc.row], >, literal[0]]]] begin[{] call[sbuff.append, parameter[literal[", 5dlu, default"]]] else begin[{] if[binary_operation[member[lc.comp], ==, literal[null]]] begin[{] call[sbuff.append, parameter[literal[", "]]] else begin[{] if[binary_operation[member[.currRow], >=, literal[0]]] begin[{] call[sbuff.append, parameter[literal[", "]]] else begin[{] None end[}] call[sbuff.append, parameter[literal["default"]]] end[}] end[}] member[.currRow] end[}] end[}] local_variable[type[String], rowSpec] if[member[.debugLayout]] begin[{] call[System.out.println, parameter[binary_operation[literal[" row layout = "], +, member[.rowSpec]]]] else begin[{] None end[}] local_variable[type[FormLayout], layout] local_variable[type[PanelBuilder], builder] call[builder.setDefaultDialogBorder, parameter[]] local_variable[type[CellConstraints], cc] assign[member[.iter], call[layoutComponents.iterator, parameter[]]] while[call[iter.hasNext, parameter[]]] begin[{] local_variable[type[LayoutComponent], lc] if[binary_operation[member[lc.comp], instanceof, type[Field]]] begin[{] local_variable[type[Field], fld] call[builder.addLabel, parameter[binary_operation[call[fld.getLabel, parameter[]], +, literal[":"]], member[lc.ccLabel]]] local_variable[type[Component], comp] if[binary_operation[member[lc.comp], instanceof, type[Field]]] begin[{] assign[member[.comp], ClassCreator(arguments=[MemberReference(member=comp, 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=JScrollPane, sub_type=None))] else begin[{] None end[}] call[builder.add, parameter[member[.comp], member[lc.cc]]] else begin[{] if[binary_operation[member[lc.comp], instanceof, type[String]]] begin[{] local_variable[type[String], header] call[builder.addSeparator, parameter[member[.header], call[cc.xyw, parameter[literal[1], member[lc.cc.gridY], member[.ncols]]]]] else begin[{] if[binary_operation[member[lc.comp], instanceof, type[Component]]] begin[{] call[builder.add, parameter[Cast(expression=MemberReference(member=comp, postfix_operators=[], prefix_operators=[], qualifier=lc, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Component, sub_type=None)), member[lc.cc]]] else begin[{] None end[}] end[}] end[}] end[}] assign[member[.mainPanel], call[builder.getPanel, parameter[]]] local_variable[type[JPanel], buttPanel] local_variable[type[JButton], acceptButton] call[buttPanel.add, parameter[member[.acceptButton], literal[null]]] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=auxButton, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=add, postfix_operators=[], prefix_operators=[], qualifier=buttPanel, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=auxButtons, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=auxButton)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JComponent, sub_type=None))), label=None) call[acceptButton.addActionListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=accept, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=actionPerformed, parameters=[FormalParameter(annotations=[], modifiers=set(), name=evt, type=ReferenceType(arguments=None, dimensions=[], name=ActionEvent, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ActionListener, sub_type=None))]] call[.setLayout, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BorderLayout, sub_type=None))]] call[.add, parameter[member[.mainPanel], member[BorderLayout.CENTER]]] if[member[.addButtons]] begin[{] if[call[where.equals, parameter[member[BorderLayout.SOUTH]]]] begin[{] local_variable[type[JPanel], south] call[south.setLayout, parameter[ClassCreator(arguments=[MemberReference(member=south, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=Y_AXIS, postfix_operators=[], prefix_operators=[], qualifier=BoxLayout, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BoxLayout, sub_type=None))]] call[south.add, parameter[ClassCreator(arguments=[MemberReference(member=HORIZONTAL, postfix_operators=[], prefix_operators=[], qualifier=SwingConstants, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSeparator, sub_type=None))]] call[south.add, parameter[member[.buttPanel]]] call[.add, parameter[member[.south], member[BorderLayout.SOUTH]]] else begin[{] call[.add, parameter[member[.buttPanel], member[.where]]] end[}] else begin[{] None end[}] assign[member[.finished], literal[true]] end[}] END[}]
Keyword[public] Keyword[void] identifier[finish] operator[SEP] Keyword[boolean] identifier[addButtons] , identifier[String] identifier[where] operator[SEP] { Keyword[if] operator[SEP] identifier[finished] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sbuff] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[layoutComponents] , Keyword[new] identifier[Comparator] operator[<] identifier[LayoutComponent] operator[>] operator[SEP] operator[SEP] { Keyword[public] Keyword[int] identifier[compare] operator[SEP] identifier[LayoutComponent] identifier[o1] , identifier[LayoutComponent] identifier[o2] operator[SEP] { Keyword[return] identifier[o1] operator[SEP] identifier[col] operator[-] identifier[o2] operator[SEP] identifier[col] operator[SEP] } Keyword[public] Keyword[boolean] identifier[equals] operator[SEP] identifier[Object] identifier[o1] operator[SEP] { Keyword[return] identifier[o1] operator[==] Keyword[this] operator[SEP] } } operator[SEP] operator[SEP] identifier[sbuff] operator[SEP] identifier[setLength] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[currCol] operator[=] operator[-] Other[1] operator[SEP] identifier[Iterator] identifier[iter] operator[=] identifier[layoutComponents] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[LayoutComponent] identifier[lc] operator[=] operator[SEP] identifier[LayoutComponent] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lc] operator[SEP] identifier[col] operator[>] identifier[currCol] operator[SEP] { Keyword[if] operator[SEP] identifier[currCol] operator[>=] Other[0] operator[SEP] identifier[sbuff] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[else] identifier[sbuff] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sbuff] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[currCol] operator[+=] Other[2] operator[SEP] } identifier[lc] operator[SEP] identifier[ccLabel] operator[SEP] identifier[gridX] operator[=] Other[2] operator[*] identifier[lc] operator[SEP] identifier[col] operator[+] Other[2] operator[SEP] identifier[lc] operator[SEP] identifier[cc] operator[SEP] identifier[gridX] operator[=] Other[2] operator[*] identifier[lc] operator[SEP] identifier[col] operator[+] Other[4] operator[SEP] } identifier[String] identifier[colSpec] operator[=] identifier[sbuff] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[debugLayout] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[colSpec] operator[SEP] operator[SEP] Keyword[int] identifier[ncols] operator[=] Other[2] operator[*] identifier[currCol] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[layoutComponents] , Keyword[new] identifier[Comparator] operator[<] identifier[LayoutComponent] operator[>] operator[SEP] operator[SEP] { Keyword[public] Keyword[int] identifier[compare] operator[SEP] identifier[LayoutComponent] identifier[o1] , identifier[LayoutComponent] identifier[o2] operator[SEP] { Keyword[return] identifier[o1] operator[SEP] identifier[row] operator[-] identifier[o2] operator[SEP] identifier[row] operator[SEP] } Keyword[public] Keyword[boolean] identifier[equals] operator[SEP] identifier[Object] identifier[o1] operator[SEP] { Keyword[return] identifier[o1] operator[==] Keyword[this] operator[SEP] } } operator[SEP] operator[SEP] Keyword[int] identifier[incr] operator[=] Other[0] operator[SEP] identifier[iter] operator[=] identifier[layoutComponents] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[LayoutComponent] identifier[lc] operator[=] operator[SEP] identifier[LayoutComponent] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[lc] operator[SEP] identifier[comp] Keyword[instanceof] identifier[String] operator[SEP] operator[&&] operator[SEP] identifier[lc] operator[SEP] identifier[row] operator[>] Other[0] operator[SEP] operator[SEP] identifier[incr] operator[++] operator[SEP] identifier[lc] operator[SEP] identifier[cc] operator[SEP] identifier[gridY] operator[=] identifier[lc] operator[SEP] identifier[row] operator[+] identifier[incr] operator[+] Other[1] operator[SEP] identifier[lc] operator[SEP] identifier[ccLabel] operator[SEP] identifier[gridY] operator[=] identifier[lc] operator[SEP] identifier[cc] operator[SEP] identifier[gridY] operator[SEP] Keyword[if] operator[SEP] identifier[debugLayout] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[lc] operator[+] literal[String] operator[+] identifier[lc] operator[SEP] identifier[cc] operator[SEP] operator[SEP] } identifier[sbuff] operator[SEP] identifier[setLength] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[currRow] operator[=] operator[-] Other[1] operator[SEP] identifier[iter] operator[=] identifier[layoutComponents] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[LayoutComponent] identifier[lc] operator[=] operator[SEP] identifier[LayoutComponent] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[lc] operator[SEP] identifier[row] operator[>] identifier[currRow] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[lc] operator[SEP] identifier[comp] Keyword[instanceof] identifier[String] operator[SEP] operator[&&] operator[SEP] identifier[lc] operator[SEP] identifier[row] operator[>] Other[0] operator[SEP] operator[SEP] { identifier[sbuff] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[lc] operator[SEP] identifier[comp] operator[==] Other[null] operator[SEP] operator[SEP] { identifier[sbuff] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[lc] operator[SEP] identifier[col] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[currRow] operator[>=] Other[0] operator[SEP] identifier[sbuff] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sbuff] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[currRow] operator[++] operator[SEP] } } identifier[String] identifier[rowSpec] operator[=] identifier[sbuff] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[debugLayout] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[rowSpec] operator[SEP] operator[SEP] identifier[FormLayout] identifier[layout] operator[=] Keyword[new] identifier[FormLayout] operator[SEP] identifier[colSpec] , identifier[rowSpec] operator[SEP] operator[SEP] identifier[PanelBuilder] identifier[builder] operator[=] Keyword[new] identifier[PanelBuilder] operator[SEP] identifier[layout] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[setDefaultDialogBorder] operator[SEP] operator[SEP] operator[SEP] identifier[CellConstraints] identifier[cc] operator[=] Keyword[new] identifier[CellConstraints] operator[SEP] operator[SEP] operator[SEP] identifier[iter] operator[=] identifier[layoutComponents] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[LayoutComponent] identifier[lc] operator[=] operator[SEP] identifier[LayoutComponent] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lc] operator[SEP] identifier[comp] Keyword[instanceof] identifier[Field] operator[SEP] { identifier[Field] identifier[fld] operator[=] operator[SEP] identifier[Field] operator[SEP] identifier[lc] operator[SEP] identifier[comp] operator[SEP] identifier[builder] operator[SEP] identifier[addLabel] operator[SEP] identifier[fld] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[lc] operator[SEP] identifier[ccLabel] operator[SEP] operator[SEP] identifier[Component] identifier[comp] operator[=] identifier[fld] operator[SEP] identifier[getEditComponent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lc] operator[SEP] identifier[comp] Keyword[instanceof] identifier[Field] operator[SEP] identifier[TextArea] operator[SEP] identifier[comp] operator[=] Keyword[new] identifier[JScrollPane] operator[SEP] identifier[comp] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[add] operator[SEP] identifier[comp] , identifier[lc] operator[SEP] identifier[cc] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[lc] operator[SEP] identifier[comp] Keyword[instanceof] identifier[String] operator[SEP] { identifier[String] identifier[header] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[lc] operator[SEP] identifier[comp] operator[SEP] identifier[builder] operator[SEP] identifier[addSeparator] operator[SEP] identifier[header] , identifier[cc] operator[SEP] identifier[xyw] operator[SEP] Other[1] , identifier[lc] operator[SEP] identifier[cc] operator[SEP] identifier[gridY] , identifier[ncols] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[lc] operator[SEP] identifier[comp] Keyword[instanceof] identifier[Component] operator[SEP] { identifier[builder] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[Component] operator[SEP] identifier[lc] operator[SEP] identifier[comp] , identifier[lc] operator[SEP] identifier[cc] operator[SEP] operator[SEP] } } identifier[mainPanel] operator[=] identifier[builder] operator[SEP] identifier[getPanel] operator[SEP] operator[SEP] operator[SEP] identifier[JPanel] identifier[buttPanel] operator[=] Keyword[new] identifier[JPanel] operator[SEP] operator[SEP] operator[SEP] identifier[JButton] identifier[acceptButton] operator[=] Keyword[new] identifier[JButton] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buttPanel] operator[SEP] identifier[add] operator[SEP] identifier[acceptButton] , Other[null] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[JComponent] identifier[auxButton] operator[:] identifier[auxButtons] operator[SEP] identifier[buttPanel] operator[SEP] identifier[add] operator[SEP] identifier[auxButton] , Other[null] operator[SEP] operator[SEP] identifier[acceptButton] operator[SEP] identifier[addActionListener] operator[SEP] Keyword[new] identifier[ActionListener] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[actionPerformed] operator[SEP] identifier[ActionEvent] identifier[evt] operator[SEP] { identifier[accept] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[setLayout] operator[SEP] Keyword[new] identifier[BorderLayout] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[mainPanel] , identifier[BorderLayout] operator[SEP] identifier[CENTER] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[addButtons] operator[SEP] { Keyword[if] operator[SEP] identifier[where] operator[SEP] identifier[equals] operator[SEP] identifier[BorderLayout] operator[SEP] identifier[SOUTH] operator[SEP] operator[SEP] { identifier[JPanel] identifier[south] operator[=] Keyword[new] identifier[JPanel] operator[SEP] operator[SEP] operator[SEP] identifier[south] operator[SEP] identifier[setLayout] operator[SEP] Keyword[new] identifier[BoxLayout] operator[SEP] identifier[south] , identifier[BoxLayout] operator[SEP] identifier[Y_AXIS] operator[SEP] operator[SEP] operator[SEP] identifier[south] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[JSeparator] operator[SEP] identifier[SwingConstants] operator[SEP] identifier[HORIZONTAL] operator[SEP] operator[SEP] operator[SEP] identifier[south] operator[SEP] identifier[add] operator[SEP] identifier[buttPanel] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[south] , identifier[BorderLayout] operator[SEP] identifier[SOUTH] operator[SEP] operator[SEP] } Keyword[else] identifier[add] operator[SEP] identifier[buttPanel] , identifier[where] operator[SEP] operator[SEP] } identifier[finished] operator[=] literal[boolean] operator[SEP] }
private static int computeDecimalSize(AttributeValue value) throws DBaseFileException, AttributeException { final DBaseFieldType dbftype = DBaseFieldType.fromAttributeType(value.getType()); return dbftype.getDecimalPointPosition(value.getString()); }
class class_name[name] begin[{] method[computeDecimalSize, return_type[type[int]], modifier[private static], parameter[value]] begin[{] local_variable[type[DBaseFieldType], dbftype] return[call[dbftype.getDecimalPointPosition, parameter[call[value.getString, parameter[]]]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[int] identifier[computeDecimalSize] operator[SEP] identifier[AttributeValue] identifier[value] operator[SEP] Keyword[throws] identifier[DBaseFileException] , identifier[AttributeException] { Keyword[final] identifier[DBaseFieldType] identifier[dbftype] operator[=] identifier[DBaseFieldType] operator[SEP] identifier[fromAttributeType] operator[SEP] identifier[value] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[dbftype] operator[SEP] identifier[getDecimalPointPosition] operator[SEP] identifier[value] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
void addConnection(String userId, ConnectionFactoryLocator connectionFactoryLocator, UsersConnectionRepository connectionRepository) { connectionRepository.createConnectionRepository(userId).addConnection(getConnection(connectionFactoryLocator)); }
class class_name[name] begin[{] method[addConnection, return_type[void], modifier[default], parameter[userId, connectionFactoryLocator, connectionRepository]] begin[{] call[connectionRepository.createConnectionRepository, parameter[member[.userId]]] end[}] END[}]
Keyword[void] identifier[addConnection] operator[SEP] identifier[String] identifier[userId] , identifier[ConnectionFactoryLocator] identifier[connectionFactoryLocator] , identifier[UsersConnectionRepository] identifier[connectionRepository] operator[SEP] { identifier[connectionRepository] operator[SEP] identifier[createConnectionRepository] operator[SEP] identifier[userId] operator[SEP] operator[SEP] identifier[addConnection] operator[SEP] identifier[getConnection] operator[SEP] identifier[connectionFactoryLocator] operator[SEP] operator[SEP] operator[SEP] }
ServerContext reset() { // Delete the existing log. if (log != null) { log.close(); storage.deleteLog(name); } // Delete the existing snapshot store. if (snapshot != null) { snapshot.close(); storage.deleteSnapshotStore(name); } // Open the log. log = storage.openLog(name); // Open the snapshot store. snapshot = storage.openSnapshotStore(name); // Create a new user state machine. StateMachine stateMachine = stateMachineFactory.get(); // Configure the log compaction mode. If the state machine supports snapshotting, the default // compaction mode is SNAPSHOT, otherwise the default is SEQUENTIAL. if (stateMachine instanceof Snapshottable) { log.compactor().withDefaultCompactionMode(Compaction.Mode.SNAPSHOT); } else { log.compactor().withDefaultCompactionMode(Compaction.Mode.SEQUENTIAL); } // Create a new internal server state machine. this.stateMachine = new ServerStateMachine(stateMachine, this, stateContext); return this; }
class class_name[name] begin[{] method[reset, return_type[type[ServerContext]], modifier[default], parameter[]] begin[{] if[binary_operation[member[.log], !=, literal[null]]] begin[{] call[log.close, parameter[]] call[storage.deleteLog, parameter[member[.name]]] else begin[{] None end[}] if[binary_operation[member[.snapshot], !=, literal[null]]] begin[{] call[snapshot.close, parameter[]] call[storage.deleteSnapshotStore, parameter[member[.name]]] else begin[{] None end[}] assign[member[.log], call[storage.openLog, parameter[member[.name]]]] assign[member[.snapshot], call[storage.openSnapshotStore, parameter[member[.name]]]] local_variable[type[StateMachine], stateMachine] if[binary_operation[member[.stateMachine], instanceof, type[Snapshottable]]] begin[{] call[log.compactor, parameter[]] else begin[{] call[log.compactor, parameter[]] end[}] assign[THIS[member[None.stateMachine]], ClassCreator(arguments=[MemberReference(member=stateMachine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=stateContext, 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=ServerStateMachine, sub_type=None))] return[THIS[]] end[}] END[}]
identifier[ServerContext] identifier[reset] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[log] operator[!=] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[storage] operator[SEP] identifier[deleteLog] operator[SEP] identifier[name] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[snapshot] operator[!=] Other[null] operator[SEP] { identifier[snapshot] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[storage] operator[SEP] identifier[deleteSnapshotStore] operator[SEP] identifier[name] operator[SEP] operator[SEP] } identifier[log] operator[=] identifier[storage] operator[SEP] identifier[openLog] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[snapshot] operator[=] identifier[storage] operator[SEP] identifier[openSnapshotStore] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[StateMachine] identifier[stateMachine] operator[=] identifier[stateMachineFactory] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stateMachine] Keyword[instanceof] identifier[Snapshottable] operator[SEP] { identifier[log] operator[SEP] identifier[compactor] operator[SEP] operator[SEP] operator[SEP] identifier[withDefaultCompactionMode] operator[SEP] identifier[Compaction] operator[SEP] identifier[Mode] operator[SEP] identifier[SNAPSHOT] operator[SEP] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[compactor] operator[SEP] operator[SEP] operator[SEP] identifier[withDefaultCompactionMode] operator[SEP] identifier[Compaction] operator[SEP] identifier[Mode] operator[SEP] identifier[SEQUENTIAL] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[stateMachine] operator[=] Keyword[new] identifier[ServerStateMachine] operator[SEP] identifier[stateMachine] , Keyword[this] , identifier[stateContext] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
void generate(T input) throws SourceFileGenerationException { ClassName generatedTypeName = nameGeneratedType(input); try { Optional<TypeSpec.Builder> type = write(generatedTypeName, input); if (!type.isPresent()) { return; } buildJavaFile(generatedTypeName, type.get()).writeTo(filer); } catch (Exception e) { // if the code above threw a SFGE, use that Throwables.propagateIfPossible(e, SourceFileGenerationException.class); // otherwise, throw a new one throw new SourceFileGenerationException( Optional.<ClassName>absent(), e, getElementForErrorReporting(input)); } }
class class_name[name] begin[{] method[generate, return_type[void], modifier[default], parameter[input]] begin[{] local_variable[type[ClassName], generatedTypeName] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=generatedTypeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TypeSpec, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None)))], dimensions=[], name=Optional, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isPresent, postfix_operators=[], prefix_operators=['!'], qualifier=type, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=generatedTypeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None)], member=buildJavaFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=filer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeTo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SourceFileGenerationException, sub_type=None))], member=propagateIfPossible, postfix_operators=[], prefix_operators=[], qualifier=Throwables, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=Optional, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ClassName, sub_type=None))]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getElementForErrorReporting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SourceFileGenerationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[void] identifier[generate] operator[SEP] identifier[T] identifier[input] operator[SEP] Keyword[throws] identifier[SourceFileGenerationException] { identifier[ClassName] identifier[generatedTypeName] operator[=] identifier[nameGeneratedType] operator[SEP] identifier[input] operator[SEP] operator[SEP] Keyword[try] { identifier[Optional] operator[<] identifier[TypeSpec] operator[SEP] identifier[Builder] operator[>] identifier[type] operator[=] identifier[write] operator[SEP] identifier[generatedTypeName] , identifier[input] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[type] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[buildJavaFile] operator[SEP] identifier[generatedTypeName] , identifier[type] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[writeTo] operator[SEP] identifier[filer] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[Throwables] operator[SEP] identifier[propagateIfPossible] operator[SEP] identifier[e] , identifier[SourceFileGenerationException] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SourceFileGenerationException] operator[SEP] identifier[Optional] operator[SEP] operator[<] identifier[ClassName] operator[>] identifier[absent] operator[SEP] operator[SEP] , identifier[e] , identifier[getElementForErrorReporting] operator[SEP] identifier[input] operator[SEP] operator[SEP] operator[SEP] } }
private long[][] computeDimensionMap(List<DoubleIntInt> z_ijs, final int dim, final int numc) { // mapping cluster index -> dimensions long[][] dimensionMap = new long[numc][((dim - 1) >> 6) + 1]; int max = Math.max(k * l, 2); for(int m = 0; m < max; m++) { DoubleIntInt z_ij = z_ijs.get(m); long[] dims_i = dimensionMap[z_ij.dimi]; BitsUtil.setI(dims_i, z_ij.dimj); if(LOG.isDebugging()) { LOG.debugFiner(new StringBuilder().append("z_ij ").append(z_ij).append('\n') // .append("D_i ").append(BitsUtil.toString(dims_i)).toString()); } } return dimensionMap; }
class class_name[name] begin[{] method[computeDimensionMap, return_type[type[long]], modifier[private], parameter[z_ijs, dim, numc]] begin[{] local_variable[type[long], dimensionMap] local_variable[type[int], max] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=z_ijs, selectors=[], type_arguments=None), name=z_ij)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DoubleIntInt, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=dimensionMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dimi, postfix_operators=[], prefix_operators=[], qualifier=z_ij, selectors=[]))]), name=dims_i)], modifiers=set(), type=BasicType(dimensions=[None], name=long)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dims_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dimj, postfix_operators=[], prefix_operators=[], qualifier=z_ij, selectors=[])], member=setI, postfix_operators=[], prefix_operators=[], qualifier=BitsUtil, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugging, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="z_ij ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=z_ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n')], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="D_i ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=dims_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=BitsUtil, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))], member=debugFiner, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=max, 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=m)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=m, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.dimensionMap]] end[}] END[}]
Keyword[private] Keyword[long] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[computeDimensionMap] operator[SEP] identifier[List] operator[<] identifier[DoubleIntInt] operator[>] identifier[z_ijs] , Keyword[final] Keyword[int] identifier[dim] , Keyword[final] Keyword[int] identifier[numc] operator[SEP] { Keyword[long] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dimensionMap] operator[=] Keyword[new] Keyword[long] operator[SEP] identifier[numc] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dim] operator[-] Other[1] operator[SEP] operator[>] operator[>] Other[6] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[max] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[k] operator[*] identifier[l] , Other[2] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[m] operator[=] Other[0] operator[SEP] identifier[m] operator[<] identifier[max] operator[SEP] identifier[m] operator[++] operator[SEP] { identifier[DoubleIntInt] identifier[z_ij] operator[=] identifier[z_ijs] operator[SEP] identifier[get] operator[SEP] identifier[m] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[dims_i] operator[=] identifier[dimensionMap] operator[SEP] identifier[z_ij] operator[SEP] identifier[dimi] operator[SEP] operator[SEP] identifier[BitsUtil] operator[SEP] identifier[setI] operator[SEP] identifier[dims_i] , identifier[z_ij] operator[SEP] identifier[dimj] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugging] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debugFiner] operator[SEP] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[z_ij] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[BitsUtil] operator[SEP] identifier[toString] operator[SEP] identifier[dims_i] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[dimensionMap] operator[SEP] }
private void outputDocTypeDecl(String name) throws SAXException { if (true == m_needToOutputDocTypeDecl) { String doctypeSystem = getDoctypeSystem(); String doctypePublic = getDoctypePublic(); if ((null != doctypeSystem) || (null != doctypePublic)) { final java.io.Writer writer = m_writer; try { writer.write("<!DOCTYPE "); writer.write(name); if (null != doctypePublic) { writer.write(" PUBLIC \""); writer.write(doctypePublic); writer.write('"'); } if (null != doctypeSystem) { if (null == doctypePublic) writer.write(" SYSTEM \""); else writer.write(" \""); writer.write(doctypeSystem); writer.write('"'); } writer.write('>'); outputLineSep(); } catch(IOException e) { throw new SAXException(e); } } } m_needToOutputDocTypeDecl = false; }
class class_name[name] begin[{] method[outputDocTypeDecl, return_type[void], modifier[private], parameter[name]] begin[{] if[binary_operation[literal[true], ==, member[.m_needToOutputDocTypeDecl]]] begin[{] local_variable[type[String], doctypeSystem] local_variable[type[String], doctypePublic] if[binary_operation[binary_operation[literal[null], !=, member[.doctypeSystem]], ||, binary_operation[literal[null], !=, member[.doctypePublic]]]] begin[{] local_variable[type[java], writer] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<!DOCTYPE ")], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=doctypePublic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=" PUBLIC \"")], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=doctypePublic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='"')], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=doctypeSystem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=doctypePublic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" \"")], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" SYSTEM \"")], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=doctypeSystem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='"')], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='>')], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=outputLineSep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SAXException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] else begin[{] None end[}] assign[member[.m_needToOutputDocTypeDecl], literal[false]] end[}] END[}]
Keyword[private] Keyword[void] identifier[outputDocTypeDecl] operator[SEP] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[SAXException] { Keyword[if] operator[SEP] literal[boolean] operator[==] identifier[m_needToOutputDocTypeDecl] operator[SEP] { identifier[String] identifier[doctypeSystem] operator[=] identifier[getDoctypeSystem] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[doctypePublic] operator[=] identifier[getDoctypePublic] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] Other[null] operator[!=] identifier[doctypeSystem] operator[SEP] operator[||] operator[SEP] Other[null] operator[!=] identifier[doctypePublic] operator[SEP] operator[SEP] { Keyword[final] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[Writer] identifier[writer] operator[=] identifier[m_writer] operator[SEP] Keyword[try] { identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[doctypePublic] operator[SEP] { identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[doctypePublic] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Other[null] operator[!=] identifier[doctypeSystem] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[doctypePublic] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[else] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[doctypeSystem] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[outputLineSep] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SAXException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } } identifier[m_needToOutputDocTypeDecl] operator[=] literal[boolean] operator[SEP] }
public static DMatrixRMaj outerProd(GeoTuple3D_F64 a, GeoTuple3D_F64 b, DMatrixRMaj ret) { if( ret == null ) ret = new DMatrixRMaj(3,3); ret.data[0] = a.x*b.x; ret.data[1] = a.x*b.y; ret.data[2] = a.x*b.z; ret.data[3] = a.y*b.x; ret.data[4] = a.y*b.y; ret.data[5] = a.y*b.z; ret.data[6] = a.z*b.x; ret.data[7] = a.z*b.y; ret.data[8] = a.z*b.z; return ret; }
class class_name[name] begin[{] method[outerProd, return_type[type[DMatrixRMaj]], modifier[public static], parameter[a, b, ret]] begin[{] if[binary_operation[member[.ret], ==, literal[null]]] begin[{] assign[member[.ret], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DMatrixRMaj, sub_type=None))] else begin[{] None end[}] assign[member[ret.data], binary_operation[member[a.x], *, member[b.x]]] assign[member[ret.data], binary_operation[member[a.x], *, member[b.y]]] assign[member[ret.data], binary_operation[member[a.x], *, member[b.z]]] assign[member[ret.data], binary_operation[member[a.y], *, member[b.x]]] assign[member[ret.data], binary_operation[member[a.y], *, member[b.y]]] assign[member[ret.data], binary_operation[member[a.y], *, member[b.z]]] assign[member[ret.data], binary_operation[member[a.z], *, member[b.x]]] assign[member[ret.data], binary_operation[member[a.z], *, member[b.y]]] assign[member[ret.data], binary_operation[member[a.z], *, member[b.z]]] return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DMatrixRMaj] identifier[outerProd] operator[SEP] identifier[GeoTuple3D_F64] identifier[a] , identifier[GeoTuple3D_F64] identifier[b] , identifier[DMatrixRMaj] identifier[ret] operator[SEP] { Keyword[if] operator[SEP] identifier[ret] operator[==] Other[null] operator[SEP] identifier[ret] operator[=] Keyword[new] identifier[DMatrixRMaj] operator[SEP] Other[3] , Other[3] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[data] operator[SEP] Other[0] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[x] operator[*] identifier[b] operator[SEP] identifier[x] operator[SEP] identifier[ret] operator[SEP] identifier[data] operator[SEP] Other[1] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[x] operator[*] identifier[b] operator[SEP] identifier[y] operator[SEP] identifier[ret] operator[SEP] identifier[data] operator[SEP] Other[2] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[x] operator[*] identifier[b] operator[SEP] identifier[z] operator[SEP] identifier[ret] operator[SEP] identifier[data] operator[SEP] Other[3] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[y] operator[*] identifier[b] operator[SEP] identifier[x] operator[SEP] identifier[ret] operator[SEP] identifier[data] operator[SEP] Other[4] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[y] operator[*] identifier[b] operator[SEP] identifier[y] operator[SEP] identifier[ret] operator[SEP] identifier[data] operator[SEP] Other[5] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[y] operator[*] identifier[b] operator[SEP] identifier[z] operator[SEP] identifier[ret] operator[SEP] identifier[data] operator[SEP] Other[6] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[z] operator[*] identifier[b] operator[SEP] identifier[x] operator[SEP] identifier[ret] operator[SEP] identifier[data] operator[SEP] Other[7] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[z] operator[*] identifier[b] operator[SEP] identifier[y] operator[SEP] identifier[ret] operator[SEP] identifier[data] operator[SEP] Other[8] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[z] operator[*] identifier[b] operator[SEP] identifier[z] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
@Override public NodeType registerNodeType( NodeTypeDefinition template, boolean allowUpdate ) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, AccessDeniedException, RepositoryException { session.checkLive(); try { session.checkWorkspacePermission(session.workspaceName(), ModeShapePermissions.REGISTER_TYPE); } catch (AccessControlException ace) { throw new AccessDeniedException(ace); } JcrNodeType jcrNodeType = this.repositoryTypeManager.registerNodeType(template, !allowUpdate); this.schemata = null; //clear the cached schemata to make sure it is reloaded return jcrNodeType; }
class class_name[name] begin[{] method[registerNodeType, return_type[type[NodeType]], modifier[public], parameter[template, allowUpdate]] begin[{] call[session.checkLive, parameter[]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=workspaceName, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), MemberReference(member=REGISTER_TYPE, postfix_operators=[], prefix_operators=[], qualifier=ModeShapePermissions, selectors=[])], member=checkWorkspacePermission, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ace, 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=AccessDeniedException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ace, types=['AccessControlException']))], finally_block=None, label=None, resources=None) local_variable[type[JcrNodeType], jcrNodeType] assign[THIS[member[None.schemata]], literal[null]] return[member[.jcrNodeType]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[NodeType] identifier[registerNodeType] operator[SEP] identifier[NodeTypeDefinition] identifier[template] , Keyword[boolean] identifier[allowUpdate] operator[SEP] Keyword[throws] identifier[InvalidNodeTypeDefinitionException] , identifier[NodeTypeExistsException] , identifier[AccessDeniedException] , identifier[RepositoryException] { identifier[session] operator[SEP] identifier[checkLive] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[session] operator[SEP] identifier[checkWorkspacePermission] operator[SEP] identifier[session] operator[SEP] identifier[workspaceName] operator[SEP] operator[SEP] , identifier[ModeShapePermissions] operator[SEP] identifier[REGISTER_TYPE] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[AccessControlException] identifier[ace] operator[SEP] { Keyword[throw] Keyword[new] identifier[AccessDeniedException] operator[SEP] identifier[ace] operator[SEP] operator[SEP] } identifier[JcrNodeType] identifier[jcrNodeType] operator[=] Keyword[this] operator[SEP] identifier[repositoryTypeManager] operator[SEP] identifier[registerNodeType] operator[SEP] identifier[template] , operator[!] identifier[allowUpdate] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[schemata] operator[=] Other[null] operator[SEP] Keyword[return] identifier[jcrNodeType] operator[SEP] }
@Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); // See if the image needs redrawing refreshImage(false); }
class class_name[name] begin[{] method[onLayout, return_type[void], modifier[protected], parameter[changed, left, top, right, bottom]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=changed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=top, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bottom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onLayout, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) call[.refreshImage, parameter[literal[false]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[onLayout] operator[SEP] Keyword[boolean] identifier[changed] , Keyword[int] identifier[left] , Keyword[int] identifier[top] , Keyword[int] identifier[right] , Keyword[int] identifier[bottom] operator[SEP] { Keyword[super] operator[SEP] identifier[onLayout] operator[SEP] identifier[changed] , identifier[left] , identifier[top] , identifier[right] , identifier[bottom] operator[SEP] operator[SEP] identifier[refreshImage] operator[SEP] literal[boolean] operator[SEP] operator[SEP] }
private void recursiveDump(Area a, int level, java.io.PrintWriter p) { String stag = "<area" + " id=\"x" + (idcnt++) + "\"" + " x1=\"" + a.getX1() + "\"" + " y1=\"" + a.getY1() + "\"" + " x2=\"" + a.getX2() + "\"" + " y2=\"" + a.getY2() + "\"" + " background=\"" + colorString(a.getBackgroundColor()) + "\"" + " fontsize=\"" + a.getFontSize() + "\"" + " fontweight=\"" + a.getFontWeight() + "\"" + " fontstyle=\"" + a.getFontStyle() + "\"" + " tags=\"" + tagString(a.getTags().keySet()) + "\"" + ">"; String etag = "</area>"; if (a.getChildCount() > 0) { indent(level, p); p.println(stag); for (int i = 0; i < a.getChildCount(); i++) recursiveDump(a.getChildAt(i), level+1, p); indent(level, p); p.println(etag); } else { indent(level, p); p.println(stag); dumpBoxes(a, p, level+1); indent(level, p); p.println(etag); } }
class class_name[name] begin[{] method[recursiveDump, return_type[void], modifier[private], parameter[a, level, p]] begin[{] local_variable[type[String], stag] local_variable[type[String], etag] if[binary_operation[call[a.getChildCount, parameter[]], >, literal[0]]] begin[{] call[.indent, parameter[member[.level], member[.p]]] call[p.println, parameter[member[.stag]]] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getChildAt, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None), BinaryOperation(operandl=MemberReference(member=level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recursiveDump, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getChildCount, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[.indent, parameter[member[.level], member[.p]]] call[p.println, parameter[member[.etag]]] else begin[{] call[.indent, parameter[member[.level], member[.p]]] call[p.println, parameter[member[.stag]]] call[.dumpBoxes, parameter[member[.a], member[.p], binary_operation[member[.level], +, literal[1]]]] call[.indent, parameter[member[.level], member[.p]]] call[p.println, parameter[member[.etag]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[recursiveDump] operator[SEP] identifier[Area] identifier[a] , Keyword[int] identifier[level] , identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[PrintWriter] identifier[p] operator[SEP] { identifier[String] identifier[stag] operator[=] literal[String] operator[+] literal[String] operator[+] operator[SEP] identifier[idcnt] operator[++] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[a] operator[SEP] identifier[getX1] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[a] operator[SEP] identifier[getY1] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[a] operator[SEP] identifier[getX2] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[a] operator[SEP] identifier[getY2] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[colorString] operator[SEP] identifier[a] operator[SEP] identifier[getBackgroundColor] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[a] operator[SEP] identifier[getFontSize] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[a] operator[SEP] identifier[getFontWeight] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[a] operator[SEP] identifier[getFontStyle] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[tagString] operator[SEP] identifier[a] operator[SEP] identifier[getTags] operator[SEP] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] identifier[String] identifier[etag] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[getChildCount] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[indent] operator[SEP] identifier[level] , identifier[p] operator[SEP] operator[SEP] identifier[p] operator[SEP] identifier[println] operator[SEP] identifier[stag] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[a] operator[SEP] identifier[getChildCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[recursiveDump] operator[SEP] identifier[a] operator[SEP] identifier[getChildAt] operator[SEP] identifier[i] operator[SEP] , identifier[level] operator[+] Other[1] , identifier[p] operator[SEP] operator[SEP] identifier[indent] operator[SEP] identifier[level] , identifier[p] operator[SEP] operator[SEP] identifier[p] operator[SEP] identifier[println] operator[SEP] identifier[etag] operator[SEP] operator[SEP] } Keyword[else] { identifier[indent] operator[SEP] identifier[level] , identifier[p] operator[SEP] operator[SEP] identifier[p] operator[SEP] identifier[println] operator[SEP] identifier[stag] operator[SEP] operator[SEP] identifier[dumpBoxes] operator[SEP] identifier[a] , identifier[p] , identifier[level] operator[+] Other[1] operator[SEP] operator[SEP] identifier[indent] operator[SEP] identifier[level] , identifier[p] operator[SEP] operator[SEP] identifier[p] operator[SEP] identifier[println] operator[SEP] identifier[etag] operator[SEP] operator[SEP] } }
@Override public String getColumnName(final int col) { try { return columnsModel.getColumnNames()[col]; } catch (Exception e) { log.log(Level.SEVERE, "Error occured on getting column name on index " + col + ".", e); } return null; }
class class_name[name] begin[{] method[getColumnName, return_type[type[String]], modifier[public], parameter[col]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getColumnNames, postfix_operators=[], prefix_operators=[], qualifier=columnsModel, selectors=[ArraySelector(index=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error occured on getting column name on index "), operandr=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, 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) return[literal[null]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getColumnName] operator[SEP] Keyword[final] Keyword[int] identifier[col] operator[SEP] { Keyword[try] { Keyword[return] identifier[columnsModel] operator[SEP] identifier[getColumnNames] operator[SEP] operator[SEP] operator[SEP] identifier[col] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] operator[+] identifier[col] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
@Override public <T extends Inspection> T getInspectionForHitNumber(int hitNumber) { return (T) getInspectionsForHitNumber(hitNumber).get(0); }
class class_name[name] begin[{] method[getInspectionForHitNumber, return_type[type[T]], modifier[public], parameter[hitNumber]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=hitNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInspectionsForHitNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[Inspection] operator[>] identifier[T] identifier[getInspectionForHitNumber] operator[SEP] Keyword[int] identifier[hitNumber] operator[SEP] { Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[getInspectionsForHitNumber] operator[SEP] identifier[hitNumber] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] }
protected int getRequestPort(){ String port = header("X-Forwarded-Port"); return org.javalite.common.Util.blank(port)? port(): Integer.parseInt(port); }
class class_name[name] begin[{] method[getRequestPort, return_type[type[int]], modifier[protected], parameter[]] begin[{] local_variable[type[String], port] return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=blank, postfix_operators=[], prefix_operators=[], qualifier=org.javalite.common.Util, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[protected] Keyword[int] identifier[getRequestPort] operator[SEP] operator[SEP] { identifier[String] identifier[port] operator[=] identifier[header] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[org] operator[SEP] identifier[javalite] operator[SEP] identifier[common] operator[SEP] identifier[Util] operator[SEP] identifier[blank] operator[SEP] identifier[port] operator[SEP] operator[?] identifier[port] operator[SEP] operator[SEP] operator[:] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[port] operator[SEP] operator[SEP] }
@Nullable public PaymentMethod createPaymentMethodSynchronous( @NonNull PaymentMethodCreateParams paymentMethodCreateParams, @NonNull String publishableKey) throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException { return mApiHandler.createPaymentMethod(paymentMethodCreateParams, publishableKey, mStripeAccount); }
class class_name[name] begin[{] method[createPaymentMethodSynchronous, return_type[type[PaymentMethod]], modifier[public], parameter[paymentMethodCreateParams, publishableKey]] begin[{] return[call[mApiHandler.createPaymentMethod, parameter[member[.paymentMethodCreateParams], member[.publishableKey], member[.mStripeAccount]]]] end[}] END[}]
annotation[@] identifier[Nullable] Keyword[public] identifier[PaymentMethod] identifier[createPaymentMethodSynchronous] operator[SEP] annotation[@] identifier[NonNull] identifier[PaymentMethodCreateParams] identifier[paymentMethodCreateParams] , annotation[@] identifier[NonNull] identifier[String] identifier[publishableKey] operator[SEP] Keyword[throws] identifier[AuthenticationException] , identifier[InvalidRequestException] , identifier[APIConnectionException] , identifier[APIException] { Keyword[return] identifier[mApiHandler] operator[SEP] identifier[createPaymentMethod] operator[SEP] identifier[paymentMethodCreateParams] , identifier[publishableKey] , identifier[mStripeAccount] operator[SEP] operator[SEP] }
public static boolean isAsciiDigtalInteger(final String str) { if (N.isNullOrEmpty(str)) { return false; } final char[] chs = getCharsForReadOnly(str); int i = 0, num = 0; if (chs[i] == '+' || chs[i] == '-') { i++; } for (; i < chs.length && (chs[i] >= '0' && chs[i] <= '9'); i++) { num++; } if (num == 0) { return false; } return i == chs.length; }
class class_name[name] begin[{] method[isAsciiDigtalInteger, return_type[type[boolean]], modifier[public static], parameter[str]] begin[{] if[call[N.isNullOrEmpty, parameter[member[.str]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[char], chs] local_variable[type[int], i] if[binary_operation[binary_operation[member[.chs], ==, literal['+']], ||, binary_operation[member[.chs], ==, literal['-']]]] begin[{] member[.i] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=num, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=chs, selectors=[]), operator=<), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=chs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=chs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='9'), operator=<=), operator=&&), operator=&&), init=None, update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[member[.num], ==, literal[0]]] begin[{] return[literal[false]] else begin[{] None end[}] return[binary_operation[member[.i], ==, member[chs.length]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isAsciiDigtalInteger] operator[SEP] Keyword[final] identifier[String] identifier[str] operator[SEP] { Keyword[if] operator[SEP] identifier[N] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[str] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[final] Keyword[char] operator[SEP] operator[SEP] identifier[chs] operator[=] identifier[getCharsForReadOnly] operator[SEP] identifier[str] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[num] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[chs] operator[SEP] identifier[i] operator[SEP] operator[==] literal[String] operator[||] identifier[chs] operator[SEP] identifier[i] operator[SEP] operator[==] literal[String] operator[SEP] { identifier[i] operator[++] operator[SEP] } Keyword[for] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[chs] operator[SEP] identifier[length] operator[&&] operator[SEP] identifier[chs] operator[SEP] identifier[i] operator[SEP] operator[>=] literal[String] operator[&&] identifier[chs] operator[SEP] identifier[i] operator[SEP] operator[<=] literal[String] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[num] operator[++] operator[SEP] } Keyword[if] operator[SEP] identifier[num] operator[==] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] identifier[i] operator[==] identifier[chs] operator[SEP] identifier[length] operator[SEP] }
public String seriesToString(double[] series, NumberFormat df) { StringBuffer sb = new StringBuffer(); sb.append('['); for (double d : series) { sb.append(df.format(d)).append(','); } sb.delete(sb.length() - 2, sb.length() - 1).append("]"); return sb.toString(); }
class class_name[name] begin[{] method[seriesToString, return_type[type[String]], modifier[public], parameter[series, df]] begin[{] local_variable[type[StringBuffer], sb] call[sb.append, parameter[literal['[']]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=df, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=',')], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=series, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=d)], modifiers=set(), type=BasicType(dimensions=[], name=double))), label=None) call[sb.delete, parameter[binary_operation[call[sb.length, parameter[]], -, literal[2]], binary_operation[call[sb.length, parameter[]], -, literal[1]]]] return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[seriesToString] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[series] , identifier[NumberFormat] identifier[df] operator[SEP] { identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[double] identifier[d] operator[:] identifier[series] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[df] operator[SEP] identifier[format] operator[SEP] identifier[d] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[sb] operator[SEP] identifier[delete] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[2] , identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] 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] }
private static void createCustomMetricDescriptor( @Nonnull String metricName, @Nonnull String metricKind, @Nonnull String metricUnit, @Nonnull String metricValueType, @Nonnull List<String> classificationLabels ) throws Exception { logger.info("Registering new custom metric : " + metricName + " : " + metricKind + " : " + metricUnit + " : " + metricValueType + " : " + classificationLabels); String url = "projects/" + projectId + "/metricDescriptors"; String fullName = "custom.googleapis.com/" + metricName; JsonObject md = new JsonObject(); md.add("name", url + "/" + URLEncoder.encode(fullName, "UTF-8")); md.add("type", fullName); md.add("metricKind", metricKind.toUpperCase()); md.add("valueType", metricValueType.toUpperCase()); md.add("unit", metricUnit); // Metric Labels JsonArray labels = new JsonArray(); for (String entry : classificationLabels) { JsonObject label = new JsonObject(); label.add("key", entry); label.add("description", entry); label.add("valueType", "STRING"); labels.add(label); } md.add("labels", labels); String request = md.toString(); logger.fine("Metric creation request : " + request); String response = cf.doPost(url, md.toString()); logger.finer("Metric creation response" + response); logger.info("Created custom metric : " + metricName); }
class class_name[name] begin[{] method[createCustomMetricDescriptor, return_type[void], modifier[private static], parameter[metricName, metricKind, metricUnit, metricValueType, classificationLabels]] begin[{] call[logger.info, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Registering new custom metric : "], +, member[.metricName]], +, literal[" : "]], +, member[.metricKind]], +, literal[" : "]], +, member[.metricUnit]], +, literal[" : "]], +, member[.metricValueType]], +, literal[" : "]], +, member[.classificationLabels]]]] local_variable[type[String], url] local_variable[type[String], fullName] local_variable[type[JsonObject], md] call[md.add, parameter[literal["name"], binary_operation[binary_operation[member[.url], +, literal["/"]], +, call[URLEncoder.encode, parameter[member[.fullName], literal["UTF-8"]]]]]] call[md.add, parameter[literal["type"], member[.fullName]]] call[md.add, parameter[literal["metricKind"], call[metricKind.toUpperCase, parameter[]]]] call[md.add, parameter[literal["valueType"], call[metricValueType.toUpperCase, parameter[]]]] call[md.add, parameter[literal["unit"], member[.metricUnit]]] local_variable[type[JsonArray], labels] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonObject, sub_type=None)), name=label)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsonObject, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="key"), MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=label, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="description"), MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=label, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="valueType"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="STRING")], member=add, postfix_operators=[], prefix_operators=[], qualifier=label, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=labels, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=classificationLabels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[md.add, parameter[literal["labels"], member[.labels]]] local_variable[type[String], request] call[logger.fine, parameter[binary_operation[literal["Metric creation request : "], +, member[.request]]]] local_variable[type[String], response] call[logger.finer, parameter[binary_operation[literal["Metric creation response"], +, member[.response]]]] call[logger.info, parameter[binary_operation[literal["Created custom metric : "], +, member[.metricName]]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[createCustomMetricDescriptor] operator[SEP] annotation[@] identifier[Nonnull] identifier[String] identifier[metricName] , annotation[@] identifier[Nonnull] identifier[String] identifier[metricKind] , annotation[@] identifier[Nonnull] identifier[String] identifier[metricUnit] , annotation[@] identifier[Nonnull] identifier[String] identifier[metricValueType] , annotation[@] identifier[Nonnull] identifier[List] operator[<] identifier[String] operator[>] identifier[classificationLabels] operator[SEP] Keyword[throws] identifier[Exception] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[metricName] operator[+] literal[String] operator[+] identifier[metricKind] operator[+] literal[String] operator[+] identifier[metricUnit] operator[+] literal[String] operator[+] identifier[metricValueType] operator[+] literal[String] operator[+] identifier[classificationLabels] operator[SEP] operator[SEP] identifier[String] identifier[url] operator[=] literal[String] operator[+] identifier[projectId] operator[+] literal[String] operator[SEP] identifier[String] identifier[fullName] operator[=] literal[String] operator[+] identifier[metricName] operator[SEP] identifier[JsonObject] identifier[md] operator[=] Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[md] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[url] operator[+] literal[String] operator[+] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[fullName] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[md] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[fullName] operator[SEP] operator[SEP] identifier[md] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[metricKind] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[md] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[metricValueType] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[md] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[metricUnit] operator[SEP] operator[SEP] identifier[JsonArray] identifier[labels] operator[=] Keyword[new] identifier[JsonArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[entry] operator[:] identifier[classificationLabels] operator[SEP] { identifier[JsonObject] identifier[label] operator[=] Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[label] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[entry] operator[SEP] operator[SEP] identifier[label] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[entry] operator[SEP] operator[SEP] identifier[label] operator[SEP] identifier[add] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[labels] operator[SEP] identifier[add] operator[SEP] identifier[label] operator[SEP] operator[SEP] } identifier[md] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[labels] operator[SEP] operator[SEP] identifier[String] identifier[request] operator[=] identifier[md] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] identifier[request] operator[SEP] operator[SEP] identifier[String] identifier[response] operator[=] identifier[cf] operator[SEP] identifier[doPost] operator[SEP] identifier[url] , identifier[md] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[finer] operator[SEP] literal[String] operator[+] identifier[response] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[metricName] operator[SEP] operator[SEP] }
public static void addPageInput( String name, Object value, ServletRequest request ) { addActionOutput( name, value, request ); }
class class_name[name] begin[{] method[addPageInput, return_type[void], modifier[public static], parameter[name, value, request]] begin[{] call[.addActionOutput, parameter[member[.name], member[.value], member[.request]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[addPageInput] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[value] , identifier[ServletRequest] identifier[request] operator[SEP] { identifier[addActionOutput] operator[SEP] identifier[name] , identifier[value] , identifier[request] operator[SEP] operator[SEP] }
private void obtainDialogIconTintList(@NonNull final TypedArray typedArray) { setDialogIconTintList( typedArray.getColorStateList(R.styleable.DialogPreference_dialogIconTint)); }
class class_name[name] begin[{] method[obtainDialogIconTintList, return_type[void], modifier[private], parameter[typedArray]] begin[{] call[.setDialogIconTintList, parameter[call[typedArray.getColorStateList, parameter[member[R.styleable.DialogPreference_dialogIconTint]]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[obtainDialogIconTintList] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[TypedArray] identifier[typedArray] operator[SEP] { identifier[setDialogIconTintList] operator[SEP] identifier[typedArray] operator[SEP] identifier[getColorStateList] operator[SEP] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[DialogPreference_dialogIconTint] operator[SEP] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") protected <T extends Resource> T unmarshalReference(HttpResponse response, String format) { T resource = null; OperationOutcome error = null; byte[] cnt = log(response); if (cnt != null) { try { resource = (T)getParser(format).parse(cnt); if (resource instanceof OperationOutcome && hasError((OperationOutcome)resource)) { error = (OperationOutcome) resource; } } catch(IOException ioe) { throw new EFhirClientException("Error reading Http Response: "+ioe.getMessage(), ioe); } catch(Exception e) { throw new EFhirClientException("Error parsing response message: "+e.getMessage(), e); } } if(error != null) { throw new EFhirClientException("Error from server: "+ResourceUtilities.getErrorDescription(error), error); } return resource; }
class class_name[name] begin[{] method[unmarshalReference, return_type[type[T]], modifier[protected], parameter[response, format]] begin[{] local_variable[type[T], resource] local_variable[type[OperationOutcome], error] local_variable[type[byte], cnt] if[binary_operation[member[.cnt], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=cnt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=OperationOutcome, sub_type=None), operator=instanceof), operandr=MethodInvocation(arguments=[Cast(expression=MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=OperationOutcome, sub_type=None))], member=hasError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=OperationOutcome, sub_type=None))), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error reading Http Response: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ioe, selectors=[], type_arguments=None), operator=+), MemberReference(member=ioe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EFhirClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error parsing response message: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EFhirClientException, 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[}] if[binary_operation[member[.error], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error from server: "), operandr=MethodInvocation(arguments=[MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getErrorDescription, postfix_operators=[], prefix_operators=[], qualifier=ResourceUtilities, selectors=[], type_arguments=None), operator=+), MemberReference(member=error, 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=EFhirClientException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.resource]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[protected] operator[<] identifier[T] Keyword[extends] identifier[Resource] operator[>] identifier[T] identifier[unmarshalReference] operator[SEP] identifier[HttpResponse] identifier[response] , identifier[String] identifier[format] operator[SEP] { identifier[T] identifier[resource] operator[=] Other[null] operator[SEP] identifier[OperationOutcome] identifier[error] operator[=] Other[null] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[cnt] operator[=] identifier[log] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cnt] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[resource] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[getParser] operator[SEP] identifier[format] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[cnt] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resource] Keyword[instanceof] identifier[OperationOutcome] operator[&&] identifier[hasError] operator[SEP] operator[SEP] identifier[OperationOutcome] operator[SEP] identifier[resource] operator[SEP] operator[SEP] { identifier[error] operator[=] operator[SEP] identifier[OperationOutcome] operator[SEP] identifier[resource] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] { Keyword[throw] Keyword[new] identifier[EFhirClientException] operator[SEP] literal[String] operator[+] identifier[ioe] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[ioe] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[EFhirClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[error] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[EFhirClientException] operator[SEP] literal[String] operator[+] identifier[ResourceUtilities] operator[SEP] identifier[getErrorDescription] operator[SEP] identifier[error] operator[SEP] , identifier[error] operator[SEP] operator[SEP] } Keyword[return] identifier[resource] operator[SEP] }
private void _function() throws IOException { // Assumes that builder already contains an IDENT if (debug) { checkArgument('(' == reader.peek()); } builder.type = Type.FUNCTION; builder.append(reader.next()); }
class class_name[name] begin[{] method[_function, return_type[void], modifier[private], parameter[]] begin[{] if[member[.debug]] begin[{] call[.checkArgument, parameter[binary_operation[literal['('], ==, call[reader.peek, parameter[]]]]] else begin[{] None end[}] assign[member[builder.type], member[Type.FUNCTION]] call[builder.append, parameter[call[reader.next, parameter[]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[_function] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[debug] operator[SEP] { identifier[checkArgument] operator[SEP] literal[String] operator[==] identifier[reader] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[type] operator[=] identifier[Type] operator[SEP] identifier[FUNCTION] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[reader] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.AMI__DSPLCMNT: return getDSPLCMNT(); } return super.eGet(featureID, resolve, coreType); }
class class_name[name] begin[{] method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=AMI__DSPLCMNT, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getDSPLCMNT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[AMI__DSPLCMNT] operator[:] Keyword[return] identifier[getDSPLCMNT] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP] }
public void println(int i) throws IOException { if(this._listener!= null && !checkIfCalledFromWLonError()){ if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "non blocking println int , WriteListener enabled: " + this._listener); this.println_NonBlocking(Integer.toString(i)); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "println int"); super.println(i); } }
class class_name[name] begin[{] method[println, return_type[void], modifier[public], parameter[i]] begin[{] if[binary_operation[binary_operation[THIS[member[None._listener]], !=, literal[null]], &&, call[.checkIfCalledFromWLonError, parameter[]]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[literal["non blocking println int , WriteListener enabled: "], +, THIS[member[None._listener]]]]] else begin[{] None end[}] THIS[call[None.println_NonBlocking, parameter[call[Integer.toString, parameter[member[.i]]]]]] else begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], literal["println int"]]] else begin[{] None end[}] SuperMethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[println] operator[SEP] Keyword[int] identifier[i] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[_listener] operator[!=] Other[null] operator[&&] operator[!] identifier[checkIfCalledFromWLonError] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] Keyword[this] operator[SEP] identifier[_listener] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[println_NonBlocking] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { 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[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[println] operator[SEP] identifier[i] operator[SEP] operator[SEP] } }
@Override protected void exportCommandLineData(final StringBuilder out, final int occ) { uncompileQuoter(out, getValue(occ).getAbsolutePath()); }
class class_name[name] begin[{] method[exportCommandLineData, return_type[void], modifier[protected], parameter[out, occ]] begin[{] call[.uncompileQuoter, parameter[member[.out], call[.getValue, parameter[member[.occ]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[exportCommandLineData] operator[SEP] Keyword[final] identifier[StringBuilder] identifier[out] , Keyword[final] Keyword[int] identifier[occ] operator[SEP] { identifier[uncompileQuoter] operator[SEP] identifier[out] , identifier[getValue] operator[SEP] identifier[occ] operator[SEP] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static <K, V> HadoopInputFormat<K, V> readHadoopFile(org.apache.hadoop.mapred.FileInputFormat<K, V> mapredInputFormat, Class<K> key, Class<V> value, String inputPath, JobConf job) { // set input path in JobConf org.apache.hadoop.mapred.FileInputFormat.addInputPath(job, new org.apache.hadoop.fs.Path(inputPath)); // return wrapping InputFormat return createHadoopInput(mapredInputFormat, key, value, job); }
class class_name[name] begin[{] method[readHadoopFile, return_type[type[HadoopInputFormat]], modifier[public static], parameter[mapredInputFormat, key, value, inputPath, job]] begin[{] call[org.apache.hadoop.mapred.FileInputFormat.addInputPath, parameter[member[.job], ClassCreator(arguments=[MemberReference(member=inputPath, 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=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=apache, sub_type=ReferenceType(arguments=None, dimensions=None, name=hadoop, sub_type=ReferenceType(arguments=None, dimensions=None, name=fs, sub_type=ReferenceType(arguments=None, dimensions=None, name=Path, sub_type=None))))))]] return[call[.createHadoopInput, parameter[member[.mapredInputFormat], member[.key], member[.value], member[.job]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[HadoopInputFormat] operator[<] identifier[K] , identifier[V] operator[>] identifier[readHadoopFile] operator[SEP] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[hadoop] operator[SEP] identifier[mapred] operator[SEP] identifier[FileInputFormat] operator[<] identifier[K] , identifier[V] operator[>] identifier[mapredInputFormat] , identifier[Class] operator[<] identifier[K] operator[>] identifier[key] , identifier[Class] operator[<] identifier[V] operator[>] identifier[value] , identifier[String] identifier[inputPath] , identifier[JobConf] identifier[job] operator[SEP] { identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[hadoop] operator[SEP] identifier[mapred] operator[SEP] identifier[FileInputFormat] operator[SEP] identifier[addInputPath] operator[SEP] identifier[job] , Keyword[new] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[hadoop] operator[SEP] identifier[fs] operator[SEP] identifier[Path] operator[SEP] identifier[inputPath] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[createHadoopInput] operator[SEP] identifier[mapredInputFormat] , identifier[key] , identifier[value] , identifier[job] operator[SEP] operator[SEP] }
public String readUTF() throws IOException { int byte1 = in.read(); int byte2 = in.read(); if (byte2 < 0) { throw new EOFException(); } int numbytes = (byte1 << 8) + byte2; char result[] = new char[numbytes]; int numread = 0; int numchars = 0; while (numread < numbytes) { int c1 = readUnsignedByte(); int c2, c3; // The first four bits of c1 determine how many bytes are in this char int test = c1 >> 4; if (test < 8) { // one byte numread++; result[numchars++] = (char) c1; } else if (test == 12 || test == 13) { // two bytes numread += 2; if (numread > numbytes) { throw new UTFDataFormatException(); } c2 = readUnsignedByte(); if ((c2 & 0xC0) != 0x80) { throw new UTFDataFormatException(); } result[numchars++] = (char) (((c1 & 0x1F) << 6) | (c2 & 0x3F)); } else if (test == 14) { // three bytes numread += 3; if (numread > numbytes) { throw new UTFDataFormatException(); } c2 = readUnsignedByte(); c3 = readUnsignedByte(); if (((c2 & 0xC0) != 0x80) || ((c3 & 0xC0) != 0x80)) { throw new UTFDataFormatException(); } result[numchars++] = (char) (((c1 & 0x0F) << 12) | ((c2 & 0x3F) << 6) | (c3 & 0x3F)); } else { // malformed throw new UTFDataFormatException(); } } // end while return new String(result, 0, numchars); }
class class_name[name] begin[{] method[readUTF, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[int], byte1] local_variable[type[int], byte2] if[binary_operation[member[.byte2], <, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EOFException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], numbytes] local_variable[type[char], result] local_variable[type[int], numread] local_variable[type[int], numchars] while[binary_operation[member[.numread], <, member[.numbytes]]] begin[{] local_variable[type[int], c1] local_variable[type[int], c2] local_variable[type[int], test] if[binary_operation[member[.test], <, literal[8]]] begin[{] member[.numread] assign[member[.result], Cast(expression=MemberReference(member=c1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))] else begin[{] if[binary_operation[binary_operation[member[.test], ==, literal[12]], ||, binary_operation[member[.test], ==, literal[13]]]] begin[{] assign[member[.numread], literal[2]] if[binary_operation[member[.numread], >, member[.numbytes]]] 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=UTFDataFormatException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.c2], call[.readUnsignedByte, parameter[]]] if[binary_operation[binary_operation[member[.c2], &, literal[0xC0]], !=, literal[0x80]]] 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=UTFDataFormatException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.result], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x1F), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), operator=<<), operandr=BinaryOperation(operandl=MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x3F), operator=&), operator=|), type=BasicType(dimensions=[], name=char))] else begin[{] if[binary_operation[member[.test], ==, literal[14]]] begin[{] assign[member[.numread], literal[3]] if[binary_operation[member[.numread], >, member[.numbytes]]] 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=UTFDataFormatException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.c2], call[.readUnsignedByte, parameter[]]] assign[member[.c3], call[.readUnsignedByte, parameter[]]] if[binary_operation[binary_operation[binary_operation[member[.c2], &, literal[0xC0]], !=, literal[0x80]], ||, binary_operation[binary_operation[member[.c3], &, literal[0xC0]], !=, literal[0x80]]]] 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=UTFDataFormatException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.result], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x0F), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12), operator=<<), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x3F), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), operator=<<), operator=|), operandr=BinaryOperation(operandl=MemberReference(member=c3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x3F), operator=&), operator=|), type=BasicType(dimensions=[], name=char))] else 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=UTFDataFormatException, sub_type=None)), label=None) end[}] end[}] end[}] end[}] return[ClassCreator(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=numchars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] end[}] END[}]
Keyword[public] identifier[String] identifier[readUTF] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[int] identifier[byte1] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[byte2] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[byte2] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[EOFException] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[numbytes] operator[=] operator[SEP] identifier[byte1] operator[<<] Other[8] operator[SEP] operator[+] identifier[byte2] operator[SEP] Keyword[char] identifier[result] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[char] operator[SEP] identifier[numbytes] operator[SEP] operator[SEP] Keyword[int] identifier[numread] operator[=] Other[0] operator[SEP] Keyword[int] identifier[numchars] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[numread] operator[<] identifier[numbytes] operator[SEP] { Keyword[int] identifier[c1] operator[=] identifier[readUnsignedByte] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[c2] , identifier[c3] operator[SEP] Keyword[int] identifier[test] operator[=] identifier[c1] operator[>] operator[>] Other[4] operator[SEP] Keyword[if] operator[SEP] identifier[test] operator[<] Other[8] operator[SEP] { identifier[numread] operator[++] operator[SEP] identifier[result] operator[SEP] identifier[numchars] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[char] operator[SEP] identifier[c1] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[test] operator[==] Other[12] operator[||] identifier[test] operator[==] Other[13] operator[SEP] { identifier[numread] operator[+=] Other[2] operator[SEP] Keyword[if] operator[SEP] identifier[numread] operator[>] identifier[numbytes] operator[SEP] { Keyword[throw] Keyword[new] identifier[UTFDataFormatException] operator[SEP] operator[SEP] operator[SEP] } identifier[c2] operator[=] identifier[readUnsignedByte] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[c2] operator[&] literal[Integer] operator[SEP] operator[!=] literal[Integer] operator[SEP] { Keyword[throw] Keyword[new] identifier[UTFDataFormatException] operator[SEP] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[numchars] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[c1] operator[&] literal[Integer] operator[SEP] operator[<<] Other[6] operator[SEP] operator[|] operator[SEP] identifier[c2] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[test] operator[==] Other[14] operator[SEP] { identifier[numread] operator[+=] Other[3] operator[SEP] Keyword[if] operator[SEP] identifier[numread] operator[>] identifier[numbytes] operator[SEP] { Keyword[throw] Keyword[new] identifier[UTFDataFormatException] operator[SEP] operator[SEP] operator[SEP] } identifier[c2] operator[=] identifier[readUnsignedByte] operator[SEP] operator[SEP] operator[SEP] identifier[c3] operator[=] identifier[readUnsignedByte] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[c2] operator[&] literal[Integer] operator[SEP] operator[!=] literal[Integer] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[c3] operator[&] literal[Integer] operator[SEP] operator[!=] literal[Integer] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[UTFDataFormatException] operator[SEP] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[numchars] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[c1] operator[&] literal[Integer] operator[SEP] operator[<<] Other[12] operator[SEP] operator[|] operator[SEP] operator[SEP] identifier[c2] operator[&] literal[Integer] operator[SEP] operator[<<] Other[6] operator[SEP] operator[|] operator[SEP] identifier[c3] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[UTFDataFormatException] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[result] , Other[0] , identifier[numchars] operator[SEP] operator[SEP] }
public Txn getTxn() throws Exception { mLock.lock(); try { checkClosed(); return mActive == null ? null : mActive.getTxn(); } finally { mLock.unlock(); } }
class class_name[name] begin[{] method[getTxn, return_type[type[Txn]], modifier[public], parameter[]] begin[{] call[mLock.lock, parameter[]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=checkClosed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=mActive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getTxn, postfix_operators=[], prefix_operators=[], qualifier=mActive, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=mLock, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Txn] identifier[getTxn] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[mLock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[checkClosed] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[mActive] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[mActive] operator[SEP] identifier[getTxn] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { identifier[mLock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } }
byte[][] getQualifierKeys(String family) { Map<String, TypeInformation<?>> qualifierMap = familyMap.get(family); if (qualifierMap == null) { throw new IllegalArgumentException("Family " + family + " does not exist in schema."); } Charset c = Charset.forName(charset); byte[][] qualifierKeys = new byte[qualifierMap.size()][]; int i = 0; for (String name : qualifierMap.keySet()) { qualifierKeys[i++] = name.getBytes(c); } return qualifierKeys; }
class class_name[name] begin[{] method[getQualifierKeys, return_type[type[byte]], modifier[default], parameter[family]] begin[{] local_variable[type[Map], qualifierMap] if[binary_operation[member[.qualifierMap], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Family "), operandr=MemberReference(member=family, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" does not exist in schema."), 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[Charset], c] local_variable[type[byte], qualifierKeys] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=qualifierKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=qualifierMap, selectors=[], type_arguments=None), 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) return[member[.qualifierKeys]] end[}] END[}]
Keyword[byte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getQualifierKeys] operator[SEP] identifier[String] identifier[family] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[TypeInformation] operator[<] operator[?] operator[>] operator[>] identifier[qualifierMap] operator[=] identifier[familyMap] operator[SEP] identifier[get] operator[SEP] identifier[family] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[qualifierMap] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[family] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[Charset] identifier[c] operator[=] identifier[Charset] operator[SEP] identifier[forName] operator[SEP] identifier[charset] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[qualifierKeys] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[qualifierMap] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[name] operator[:] identifier[qualifierMap] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[qualifierKeys] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] identifier[name] operator[SEP] identifier[getBytes] operator[SEP] identifier[c] operator[SEP] operator[SEP] } Keyword[return] identifier[qualifierKeys] operator[SEP] }
public void marshall(EmailContent emailContent, ProtocolMarshaller protocolMarshaller) { if (emailContent == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(emailContent.getSimple(), SIMPLE_BINDING); protocolMarshaller.marshall(emailContent.getRaw(), RAW_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[emailContent, protocolMarshaller]] begin[{] if[binary_operation[member[.emailContent], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSimple, postfix_operators=[], prefix_operators=[], qualifier=emailContent, selectors=[], type_arguments=None), MemberReference(member=SIMPLE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRaw, postfix_operators=[], prefix_operators=[], qualifier=emailContent, selectors=[], type_arguments=None), MemberReference(member=RAW_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[EmailContent] identifier[emailContent] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[emailContent] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[emailContent] operator[SEP] identifier[getSimple] operator[SEP] operator[SEP] , identifier[SIMPLE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[emailContent] operator[SEP] identifier[getRaw] operator[SEP] operator[SEP] , identifier[RAW_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private void removePortsFromArcs(List<Arc> arcs) { for(Arc arc: arcs ) { // If source is port, first clear port indicators else retrieve it from hashmaps if (arc.getSource() instanceof Port ) { Glyph source = portIDToOwnerGlyph.get(((Port)arc.getSource()).getId()); arc.setSource(source); } // If target is port, first clear port indicators else retrieve it from hashmaps if (arc.getTarget() instanceof Port) { Glyph target = portIDToOwnerGlyph.get(((Port)arc.getTarget()).getId()); arc.setTarget(target); } } }
class class_name[name] begin[{] method[removePortsFromArcs, return_type[void], modifier[private], parameter[arcs]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSource, postfix_operators=[], prefix_operators=[], qualifier=arc, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=Port, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[], member=getSource, postfix_operators=[], prefix_operators=[], qualifier=arc, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Port, sub_type=None))], member=get, postfix_operators=[], prefix_operators=[], qualifier=portIDToOwnerGlyph, selectors=[], type_arguments=None), name=source)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Glyph, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSource, postfix_operators=[], prefix_operators=[], qualifier=arc, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTarget, postfix_operators=[], prefix_operators=[], qualifier=arc, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=Port, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[], member=getTarget, postfix_operators=[], prefix_operators=[], qualifier=arc, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Port, sub_type=None))], member=get, postfix_operators=[], prefix_operators=[], qualifier=portIDToOwnerGlyph, selectors=[], type_arguments=None), name=target)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Glyph, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTarget, postfix_operators=[], prefix_operators=[], qualifier=arc, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=arcs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=arc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Arc, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[removePortsFromArcs] operator[SEP] identifier[List] operator[<] identifier[Arc] operator[>] identifier[arcs] operator[SEP] { Keyword[for] operator[SEP] identifier[Arc] identifier[arc] operator[:] identifier[arcs] operator[SEP] { Keyword[if] operator[SEP] identifier[arc] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] Keyword[instanceof] identifier[Port] operator[SEP] { identifier[Glyph] identifier[source] operator[=] identifier[portIDToOwnerGlyph] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[Port] operator[SEP] identifier[arc] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[arc] operator[SEP] identifier[setSource] operator[SEP] identifier[source] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[arc] operator[SEP] identifier[getTarget] operator[SEP] operator[SEP] Keyword[instanceof] identifier[Port] operator[SEP] { identifier[Glyph] identifier[target] operator[=] identifier[portIDToOwnerGlyph] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[Port] operator[SEP] identifier[arc] operator[SEP] identifier[getTarget] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[arc] operator[SEP] identifier[setTarget] operator[SEP] identifier[target] operator[SEP] operator[SEP] } } }
private static void appendHexJavaScriptRepresentation( int codePoint, Appendable out) throws IOException { if (Character.isSupplementaryCodePoint(codePoint)) { // Handle supplementary Unicode values which are not representable in // JavaScript. We deal with these by escaping them as two 4B sequences // so that they will round-trip properly when sent from Java to JavaScript // and back. char[] surrogates = Character.toChars(codePoint); appendHexJavaScriptRepresentation(surrogates[0], out); appendHexJavaScriptRepresentation(surrogates[1], out); return; } out.append("\\u") .append(HEX_CHARS[(codePoint >>> 12) & 0xf]) .append(HEX_CHARS[(codePoint >>> 8) & 0xf]) .append(HEX_CHARS[(codePoint >>> 4) & 0xf]) .append(HEX_CHARS[codePoint & 0xf]); }
class class_name[name] begin[{] method[appendHexJavaScriptRepresentation, return_type[void], modifier[private static], parameter[codePoint, out]] begin[{] if[call[Character.isSupplementaryCodePoint, parameter[member[.codePoint]]]] begin[{] local_variable[type[char], surrogates] call[.appendHexJavaScriptRepresentation, parameter[member[.surrogates], member[.out]]] call[.appendHexJavaScriptRepresentation, parameter[member[.surrogates], member[.out]]] return[None] else begin[{] None end[}] call[out.append, parameter[literal["\\u"]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[appendHexJavaScriptRepresentation] operator[SEP] Keyword[int] identifier[codePoint] , identifier[Appendable] identifier[out] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isSupplementaryCodePoint] operator[SEP] identifier[codePoint] operator[SEP] operator[SEP] { Keyword[char] operator[SEP] operator[SEP] identifier[surrogates] operator[=] identifier[Character] operator[SEP] identifier[toChars] operator[SEP] identifier[codePoint] operator[SEP] operator[SEP] identifier[appendHexJavaScriptRepresentation] operator[SEP] identifier[surrogates] operator[SEP] Other[0] operator[SEP] , identifier[out] operator[SEP] operator[SEP] identifier[appendHexJavaScriptRepresentation] operator[SEP] identifier[surrogates] operator[SEP] Other[1] operator[SEP] , identifier[out] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[out] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[HEX_CHARS] operator[SEP] operator[SEP] identifier[codePoint] operator[>] operator[>] operator[>] Other[12] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[HEX_CHARS] operator[SEP] operator[SEP] identifier[codePoint] operator[>] operator[>] operator[>] Other[8] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[HEX_CHARS] operator[SEP] operator[SEP] identifier[codePoint] operator[>] operator[>] operator[>] Other[4] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[HEX_CHARS] operator[SEP] identifier[codePoint] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP] }
public static <T> T[] notEmpty(final T[] array, final String message, final Object... values) { return INSTANCE.notEmpty(array, message, values); }
class class_name[name] begin[{] method[notEmpty, return_type[type[T]], modifier[public static], parameter[array, message, values]] begin[{] return[call[INSTANCE.notEmpty, parameter[member[.array], member[.message], member[.values]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] operator[SEP] operator[SEP] identifier[notEmpty] operator[SEP] Keyword[final] identifier[T] operator[SEP] operator[SEP] identifier[array] , Keyword[final] identifier[String] identifier[message] , Keyword[final] identifier[Object] operator[...] identifier[values] operator[SEP] { Keyword[return] identifier[INSTANCE] operator[SEP] identifier[notEmpty] operator[SEP] identifier[array] , identifier[message] , identifier[values] operator[SEP] operator[SEP] }
private static IdentifierHandler<? extends Identifier> getExtendedIdentifierHandlerFor(Element element) { if (!checkExtendedIdentityElement(element)) { return null; } String name = element.getAttribute(IfmapStrings.IDENTITY_ATTR_NAME); Document extendedDocument; try { extendedDocument = DomHelpers.parseEscapedXmlString(name); } catch (UnmarshalException e) { return null; } Element extendedElement = extendedDocument.getDocumentElement(); String nodeName = extendedElement.getLocalName(); // try to find the most specific handler for (Entry<Class<? extends Identifier>, IdentifierHandler<? extends Identifier>> entry : sIdentifierHandlers .entrySet()) { String simpleClassName = entry.getKey().getSimpleName(); if (simpleClassName.equalsIgnoreCase(nodeName)) { return entry.getValue(); } } return null; }
class class_name[name] begin[{] method[getExtendedIdentifierHandlerFor, return_type[type[IdentifierHandler]], modifier[private static], parameter[element]] begin[{] if[call[.checkExtendedIdentityElement, parameter[member[.element]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[String], name] local_variable[type[Document], extendedDocument] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=extendedDocument, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseEscapedXmlString, postfix_operators=[], prefix_operators=[], qualifier=DomHelpers, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnmarshalException']))], finally_block=None, label=None, resources=None) local_variable[type[Element], extendedElement] local_variable[type[String], nodeName] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=simpleClassName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=nodeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=simpleClassName, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=sIdentifierHandlers, 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=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Identifier, sub_type=None))], dimensions=[], name=Class, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Identifier, sub_type=None))], dimensions=[], name=IdentifierHandler, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[private] Keyword[static] identifier[IdentifierHandler] operator[<] operator[?] Keyword[extends] identifier[Identifier] operator[>] identifier[getExtendedIdentifierHandlerFor] operator[SEP] identifier[Element] identifier[element] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[checkExtendedIdentityElement] operator[SEP] identifier[element] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[String] identifier[name] operator[=] identifier[element] operator[SEP] identifier[getAttribute] operator[SEP] identifier[IfmapStrings] operator[SEP] identifier[IDENTITY_ATTR_NAME] operator[SEP] operator[SEP] identifier[Document] identifier[extendedDocument] operator[SEP] Keyword[try] { identifier[extendedDocument] operator[=] identifier[DomHelpers] operator[SEP] identifier[parseEscapedXmlString] operator[SEP] identifier[name] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnmarshalException] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[Element] identifier[extendedElement] operator[=] identifier[extendedDocument] operator[SEP] identifier[getDocumentElement] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[nodeName] operator[=] identifier[extendedElement] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Identifier] operator[>] , identifier[IdentifierHandler] operator[<] operator[?] Keyword[extends] identifier[Identifier] operator[>] operator[>] identifier[entry] operator[:] identifier[sIdentifierHandlers] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[simpleClassName] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[simpleClassName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[nodeName] operator[SEP] operator[SEP] { Keyword[return] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public boolean validateAccount(String token) throws DAOException { Query q = new QueryBuilder().select().from(Credentials.class).where("validation", OPERAND.EQ, token).build(); TransientObject to = ObjectUtils.get1stOrNull(dao.query(q)); if (to != null) { ServerCredentials creds = new ServerCredentials(to); creds.setValidation("1"); dao.save(creds); return true; } else { return false; } }
class class_name[name] begin[{] method[validateAccount, return_type[type[boolean]], modifier[public], parameter[token]] begin[{] local_variable[type[Query], q] local_variable[type[TransientObject], to] if[binary_operation[member[.to], !=, literal[null]]] begin[{] local_variable[type[ServerCredentials], creds] call[creds.setValidation, parameter[literal["1"]]] call[dao.save, parameter[member[.creds]]] return[literal[true]] else begin[{] return[literal[false]] end[}] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[validateAccount] operator[SEP] identifier[String] identifier[token] operator[SEP] Keyword[throws] identifier[DAOException] { identifier[Query] identifier[q] operator[=] Keyword[new] identifier[QueryBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[select] operator[SEP] operator[SEP] operator[SEP] identifier[from] operator[SEP] identifier[Credentials] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[where] operator[SEP] literal[String] , identifier[OPERAND] operator[SEP] identifier[EQ] , identifier[token] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[TransientObject] identifier[to] operator[=] identifier[ObjectUtils] operator[SEP] identifier[get1stOrNull] operator[SEP] identifier[dao] operator[SEP] identifier[query] operator[SEP] identifier[q] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[to] operator[!=] Other[null] operator[SEP] { identifier[ServerCredentials] identifier[creds] operator[=] Keyword[new] identifier[ServerCredentials] operator[SEP] identifier[to] operator[SEP] operator[SEP] identifier[creds] operator[SEP] identifier[setValidation] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[dao] operator[SEP] identifier[save] operator[SEP] identifier[creds] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } }
public void free() { if (m_sessionObjectParent != null) ((BaseSession)m_sessionObjectParent).removeSessionObject(this); // Have my parent remove me from their list. // Remove all the session objects that I am responsible for if (m_vSessionObjectList != null) { while (m_vSessionObjectList.size() > 0) { BaseSession sessionObject = (BaseSession)m_vSessionObjectList.elementAt(0); sessionObject.free(); // They will automatically call me.removeSessionObject(them); } m_vSessionObjectList.removeAllElements(); m_vSessionObjectList = null; } super.free(); }
class class_name[name] begin[{] method[free, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[member[.m_sessionObjectParent], !=, literal[null]]] begin[{] Cast(expression=MemberReference(member=m_sessionObjectParent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BaseSession, sub_type=None)) else begin[{] None end[}] if[binary_operation[member[.m_vSessionObjectList], !=, literal[null]]] begin[{] while[binary_operation[call[m_vSessionObjectList.size, parameter[]], >, literal[0]]] begin[{] local_variable[type[BaseSession], sessionObject] call[sessionObject.free, parameter[]] end[}] call[m_vSessionObjectList.removeAllElements, parameter[]] assign[member[.m_vSessionObjectList], literal[null]] else begin[{] None end[}] SuperMethodInvocation(arguments=[], member=free, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[free] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[m_sessionObjectParent] operator[!=] Other[null] operator[SEP] operator[SEP] operator[SEP] identifier[BaseSession] operator[SEP] identifier[m_sessionObjectParent] operator[SEP] operator[SEP] identifier[removeSessionObject] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_vSessionObjectList] operator[!=] Other[null] operator[SEP] { Keyword[while] operator[SEP] identifier[m_vSessionObjectList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[BaseSession] identifier[sessionObject] operator[=] operator[SEP] identifier[BaseSession] operator[SEP] identifier[m_vSessionObjectList] operator[SEP] identifier[elementAt] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[sessionObject] operator[SEP] identifier[free] operator[SEP] operator[SEP] operator[SEP] } identifier[m_vSessionObjectList] operator[SEP] identifier[removeAllElements] operator[SEP] operator[SEP] operator[SEP] identifier[m_vSessionObjectList] operator[=] Other[null] operator[SEP] } Keyword[super] operator[SEP] identifier[free] operator[SEP] operator[SEP] operator[SEP] }
public static boolean isNumberOrArrayOfNumber(ClassNode targetType, boolean recurse) { if (targetType == null) return false; return targetType.isDerivedFrom(ClassHelper.Number_TYPE) || (targetType.isArray() && recurse ? isNumberOrArrayOfNumber(targetType.getComponentType(), recurse) : targetType.isArray() && targetType.getComponentType().isDerivedFrom(ClassHelper.Number_TYPE)); }
class class_name[name] begin[{] method[isNumberOrArrayOfNumber, return_type[type[boolean]], modifier[public static], parameter[targetType, recurse]] begin[{] if[binary_operation[member[.targetType], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] return[binary_operation[call[targetType.isDerivedFrom, parameter[member[ClassHelper.Number_TYPE]]], ||, TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isArray, postfix_operators=[], prefix_operators=[], qualifier=targetType, selectors=[], type_arguments=None), operandr=MemberReference(member=recurse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), if_false=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isArray, postfix_operators=[], prefix_operators=[], qualifier=targetType, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getComponentType, postfix_operators=[], prefix_operators=[], qualifier=targetType, selectors=[MethodInvocation(arguments=[MemberReference(member=Number_TYPE, postfix_operators=[], prefix_operators=[], qualifier=ClassHelper, selectors=[])], member=isDerivedFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getComponentType, postfix_operators=[], prefix_operators=[], qualifier=targetType, selectors=[], type_arguments=None), MemberReference(member=recurse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNumberOrArrayOfNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isNumberOrArrayOfNumber] operator[SEP] identifier[ClassNode] identifier[targetType] , Keyword[boolean] identifier[recurse] operator[SEP] { Keyword[if] operator[SEP] identifier[targetType] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[return] identifier[targetType] operator[SEP] identifier[isDerivedFrom] operator[SEP] identifier[ClassHelper] operator[SEP] identifier[Number_TYPE] operator[SEP] operator[||] operator[SEP] identifier[targetType] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[&&] identifier[recurse] operator[?] identifier[isNumberOrArrayOfNumber] operator[SEP] identifier[targetType] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] , identifier[recurse] operator[SEP] operator[:] identifier[targetType] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[&&] identifier[targetType] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] operator[SEP] identifier[isDerivedFrom] operator[SEP] identifier[ClassHelper] operator[SEP] identifier[Number_TYPE] operator[SEP] operator[SEP] operator[SEP] }
@SuppressWarnings({"unchecked"}) public static <U,T extends U> Iterator<T> subType(Iterator<U> itr, final Class<T> type) { return (Iterator)new FilterIterator<U>(itr) { protected boolean filter(U u) { return type.isInstance(u); } }; }
class class_name[name] begin[{] method[subType, return_type[type[Iterator]], modifier[public static], parameter[itr, type]] begin[{] return[Cast(expression=ClassCreator(arguments=[MemberReference(member=itr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isInstance, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'protected'}, name=filter, parameters=[FormalParameter(annotations=[], modifiers=set(), name=u, type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), 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=U, sub_type=None))], dimensions=None, name=FilterIterator, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] } operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[U] , identifier[T] Keyword[extends] identifier[U] operator[>] identifier[Iterator] operator[<] identifier[T] operator[>] identifier[subType] operator[SEP] identifier[Iterator] operator[<] identifier[U] operator[>] identifier[itr] , Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] { Keyword[return] operator[SEP] identifier[Iterator] operator[SEP] Keyword[new] identifier[FilterIterator] operator[<] identifier[U] operator[>] operator[SEP] identifier[itr] operator[SEP] { Keyword[protected] Keyword[boolean] identifier[filter] operator[SEP] identifier[U] identifier[u] operator[SEP] { Keyword[return] identifier[type] operator[SEP] identifier[isInstance] operator[SEP] identifier[u] operator[SEP] operator[SEP] } } operator[SEP] }
public Observable<RegexEntityExtractor> getRegexEntityEntityInfoAsync(UUID appId, String versionId, UUID regexEntityId) { return getRegexEntityEntityInfoWithServiceResponseAsync(appId, versionId, regexEntityId).map(new Func1<ServiceResponse<RegexEntityExtractor>, RegexEntityExtractor>() { @Override public RegexEntityExtractor call(ServiceResponse<RegexEntityExtractor> response) { return response.body(); } }); }
class class_name[name] begin[{] method[getRegexEntityEntityInfoAsync, return_type[type[Observable]], modifier[public], parameter[appId, versionId, regexEntityId]] begin[{] return[call[.getRegexEntityEntityInfoWithServiceResponseAsync, parameter[member[.appId], member[.versionId], member[.regexEntityId]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[RegexEntityExtractor] operator[>] identifier[getRegexEntityEntityInfoAsync] operator[SEP] identifier[UUID] identifier[appId] , identifier[String] identifier[versionId] , identifier[UUID] identifier[regexEntityId] operator[SEP] { Keyword[return] identifier[getRegexEntityEntityInfoWithServiceResponseAsync] operator[SEP] identifier[appId] , identifier[versionId] , identifier[regexEntityId] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[RegexEntityExtractor] operator[>] , identifier[RegexEntityExtractor] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[RegexEntityExtractor] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[RegexEntityExtractor] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public Observable<ServiceResponse<ImportExportResponseInner>> beginImportMethodWithServiceResponseAsync(String resourceGroupName, String serverName, ImportRequest parameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); return service.beginImportMethod(this.client.subscriptionId(), resourceGroupName, serverName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ImportExportResponseInner>>>() { @Override public Observable<ServiceResponse<ImportExportResponseInner>> call(Response<ResponseBody> response) { try { ServiceResponse<ImportExportResponseInner> clientResponse = beginImportMethodDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[beginImportMethodWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, serverName, parameters]] begin[{] if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot 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[.resourceGroupName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot 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[.serverName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter serverName is required and cannot 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[THIS[member[None.client]call[None.apiVersion, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiVersion() is required and cannot 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[.parameters], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter parameters is required and cannot 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[}] call[Validator.validate, parameter[member[.parameters]]] return[call[service.beginImportMethod, parameter[THIS[member[None.client]call[None.subscriptionId, parameter[]]], member[.resourceGroupName], member[.serverName], THIS[member[None.client]call[None.apiVersion, parameter[]]], member[.parameters], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[ImportExportResponseInner] operator[>] operator[>] identifier[beginImportMethodWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[serverName] , identifier[ImportRequest] identifier[parameters] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[serverName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[parameters] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[parameters] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[beginImportMethod] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , identifier[resourceGroupName] , identifier[serverName] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] , identifier[parameters] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[ImportExportResponseInner] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[ImportExportResponseInner] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponse] operator[<] identifier[ImportExportResponseInner] operator[>] identifier[clientResponse] operator[=] identifier[beginImportMethodDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
public static DMatrixRMaj copyTriangle(DMatrixRMaj src , DMatrixRMaj dst , boolean upper ) { if( dst == null ) { dst = new DMatrixRMaj(src.numRows,src.numCols); } else if( src.numRows != dst.numRows || src.numCols != dst.numCols ) { throw new IllegalArgumentException("src and dst must have the same dimensions."); } if( upper ) { int N = Math.min(src.numRows,src.numCols); for( int i = 0; i < N; i++ ) { int index = i*src.numCols+i; System.arraycopy(src.data,index,dst.data,index,src.numCols-i); } } else { for( int i = 0; i < src.numRows; i++ ) { int length = Math.min(i+1,src.numCols); int index = i*src.numCols; System.arraycopy(src.data,index,dst.data,index,length); } } return dst; }
class class_name[name] begin[{] method[copyTriangle, return_type[type[DMatrixRMaj]], modifier[public static], parameter[src, dst, upper]] begin[{] if[binary_operation[member[.dst], ==, literal[null]]] begin[{] assign[member[.dst], ClassCreator(arguments=[MemberReference(member=numRows, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[]), MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DMatrixRMaj, sub_type=None))] else begin[{] if[binary_operation[binary_operation[member[src.numRows], !=, member[dst.numRows]], ||, binary_operation[member[src.numCols], !=, member[dst.numCols]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="src and dst must have the same dimensions.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] end[}] if[member[.upper]] begin[{] local_variable[type[int], N] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[]), operator=*), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[]), MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=dst, selectors=[]), MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=N, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[])], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=length)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numCols, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[]), operator=*), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[]), MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=dst, selectors=[]), MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numRows, postfix_operators=[], prefix_operators=[], qualifier=src, 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[}] return[member[.dst]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DMatrixRMaj] identifier[copyTriangle] operator[SEP] identifier[DMatrixRMaj] identifier[src] , identifier[DMatrixRMaj] identifier[dst] , Keyword[boolean] identifier[upper] operator[SEP] { Keyword[if] operator[SEP] identifier[dst] operator[==] Other[null] operator[SEP] { identifier[dst] operator[=] Keyword[new] identifier[DMatrixRMaj] operator[SEP] identifier[src] operator[SEP] identifier[numRows] , identifier[src] operator[SEP] identifier[numCols] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[src] operator[SEP] identifier[numRows] operator[!=] identifier[dst] operator[SEP] identifier[numRows] operator[||] identifier[src] operator[SEP] identifier[numCols] operator[!=] identifier[dst] operator[SEP] identifier[numCols] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[upper] operator[SEP] { Keyword[int] identifier[N] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[src] operator[SEP] identifier[numRows] , identifier[src] operator[SEP] identifier[numCols] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[N] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[index] operator[=] identifier[i] operator[*] identifier[src] operator[SEP] identifier[numCols] operator[+] identifier[i] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[src] operator[SEP] identifier[data] , identifier[index] , identifier[dst] operator[SEP] identifier[data] , identifier[index] , identifier[src] operator[SEP] identifier[numCols] operator[-] identifier[i] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[src] operator[SEP] identifier[numRows] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[length] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[i] operator[+] Other[1] , identifier[src] operator[SEP] identifier[numCols] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[i] operator[*] identifier[src] operator[SEP] identifier[numCols] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[src] operator[SEP] identifier[data] , identifier[index] , identifier[dst] operator[SEP] identifier[data] , identifier[index] , identifier[length] operator[SEP] operator[SEP] } } Keyword[return] identifier[dst] operator[SEP] }