code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public final void setResolution(final int width, final int height) { Condition.INSTANCE.ensureAtLeast(width, 1, "The width must be at least 1"); Condition.INSTANCE.ensureAtLeast(height, 1, "The height must be at least 1"); this.width = width; this.height = height; persistString(formatResolution(getContext(), width, height)); notifyChanged(); }
class class_name[name] begin[{] method[setResolution, return_type[void], modifier[final public], parameter[width, height]] begin[{] call[Condition.INSTANCE.ensureAtLeast, parameter[member[.width], literal[1], literal["The width must be at least 1"]]] call[Condition.INSTANCE.ensureAtLeast, parameter[member[.height], literal[1], literal["The height must be at least 1"]]] assign[THIS[member[None.width]], member[.width]] assign[THIS[member[None.height]], member[.height]] call[.persistString, parameter[call[.formatResolution, parameter[call[.getContext, parameter[]], member[.width], member[.height]]]]] call[.notifyChanged, parameter[]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[setResolution] operator[SEP] Keyword[final] Keyword[int] identifier[width] , Keyword[final] Keyword[int] identifier[height] operator[SEP] { identifier[Condition] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[ensureAtLeast] operator[SEP] identifier[width] , Other[1] , literal[String] operator[SEP] operator[SEP] identifier[Condition] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[ensureAtLeast] operator[SEP] identifier[height] , Other[1] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[width] operator[=] identifier[width] operator[SEP] Keyword[this] operator[SEP] identifier[height] operator[=] identifier[height] operator[SEP] identifier[persistString] operator[SEP] identifier[formatResolution] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] , identifier[width] , identifier[height] operator[SEP] operator[SEP] operator[SEP] identifier[notifyChanged] operator[SEP] operator[SEP] operator[SEP] }
protected static BeanBox wrapParamToBox(Object param) { if (param != null) { if (param instanceof Class) return new BeanBox().setTarget(param); if (param instanceof BeanBox) return (BeanBox) param; } return new BeanBox().setAsValue(param); }
class class_name[name] begin[{] method[wrapParamToBox, return_type[type[BeanBox]], modifier[static protected], parameter[param]] begin[{] if[binary_operation[member[.param], !=, literal[null]]] begin[{] if[binary_operation[member[.param], instanceof, type[Class]]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=param, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTarget, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BeanBox, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.param], instanceof, type[BeanBox]]] begin[{] return[Cast(expression=MemberReference(member=param, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BeanBox, sub_type=None))] else begin[{] None end[}] else begin[{] None end[}] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=param, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAsValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BeanBox, sub_type=None))] end[}] END[}]
Keyword[protected] Keyword[static] identifier[BeanBox] identifier[wrapParamToBox] operator[SEP] identifier[Object] identifier[param] operator[SEP] { Keyword[if] operator[SEP] identifier[param] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[param] Keyword[instanceof] identifier[Class] operator[SEP] Keyword[return] Keyword[new] identifier[BeanBox] operator[SEP] operator[SEP] operator[SEP] identifier[setTarget] operator[SEP] identifier[param] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[param] Keyword[instanceof] identifier[BeanBox] operator[SEP] Keyword[return] operator[SEP] identifier[BeanBox] operator[SEP] identifier[param] operator[SEP] } Keyword[return] Keyword[new] identifier[BeanBox] operator[SEP] operator[SEP] operator[SEP] identifier[setAsValue] operator[SEP] identifier[param] operator[SEP] operator[SEP] }
public String getToken() { String id = null == answer ? text : answer; return Act.app().crypto().generateToken(id); }
class class_name[name] begin[{] method[getToken, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], id] return[call[Act.app, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getToken] operator[SEP] operator[SEP] { identifier[String] identifier[id] operator[=] Other[null] operator[==] identifier[answer] operator[?] identifier[text] operator[:] identifier[answer] operator[SEP] Keyword[return] identifier[Act] operator[SEP] identifier[app] operator[SEP] operator[SEP] operator[SEP] identifier[crypto] operator[SEP] operator[SEP] operator[SEP] identifier[generateToken] operator[SEP] identifier[id] operator[SEP] operator[SEP] }
public Object execute() { String methodName = targetMethodName(); Class returnType = returnType(); Object next = pathref.continueWith(this, methodName, returnType); return ProxyTarget.returnValue(next); }
class class_name[name] begin[{] method[execute, return_type[type[Object]], modifier[public], parameter[]] begin[{] local_variable[type[String], methodName] local_variable[type[Class], returnType] local_variable[type[Object], next] return[call[ProxyTarget.returnValue, parameter[member[.next]]]] end[}] END[}]
Keyword[public] identifier[Object] identifier[execute] operator[SEP] operator[SEP] { identifier[String] identifier[methodName] operator[=] identifier[targetMethodName] operator[SEP] operator[SEP] operator[SEP] identifier[Class] identifier[returnType] operator[=] identifier[returnType] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[next] operator[=] identifier[pathref] operator[SEP] identifier[continueWith] operator[SEP] Keyword[this] , identifier[methodName] , identifier[returnType] operator[SEP] operator[SEP] Keyword[return] identifier[ProxyTarget] operator[SEP] identifier[returnValue] operator[SEP] identifier[next] operator[SEP] operator[SEP] }
@XmlElementDecl(namespace = "http://www.ibm.com/websphere/wim", name = "pager") public JAXBElement<String> createPager(String value) { return new JAXBElement<String>(_Pager_QNAME, String.class, null, value); }
class class_name[name] begin[{] method[createPager, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_Pager_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[String] operator[>] identifier[createPager] operator[SEP] identifier[String] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[String] operator[>] operator[SEP] identifier[_Pager_QNAME] , identifier[String] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
public static Scope from(CompositeData cd) { IScope parent = null; ScopeType type = ScopeType.UNDEFINED; String name = null; boolean persistent = false; if (cd.containsKey("parent")) { parent = (IScope) cd.get("parent"); } if (cd.containsKey("type")) { type = (ScopeType) cd.get("type"); } if (cd.containsKey("name")) { name = (String) cd.get("name"); } if (cd.containsKey("persistent")) { persistent = (Boolean) cd.get("persistent"); } return new Scope(new Builder(parent, type, name, persistent)); }
class class_name[name] begin[{] method[from, return_type[type[Scope]], modifier[public static], parameter[cd]] begin[{] local_variable[type[IScope], parent] local_variable[type[ScopeType], type] local_variable[type[String], name] local_variable[type[boolean], persistent] if[call[cd.containsKey, parameter[literal["parent"]]]] begin[{] assign[member[.parent], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="parent")], member=get, postfix_operators=[], prefix_operators=[], qualifier=cd, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=IScope, sub_type=None))] else begin[{] None end[}] if[call[cd.containsKey, parameter[literal["type"]]]] begin[{] assign[member[.type], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="type")], member=get, postfix_operators=[], prefix_operators=[], qualifier=cd, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ScopeType, sub_type=None))] else begin[{] None end[}] if[call[cd.containsKey, parameter[literal["name"]]]] begin[{] assign[member[.name], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name")], member=get, postfix_operators=[], prefix_operators=[], qualifier=cd, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))] else begin[{] None end[}] if[call[cd.containsKey, parameter[literal["persistent"]]]] begin[{] assign[member[.persistent], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="persistent")], member=get, postfix_operators=[], prefix_operators=[], qualifier=cd, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))] else begin[{] None end[}] return[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=persistent, 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=Builder, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Scope, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Scope] identifier[from] operator[SEP] identifier[CompositeData] identifier[cd] operator[SEP] { identifier[IScope] identifier[parent] operator[=] Other[null] operator[SEP] identifier[ScopeType] identifier[type] operator[=] identifier[ScopeType] operator[SEP] identifier[UNDEFINED] operator[SEP] identifier[String] identifier[name] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[persistent] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[cd] operator[SEP] identifier[containsKey] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[parent] operator[=] operator[SEP] identifier[IScope] operator[SEP] identifier[cd] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[cd] operator[SEP] identifier[containsKey] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[type] operator[=] operator[SEP] identifier[ScopeType] operator[SEP] identifier[cd] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[cd] operator[SEP] identifier[containsKey] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[name] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[cd] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[cd] operator[SEP] identifier[containsKey] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[persistent] operator[=] operator[SEP] identifier[Boolean] operator[SEP] identifier[cd] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[Scope] operator[SEP] Keyword[new] identifier[Builder] operator[SEP] identifier[parent] , identifier[type] , identifier[name] , identifier[persistent] operator[SEP] operator[SEP] operator[SEP] }
public void remove(final DBObject query) { if (query == null) { throw new IllegalArgumentException("query can not be null"); } for (final GridFSDBFile f : find(query)) { f.remove(); } }
class class_name[name] begin[{] method[remove, return_type[void], modifier[public], parameter[query]] begin[{] if[binary_operation[member[.query], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="query can 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[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=find, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=f)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=GridFSDBFile, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[remove] operator[SEP] Keyword[final] identifier[DBObject] identifier[query] operator[SEP] { Keyword[if] operator[SEP] identifier[query] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[final] identifier[GridFSDBFile] identifier[f] operator[:] identifier[find] operator[SEP] identifier[query] operator[SEP] operator[SEP] { identifier[f] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] } }
private Set<Class<? extends Annotation>> getSupportedAnnotations() { Set<Class<? extends Annotation>> annotations = new LinkedHashSet<>(); annotations.add(Remoter.class); return annotations; }
class class_name[name] begin[{] method[getSupportedAnnotations, return_type[type[Set]], modifier[private], parameter[]] begin[{] local_variable[type[Set], annotations] call[annotations.add, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Remoter, sub_type=None))]] return[member[.annotations]] end[}] END[}]
Keyword[private] identifier[Set] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] operator[>] identifier[getSupportedAnnotations] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] operator[>] identifier[annotations] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[annotations] operator[SEP] identifier[add] operator[SEP] identifier[Remoter] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[annotations] operator[SEP] }
public void start() { Preconditions.checkState(Thread.currentThread().equals(ourThread), "Not in the correct thread"); client.addParentWatcher(watcher); }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[]] begin[{] call[Preconditions.checkState, parameter[call[Thread.currentThread, parameter[]], literal["Not in the correct thread"]]] call[client.addParentWatcher, parameter[member[.watcher]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[start] operator[SEP] operator[SEP] { identifier[Preconditions] operator[SEP] identifier[checkState] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[ourThread] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[addParentWatcher] operator[SEP] identifier[watcher] operator[SEP] operator[SEP] }
void build() { _ranks = new int[_units.size()]; _numOnes = 0; for (int i = 0; i < _units.size(); ++i) { _ranks[i] = _numOnes; _numOnes += popCount(_units.get(i)); } }
class class_name[name] begin[{] method[build, return_type[void], modifier[default], parameter[]] begin[{] assign[member[._ranks], ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=_units, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))] assign[member[._numOnes], literal[0]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_ranks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=_numOnes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_numOnes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=_units, selectors=[], type_arguments=None)], member=popCount, 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=size, postfix_operators=[], prefix_operators=[], qualifier=_units, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[void] identifier[build] operator[SEP] operator[SEP] { identifier[_ranks] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[_units] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[_numOnes] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[_units] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[_ranks] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[_numOnes] operator[SEP] identifier[_numOnes] operator[+=] identifier[popCount] operator[SEP] identifier[_units] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } }
public void save(String modelFile, final double ratio) throws IOException { save(modelFile, featureMap.entrySet(), ratio); }
class class_name[name] begin[{] method[save, return_type[void], modifier[public], parameter[modelFile, ratio]] begin[{] call[.save, parameter[member[.modelFile], call[featureMap.entrySet, parameter[]], member[.ratio]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[save] operator[SEP] identifier[String] identifier[modelFile] , Keyword[final] Keyword[double] identifier[ratio] operator[SEP] Keyword[throws] identifier[IOException] { identifier[save] operator[SEP] identifier[modelFile] , identifier[featureMap] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] , identifier[ratio] operator[SEP] operator[SEP] }
public List<M> fetch(String... columns) { if (null == columns) { return this.fetch(); } //from db if (!this.syncToRedis) { return this.find(SqlpKit.select(this, columns)); } //from redis return this.fetchDatasFromRedis(columns); }
class class_name[name] begin[{] method[fetch, return_type[type[List]], modifier[public], parameter[columns]] begin[{] if[binary_operation[literal[null], ==, member[.columns]]] begin[{] return[THIS[call[None.fetch, parameter[]]]] else begin[{] None end[}] if[THIS[member[None.syncToRedis]]] begin[{] return[THIS[call[None.find, parameter[call[SqlpKit.select, parameter[THIS[], member[.columns]]]]]]] else begin[{] None end[}] return[THIS[call[None.fetchDatasFromRedis, parameter[member[.columns]]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[M] operator[>] identifier[fetch] operator[SEP] identifier[String] operator[...] identifier[columns] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[columns] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[fetch] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[syncToRedis] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[find] operator[SEP] identifier[SqlpKit] operator[SEP] identifier[select] operator[SEP] Keyword[this] , identifier[columns] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] identifier[fetchDatasFromRedis] operator[SEP] identifier[columns] operator[SEP] operator[SEP] }
public void start(JChannel ch) throws Exception { channel=ch; channel.setReceiver(this); channel.connect("ChatCluster"); eventLoop(); channel.close(); }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[ch]] begin[{] assign[member[.channel], member[.ch]] call[channel.setReceiver, parameter[THIS[]]] call[channel.connect, parameter[literal["ChatCluster"]]] call[.eventLoop, parameter[]] call[channel.close, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[start] operator[SEP] identifier[JChannel] identifier[ch] operator[SEP] Keyword[throws] identifier[Exception] { identifier[channel] operator[=] identifier[ch] operator[SEP] identifier[channel] operator[SEP] identifier[setReceiver] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[channel] operator[SEP] identifier[connect] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[eventLoop] operator[SEP] operator[SEP] operator[SEP] identifier[channel] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] }
public static String snakeCaseToCamelCase(String snakeCase) { if(snakeCase.contains("-")) { StringBuilder camelCaseStr = new StringBuilder(snakeCase.length()); boolean toUpperCase = false; for (char c : snakeCase.toCharArray()) { if (c == '-') toUpperCase = true; else { if (toUpperCase) { toUpperCase = false; c = Character.toUpperCase(c); } camelCaseStr.append(c); } } snakeCase = camelCaseStr.toString(); } return snakeCase; }
class class_name[name] begin[{] method[snakeCaseToCamelCase, return_type[type[String]], modifier[public static], parameter[snakeCase]] begin[{] if[call[snakeCase.contains, parameter[literal["-"]]]] begin[{] local_variable[type[StringBuilder], camelCaseStr] local_variable[type[boolean], toUpperCase] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-'), operator===), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=camelCaseStr, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=toCharArray, postfix_operators=[], prefix_operators=[], qualifier=snakeCase, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char))), label=None) assign[member[.snakeCase], call[camelCaseStr.toString, parameter[]]] else begin[{] None end[}] return[member[.snakeCase]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[snakeCaseToCamelCase] operator[SEP] identifier[String] identifier[snakeCase] operator[SEP] { Keyword[if] operator[SEP] identifier[snakeCase] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[StringBuilder] identifier[camelCaseStr] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[snakeCase] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[toUpperCase] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[char] identifier[c] operator[:] identifier[snakeCase] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] identifier[toUpperCase] operator[=] literal[boolean] operator[SEP] Keyword[else] { Keyword[if] operator[SEP] identifier[toUpperCase] operator[SEP] { identifier[toUpperCase] operator[=] literal[boolean] operator[SEP] identifier[c] operator[=] identifier[Character] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[c] operator[SEP] operator[SEP] } identifier[camelCaseStr] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } } identifier[snakeCase] operator[=] identifier[camelCaseStr] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[snakeCase] operator[SEP] }
protected boolean rollback() { if (currentOut != null) { currentOut.rollback(); currentOut = null; moreOut = false; } return true; }
class class_name[name] begin[{] method[rollback, return_type[type[boolean]], modifier[protected], parameter[]] begin[{] if[binary_operation[member[.currentOut], !=, literal[null]]] begin[{] call[currentOut.rollback, parameter[]] assign[member[.currentOut], literal[null]] assign[member[.moreOut], literal[false]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[rollback] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[currentOut] operator[!=] Other[null] operator[SEP] { identifier[currentOut] operator[SEP] identifier[rollback] operator[SEP] operator[SEP] operator[SEP] identifier[currentOut] operator[=] Other[null] operator[SEP] identifier[moreOut] operator[=] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static void setRequestAttribute (@Nonnull final ServletRequest aRequest, @Nonnull final String sAttrName, @Nullable final Object aAttrValue) { try { aRequest.setAttribute (sAttrName, aAttrValue); } catch (final Exception ex) { // Happens in certain Tomcat versions (e.g. 7.0.42 with JDK 8): if (isLogExceptions ()) if (LOGGER.isWarnEnabled ()) LOGGER.warn ("[ServletHelper] Failed to set attribute '" + sAttrName + "' in HTTP request", ex); } }
class class_name[name] begin[{] method[setRequestAttribute, return_type[void], modifier[public static], parameter[aRequest, sAttrName, aAttrValue]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sAttrName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aAttrValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=aRequest, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isLogExceptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=IfStatement(condition=MethodInvocation(arguments=[], member=isWarnEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[ServletHelper] Failed to set attribute '"), operandr=MemberReference(member=sAttrName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' in HTTP request"), operator=+), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setRequestAttribute] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[ServletRequest] identifier[aRequest] , annotation[@] identifier[Nonnull] Keyword[final] identifier[String] identifier[sAttrName] , annotation[@] identifier[Nullable] Keyword[final] identifier[Object] identifier[aAttrValue] operator[SEP] { Keyword[try] { identifier[aRequest] operator[SEP] identifier[setAttribute] operator[SEP] identifier[sAttrName] , identifier[aAttrValue] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[ex] operator[SEP] { Keyword[if] operator[SEP] identifier[isLogExceptions] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isWarnEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[sAttrName] operator[+] literal[String] , identifier[ex] operator[SEP] operator[SEP] } }
public ServiceFuture<IotHubNameAvailabilityInfoInner> checkNameAvailabilityAsync(String name, final ServiceCallback<IotHubNameAvailabilityInfoInner> serviceCallback) { return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); }
class class_name[name] begin[{] method[checkNameAvailabilityAsync, return_type[type[ServiceFuture]], modifier[public], parameter[name, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.checkNameAvailabilityWithServiceResponseAsync, parameter[member[.name]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[IotHubNameAvailabilityInfoInner] operator[>] identifier[checkNameAvailabilityAsync] operator[SEP] identifier[String] identifier[name] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[IotHubNameAvailabilityInfoInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[checkNameAvailabilityWithServiceResponseAsync] operator[SEP] identifier[name] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
public static int estimatedSizeOf(Collection<QueryableEntry> result) { if (result instanceof AndResultSet) { return ((AndResultSet) result).estimatedSize(); } else if (result instanceof OrResultSet) { return ((OrResultSet) result).estimatedSize(); } return result.size(); }
class class_name[name] begin[{] method[estimatedSizeOf, return_type[type[int]], modifier[public static], parameter[result]] begin[{] if[binary_operation[member[.result], instanceof, type[AndResultSet]]] begin[{] return[Cast(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AndResultSet, sub_type=None))] else begin[{] if[binary_operation[member[.result], instanceof, type[OrResultSet]]] begin[{] return[Cast(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=OrResultSet, sub_type=None))] else begin[{] None end[}] end[}] return[call[result.size, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[estimatedSizeOf] operator[SEP] identifier[Collection] operator[<] identifier[QueryableEntry] operator[>] identifier[result] operator[SEP] { Keyword[if] operator[SEP] identifier[result] Keyword[instanceof] identifier[AndResultSet] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[AndResultSet] operator[SEP] identifier[result] operator[SEP] operator[SEP] identifier[estimatedSize] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[result] Keyword[instanceof] identifier[OrResultSet] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[OrResultSet] operator[SEP] identifier[result] operator[SEP] operator[SEP] identifier[estimatedSize] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] }
@Deprecated public GeoPoint PixelXYToLatLong( final int pixelX, final int pixelY, final int levelOfDetail, final GeoPoint reuse) { return getGeoFromMercator(pixelX, pixelY, MapSize(levelOfDetail), reuse, true, true); }
class class_name[name] begin[{] method[PixelXYToLatLong, return_type[type[GeoPoint]], modifier[public], parameter[pixelX, pixelY, levelOfDetail, reuse]] begin[{] return[call[.getGeoFromMercator, parameter[member[.pixelX], member[.pixelY], call[.MapSize, parameter[member[.levelOfDetail]]], member[.reuse], literal[true], literal[true]]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] identifier[GeoPoint] identifier[PixelXYToLatLong] operator[SEP] Keyword[final] Keyword[int] identifier[pixelX] , Keyword[final] Keyword[int] identifier[pixelY] , Keyword[final] Keyword[int] identifier[levelOfDetail] , Keyword[final] identifier[GeoPoint] identifier[reuse] operator[SEP] { Keyword[return] identifier[getGeoFromMercator] operator[SEP] identifier[pixelX] , identifier[pixelY] , identifier[MapSize] operator[SEP] identifier[levelOfDetail] operator[SEP] , identifier[reuse] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] }
protected String resolveVariableIfNeeds(String expr, String path, ScriptingExpression expression) { if (expr == null) { return null; } return doResolveShortExistsIfNeeds(doResolvePathExpIfNeeds((String) expr, path, expression), expression); }
class class_name[name] begin[{] method[resolveVariableIfNeeds, return_type[type[String]], modifier[protected], parameter[expr, path, expression]] begin[{] if[binary_operation[member[.expr], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[.doResolveShortExistsIfNeeds, parameter[call[.doResolvePathExpIfNeeds, parameter[Cast(expression=MemberReference(member=expr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), member[.path], member[.expression]]], member[.expression]]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[resolveVariableIfNeeds] operator[SEP] identifier[String] identifier[expr] , identifier[String] identifier[path] , identifier[ScriptingExpression] identifier[expression] operator[SEP] { Keyword[if] operator[SEP] identifier[expr] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[doResolveShortExistsIfNeeds] operator[SEP] identifier[doResolvePathExpIfNeeds] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[expr] , identifier[path] , identifier[expression] operator[SEP] , identifier[expression] operator[SEP] operator[SEP] }
private boolean methodThrowsException(Method method, Class<? extends Exception> exceptionType) { // Check whether the method throws an exception of the specified type for (Class<?> thrownType : method.getExceptionTypes()) { if (exceptionType.isAssignableFrom(thrownType)) return true; } // No such exception is declared to be thrown return false; }
class class_name[name] begin[{] method[methodThrowsException, return_type[type[boolean]], modifier[private], parameter[method, exceptionType]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=thrownType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=[], prefix_operators=[], qualifier=exceptionType, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getExceptionTypes, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=thrownType)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[methodThrowsException] operator[SEP] identifier[Method] identifier[method] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Exception] operator[>] identifier[exceptionType] operator[SEP] { Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[thrownType] operator[:] identifier[method] operator[SEP] identifier[getExceptionTypes] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[exceptionType] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[thrownType] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public String readQuery(CmsUUID projectId, String queryKey) { String key; if ((projectId != null) && !projectId.isNullUUID()) { // id 0 is special, please see below StringBuffer buffer = new StringBuffer(128); buffer.append(queryKey); if (projectId.equals(CmsProject.ONLINE_PROJECT_ID)) { buffer.append("_ONLINE"); } else { buffer.append("_OFFLINE"); } key = buffer.toString(); } else { key = queryKey; } // look up the query in the cache String query = m_cachedQueries.get(key); if (query == null) { // the query has not been cached yet // get the SQL statement from the properties hash query = readQuery(queryKey); if (query == null) { throw new CmsRuntimeException(Messages.get().container(Messages.ERR_QUERY_NOT_FOUND_1, queryKey)); } // replace control chars. query = CmsStringUtil.substitute(query, "\t", " "); query = CmsStringUtil.substitute(query, "\n", " "); if ((projectId != null) && !projectId.isNullUUID()) { // a project ID = 0 is an internal indicator that a project-independent // query was requested - further regex operations are not required then query = CmsSqlManager.replaceProjectPattern(projectId, query); } // to minimize costs, all statements with replaced expressions are cached in a map m_cachedQueries.put(key, query); } return query; }
class class_name[name] begin[{] method[readQuery, return_type[type[String]], modifier[public], parameter[projectId, queryKey]] begin[{] local_variable[type[String], key] if[binary_operation[binary_operation[member[.projectId], !=, literal[null]], &&, call[projectId.isNullUUID, parameter[]]]] begin[{] local_variable[type[StringBuffer], buffer] call[buffer.append, parameter[member[.queryKey]]] if[call[projectId.equals, parameter[member[CmsProject.ONLINE_PROJECT_ID]]]] begin[{] call[buffer.append, parameter[literal["_ONLINE"]]] else begin[{] call[buffer.append, parameter[literal["_OFFLINE"]]] end[}] assign[member[.key], call[buffer.toString, parameter[]]] else begin[{] assign[member[.key], member[.queryKey]] end[}] local_variable[type[String], query] if[binary_operation[member[.query], ==, literal[null]]] begin[{] assign[member[.query], call[.readQuery, parameter[member[.queryKey]]]] if[binary_operation[member[.query], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=ERR_QUERY_NOT_FOUND_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=queryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=container, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsRuntimeException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.query], call[CmsStringUtil.substitute, parameter[member[.query], literal["\t"], literal[" "]]]] assign[member[.query], call[CmsStringUtil.substitute, parameter[member[.query], literal["\n"], literal[" "]]]] if[binary_operation[binary_operation[member[.projectId], !=, literal[null]], &&, call[projectId.isNullUUID, parameter[]]]] begin[{] assign[member[.query], call[CmsSqlManager.replaceProjectPattern, parameter[member[.projectId], member[.query]]]] else begin[{] None end[}] call[m_cachedQueries.put, parameter[member[.key], member[.query]]] else begin[{] None end[}] return[member[.query]] end[}] END[}]
Keyword[public] identifier[String] identifier[readQuery] operator[SEP] identifier[CmsUUID] identifier[projectId] , identifier[String] identifier[queryKey] operator[SEP] { identifier[String] identifier[key] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[projectId] operator[!=] Other[null] operator[SEP] operator[&&] operator[!] identifier[projectId] operator[SEP] identifier[isNullUUID] operator[SEP] operator[SEP] operator[SEP] { identifier[StringBuffer] identifier[buffer] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[128] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[queryKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[projectId] operator[SEP] identifier[equals] operator[SEP] identifier[CmsProject] operator[SEP] identifier[ONLINE_PROJECT_ID] operator[SEP] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[key] operator[=] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[key] operator[=] identifier[queryKey] operator[SEP] } identifier[String] identifier[query] operator[=] identifier[m_cachedQueries] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[query] operator[==] Other[null] operator[SEP] { identifier[query] operator[=] identifier[readQuery] operator[SEP] identifier[queryKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[query] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[CmsRuntimeException] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_QUERY_NOT_FOUND_1] , identifier[queryKey] operator[SEP] operator[SEP] operator[SEP] } identifier[query] operator[=] identifier[CmsStringUtil] operator[SEP] identifier[substitute] operator[SEP] identifier[query] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[query] operator[=] identifier[CmsStringUtil] operator[SEP] identifier[substitute] operator[SEP] identifier[query] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[projectId] operator[!=] Other[null] operator[SEP] operator[&&] operator[!] identifier[projectId] operator[SEP] identifier[isNullUUID] operator[SEP] operator[SEP] operator[SEP] { identifier[query] operator[=] identifier[CmsSqlManager] operator[SEP] identifier[replaceProjectPattern] operator[SEP] identifier[projectId] , identifier[query] operator[SEP] operator[SEP] } identifier[m_cachedQueries] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[query] operator[SEP] operator[SEP] } Keyword[return] identifier[query] operator[SEP] }
@Override public RandomVariable getCovariance(double time, int component1, int component2, RandomVariable[] realizationAtTimeIndex) { int timeIndex = timeDiscretization.getTimeIndex(time); if(timeIndex < 0) { timeIndex = Math.abs(timeIndex)-2; } return getCovariance(timeIndex, component1, component2, realizationAtTimeIndex); }
class class_name[name] begin[{] method[getCovariance, return_type[type[RandomVariable]], modifier[public], parameter[time, component1, component2, realizationAtTimeIndex]] begin[{] local_variable[type[int], timeIndex] if[binary_operation[member[.timeIndex], <, literal[0]]] begin[{] assign[member[.timeIndex], binary_operation[call[Math.abs, parameter[member[.timeIndex]]], -, literal[2]]] else begin[{] None end[}] return[call[.getCovariance, parameter[member[.timeIndex], member[.component1], member[.component2], member[.realizationAtTimeIndex]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[RandomVariable] identifier[getCovariance] operator[SEP] Keyword[double] identifier[time] , Keyword[int] identifier[component1] , Keyword[int] identifier[component2] , identifier[RandomVariable] operator[SEP] operator[SEP] identifier[realizationAtTimeIndex] operator[SEP] { Keyword[int] identifier[timeIndex] operator[=] identifier[timeDiscretization] operator[SEP] identifier[getTimeIndex] operator[SEP] identifier[time] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[timeIndex] operator[<] Other[0] operator[SEP] { identifier[timeIndex] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[timeIndex] operator[SEP] operator[-] Other[2] operator[SEP] } Keyword[return] identifier[getCovariance] operator[SEP] identifier[timeIndex] , identifier[component1] , identifier[component2] , identifier[realizationAtTimeIndex] operator[SEP] operator[SEP] }
public static Integer getDurationValue(ProjectProperties properties, Duration duration) { Integer result; if (duration == null) { result = null; } else { if (duration.getUnits() != TimeUnit.MINUTES) { duration = duration.convertUnits(TimeUnit.MINUTES, properties); } result = Integer.valueOf((int) duration.getDuration()); } return (result); }
class class_name[name] begin[{] method[getDurationValue, return_type[type[Integer]], modifier[public static], parameter[properties, duration]] begin[{] local_variable[type[Integer], result] if[binary_operation[member[.duration], ==, literal[null]]] begin[{] assign[member[.result], literal[null]] else begin[{] if[binary_operation[call[duration.getUnits, parameter[]], !=, member[TimeUnit.MINUTES]]] begin[{] assign[member[.duration], call[duration.convertUnits, parameter[member[TimeUnit.MINUTES], member[.properties]]]] else begin[{] None end[}] assign[member[.result], call[Integer.valueOf, parameter[Cast(expression=MethodInvocation(arguments=[], member=getDuration, postfix_operators=[], prefix_operators=[], qualifier=duration, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))]]] end[}] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Integer] identifier[getDurationValue] operator[SEP] identifier[ProjectProperties] identifier[properties] , identifier[Duration] identifier[duration] operator[SEP] { identifier[Integer] identifier[result] operator[SEP] Keyword[if] operator[SEP] identifier[duration] operator[==] Other[null] operator[SEP] { identifier[result] operator[=] Other[null] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[duration] operator[SEP] identifier[getUnits] operator[SEP] operator[SEP] operator[!=] identifier[TimeUnit] operator[SEP] identifier[MINUTES] operator[SEP] { identifier[duration] operator[=] identifier[duration] operator[SEP] identifier[convertUnits] operator[SEP] identifier[TimeUnit] operator[SEP] identifier[MINUTES] , identifier[properties] operator[SEP] operator[SEP] } identifier[result] operator[=] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[duration] operator[SEP] identifier[getDuration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[result] operator[SEP] operator[SEP] }
public static synchronized void websocket(String url, AbstractReceiveListener endpoint) { checkStarted(); instance().endpoints.add(HandlerUtil.websocket(url, endpoint)); }
class class_name[name] begin[{] method[websocket, return_type[void], modifier[synchronized public static], parameter[url, endpoint]] begin[{] call[.checkStarted, parameter[]] call[.instance, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[synchronized] Keyword[void] identifier[websocket] operator[SEP] identifier[String] identifier[url] , identifier[AbstractReceiveListener] identifier[endpoint] operator[SEP] { identifier[checkStarted] operator[SEP] operator[SEP] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[endpoints] operator[SEP] identifier[add] operator[SEP] identifier[HandlerUtil] operator[SEP] identifier[websocket] operator[SEP] identifier[url] , identifier[endpoint] operator[SEP] operator[SEP] operator[SEP] }
private void handleChannelCategory(JsonNode jsonChannel) { long channelCategoryId = jsonChannel.get("id").asLong(); api.getChannelCategoryById(channelCategoryId).map(ChannelCategoryImpl.class::cast).ifPresent(channel -> { boolean oldNsfwFlag = channel.isNsfw(); boolean newNsfwFlag = jsonChannel.get("nsfw").asBoolean(); if (oldNsfwFlag != newNsfwFlag) { channel.setNsfwFlag(newNsfwFlag); ServerChannelChangeNsfwFlagEvent event = new ServerChannelChangeNsfwFlagEventImpl(channel, newNsfwFlag, oldNsfwFlag); api.getEventDispatcher().dispatchServerChannelChangeNsfwFlagEvent( (DispatchQueueSelector) channel.getServer(), channel, channel.getServer(), null, event); } }); }
class class_name[name] begin[{] method[handleChannelCategory, return_type[void], modifier[private], parameter[jsonChannel]] begin[{] local_variable[type[long], channelCategoryId] call[api.getChannelCategoryById, parameter[member[.channelCategoryId]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[handleChannelCategory] operator[SEP] identifier[JsonNode] identifier[jsonChannel] operator[SEP] { Keyword[long] identifier[channelCategoryId] operator[=] identifier[jsonChannel] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[asLong] operator[SEP] operator[SEP] operator[SEP] identifier[api] operator[SEP] identifier[getChannelCategoryById] operator[SEP] identifier[channelCategoryId] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[ChannelCategoryImpl] operator[SEP] Keyword[class] operator[::] identifier[cast] operator[SEP] operator[SEP] identifier[ifPresent] operator[SEP] identifier[channel] operator[->] { Keyword[boolean] identifier[oldNsfwFlag] operator[=] identifier[channel] operator[SEP] identifier[isNsfw] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[newNsfwFlag] operator[=] identifier[jsonChannel] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[asBoolean] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldNsfwFlag] operator[!=] identifier[newNsfwFlag] operator[SEP] { identifier[channel] operator[SEP] identifier[setNsfwFlag] operator[SEP] identifier[newNsfwFlag] operator[SEP] operator[SEP] identifier[ServerChannelChangeNsfwFlagEvent] identifier[event] operator[=] Keyword[new] identifier[ServerChannelChangeNsfwFlagEventImpl] operator[SEP] identifier[channel] , identifier[newNsfwFlag] , identifier[oldNsfwFlag] operator[SEP] operator[SEP] identifier[api] operator[SEP] identifier[getEventDispatcher] operator[SEP] operator[SEP] operator[SEP] identifier[dispatchServerChannelChangeNsfwFlagEvent] operator[SEP] operator[SEP] identifier[DispatchQueueSelector] operator[SEP] identifier[channel] operator[SEP] identifier[getServer] operator[SEP] operator[SEP] , identifier[channel] , identifier[channel] operator[SEP] identifier[getServer] operator[SEP] operator[SEP] , Other[null] , identifier[event] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
private int getByte(int position) { if (position + 1 >= length) { throw new IllegalStateException("Malformed DN: " + dn); } int b1, b2; b1 = chars[position]; if (b1 >= '0' && b1 <= '9') { b1 = b1 - '0'; } else if (b1 >= 'a' && b1 <= 'f') { b1 = b1 - 87; // 87 = 'a' - 10 } else if (b1 >= 'A' && b1 <= 'F') { b1 = b1 - 55; // 55 = 'A' - 10 } else { throw new IllegalStateException("Malformed DN: " + dn); } b2 = chars[position + 1]; if (b2 >= '0' && b2 <= '9') { b2 = b2 - '0'; } else if (b2 >= 'a' && b2 <= 'f') { b2 = b2 - 87; // 87 = 'a' - 10 } else if (b2 >= 'A' && b2 <= 'F') { b2 = b2 - 55; // 55 = 'A' - 10 } else { throw new IllegalStateException("Malformed DN: " + dn); } return (b1 << 4) + b2; }
class class_name[name] begin[{] method[getByte, return_type[type[int]], modifier[private], parameter[position]] begin[{] if[binary_operation[binary_operation[member[.position], +, literal[1]], >=, member[.length]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Malformed DN: "), operandr=MemberReference(member=dn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], b1] assign[member[.b1], member[.chars]] if[binary_operation[binary_operation[member[.b1], >=, literal['0']], &&, binary_operation[member[.b1], <=, literal['9']]]] begin[{] assign[member[.b1], binary_operation[member[.b1], -, literal['0']]] else begin[{] if[binary_operation[binary_operation[member[.b1], >=, literal['a']], &&, binary_operation[member[.b1], <=, literal['f']]]] begin[{] assign[member[.b1], binary_operation[member[.b1], -, literal[87]]] else begin[{] if[binary_operation[binary_operation[member[.b1], >=, literal['A']], &&, binary_operation[member[.b1], <=, literal['F']]]] begin[{] assign[member[.b1], binary_operation[member[.b1], -, literal[55]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Malformed DN: "), operandr=MemberReference(member=dn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) end[}] end[}] end[}] assign[member[.b2], member[.chars]] if[binary_operation[binary_operation[member[.b2], >=, literal['0']], &&, binary_operation[member[.b2], <=, literal['9']]]] begin[{] assign[member[.b2], binary_operation[member[.b2], -, literal['0']]] else begin[{] if[binary_operation[binary_operation[member[.b2], >=, literal['a']], &&, binary_operation[member[.b2], <=, literal['f']]]] begin[{] assign[member[.b2], binary_operation[member[.b2], -, literal[87]]] else begin[{] if[binary_operation[binary_operation[member[.b2], >=, literal['A']], &&, binary_operation[member[.b2], <=, literal['F']]]] begin[{] assign[member[.b2], binary_operation[member[.b2], -, literal[55]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Malformed DN: "), operandr=MemberReference(member=dn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) end[}] end[}] end[}] return[binary_operation[binary_operation[member[.b1], <<, literal[4]], +, member[.b2]]] end[}] END[}]
Keyword[private] Keyword[int] identifier[getByte] operator[SEP] Keyword[int] identifier[position] operator[SEP] { Keyword[if] operator[SEP] identifier[position] operator[+] Other[1] operator[>=] identifier[length] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[dn] operator[SEP] operator[SEP] } Keyword[int] identifier[b1] , identifier[b2] operator[SEP] identifier[b1] operator[=] identifier[chars] operator[SEP] identifier[position] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b1] operator[>=] literal[String] operator[&&] identifier[b1] operator[<=] literal[String] operator[SEP] { identifier[b1] operator[=] identifier[b1] operator[-] literal[String] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[b1] operator[>=] literal[String] operator[&&] identifier[b1] operator[<=] literal[String] operator[SEP] { identifier[b1] operator[=] identifier[b1] operator[-] Other[87] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[b1] operator[>=] literal[String] operator[&&] identifier[b1] operator[<=] literal[String] operator[SEP] { identifier[b1] operator[=] identifier[b1] operator[-] Other[55] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[dn] operator[SEP] operator[SEP] } identifier[b2] operator[=] identifier[chars] operator[SEP] identifier[position] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b2] operator[>=] literal[String] operator[&&] identifier[b2] operator[<=] literal[String] operator[SEP] { identifier[b2] operator[=] identifier[b2] operator[-] literal[String] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[b2] operator[>=] literal[String] operator[&&] identifier[b2] operator[<=] literal[String] operator[SEP] { identifier[b2] operator[=] identifier[b2] operator[-] Other[87] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[b2] operator[>=] literal[String] operator[&&] identifier[b2] operator[<=] literal[String] operator[SEP] { identifier[b2] operator[=] identifier[b2] operator[-] Other[55] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[dn] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[b1] operator[<<] Other[4] operator[SEP] operator[+] identifier[b2] operator[SEP] }
public String getUnicodeString(Integer id, Integer type) { return (getUnicodeString(m_meta.getOffset(id, type))); }
class class_name[name] begin[{] method[getUnicodeString, return_type[type[String]], modifier[public], parameter[id, type]] begin[{] return[call[.getUnicodeString, parameter[call[m_meta.getOffset, parameter[member[.id], member[.type]]]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getUnicodeString] operator[SEP] identifier[Integer] identifier[id] , identifier[Integer] identifier[type] operator[SEP] { Keyword[return] operator[SEP] identifier[getUnicodeString] operator[SEP] identifier[m_meta] operator[SEP] identifier[getOffset] operator[SEP] identifier[id] , identifier[type] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private static void tagHierarchyWithPairtreeMixin(final Node baseNode, final Node createdNode) throws RepositoryException { Node parent = createdNode.getParent(); while (parent.isNew() && !parent.equals(baseNode)) { parent.addMixin(FEDORA_PAIRTREE); parent = parent.getParent(); } }
class class_name[name] begin[{] method[tagHierarchyWithPairtreeMixin, return_type[void], modifier[private static], parameter[baseNode, createdNode]] begin[{] local_variable[type[Node], parent] while[binary_operation[call[parent.isNew, parameter[]], &&, call[parent.equals, parameter[member[.baseNode]]]]] begin[{] call[parent.addMixin, parameter[member[.FEDORA_PAIRTREE]]] assign[member[.parent], call[parent.getParent, parameter[]]] end[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[tagHierarchyWithPairtreeMixin] operator[SEP] Keyword[final] identifier[Node] identifier[baseNode] , Keyword[final] identifier[Node] identifier[createdNode] operator[SEP] Keyword[throws] identifier[RepositoryException] { identifier[Node] identifier[parent] operator[=] identifier[createdNode] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[parent] operator[SEP] identifier[isNew] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[parent] operator[SEP] identifier[equals] operator[SEP] identifier[baseNode] operator[SEP] operator[SEP] { identifier[parent] operator[SEP] identifier[addMixin] operator[SEP] identifier[FEDORA_PAIRTREE] operator[SEP] operator[SEP] identifier[parent] operator[=] identifier[parent] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] } }
@Override public CommerceShippingFixedOptionRel remove(Serializable primaryKey) throws NoSuchShippingFixedOptionRelException { Session session = null; try { session = openSession(); CommerceShippingFixedOptionRel commerceShippingFixedOptionRel = (CommerceShippingFixedOptionRel)session.get(CommerceShippingFixedOptionRelImpl.class, primaryKey); if (commerceShippingFixedOptionRel == null) { if (_log.isDebugEnabled()) { _log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey); } throw new NoSuchShippingFixedOptionRelException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey); } return remove(commerceShippingFixedOptionRel); } catch (NoSuchShippingFixedOptionRelException nsee) { throw nsee; } catch (Exception e) { throw processException(e); } finally { closeSession(session); } }
class class_name[name] begin[{] method[remove, return_type[type[CommerceShippingFixedOptionRel]], modifier[public], parameter[primaryKey]] begin[{] local_variable[type[Session], session] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=openSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommerceShippingFixedOptionRelImpl, sub_type=None)), MemberReference(member=primaryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommerceShippingFixedOptionRel, sub_type=None)), name=commerceShippingFixedOptionRel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommerceShippingFixedOptionRel, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=commerceShippingFixedOptionRel, 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=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=_NO_SUCH_ENTITY_WITH_PRIMARY_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=primaryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), label=None)])), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=_NO_SUCH_ENTITY_WITH_PRIMARY_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=primaryKey, 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=NoSuchShippingFixedOptionRelException, sub_type=None)), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=commerceShippingFixedOptionRel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=nsee, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nsee, types=['NoSuchShippingFixedOptionRelException'])), CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CommerceShippingFixedOptionRel] identifier[remove] operator[SEP] identifier[Serializable] identifier[primaryKey] operator[SEP] Keyword[throws] identifier[NoSuchShippingFixedOptionRelException] { identifier[Session] identifier[session] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[session] operator[=] identifier[openSession] operator[SEP] operator[SEP] operator[SEP] identifier[CommerceShippingFixedOptionRel] identifier[commerceShippingFixedOptionRel] operator[=] operator[SEP] identifier[CommerceShippingFixedOptionRel] operator[SEP] identifier[session] operator[SEP] identifier[get] operator[SEP] identifier[CommerceShippingFixedOptionRelImpl] operator[SEP] Keyword[class] , identifier[primaryKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commerceShippingFixedOptionRel] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[_log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[_log] operator[SEP] identifier[debug] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_PRIMARY_KEY] operator[+] identifier[primaryKey] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[NoSuchShippingFixedOptionRelException] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_PRIMARY_KEY] operator[+] identifier[primaryKey] operator[SEP] operator[SEP] } Keyword[return] identifier[remove] operator[SEP] identifier[commerceShippingFixedOptionRel] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchShippingFixedOptionRelException] identifier[nsee] operator[SEP] { Keyword[throw] identifier[nsee] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] identifier[processException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[closeSession] operator[SEP] identifier[session] operator[SEP] operator[SEP] } }
private String parseParamsForStatistics(ParameterSet params, JSONObject obj) throws Exception { if ((params.toArray().length < 1) || (params.toArray().length > 2)) { return "Incorrect number of arguments to @Statistics (expects 2, received " + params.toArray().length + ")"; } Object first = params.toArray()[0]; if (!(first instanceof String)) { return "First argument to @Statistics must be a valid STRING selector, instead was " + first; } String subselector = (String)first; try { StatsSelector s = StatsSelector.valueOf(subselector.toUpperCase()); subselector = s.name(); } catch (Exception e) { return "First argument to @Statistics must be a valid STRING selector, instead was " + first; } boolean interval = false; if (params.toArray().length == 2) { interval = ((Number)(params.toArray()[1])).longValue() == 1L; } obj.put("subselector", subselector); obj.put("interval", interval); return null; }
class class_name[name] begin[{] method[parseParamsForStatistics, return_type[type[String]], modifier[private], parameter[params, obj]] begin[{] if[binary_operation[binary_operation[call[params.toArray, parameter[]], <, literal[1]], ||, binary_operation[call[params.toArray, parameter[]], >, literal[2]]]] begin[{] return[binary_operation[binary_operation[literal["Incorrect number of arguments to @Statistics (expects 2, received "], +, call[params.toArray, parameter[]]], +, literal[")"]]] else begin[{] None end[}] local_variable[type[Object], first] if[binary_operation[member[.first], instanceof, type[String]]] begin[{] return[binary_operation[literal["First argument to @Statistics must be a valid STRING selector, instead was "], +, member[.first]]] else begin[{] None end[}] local_variable[type[String], subselector] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=subselector, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=StatsSelector, selectors=[], type_arguments=None), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StatsSelector, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=subselector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="First argument to @Statistics must be a valid STRING selector, instead was "), operandr=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) local_variable[type[boolean], interval] if[binary_operation[call[params.toArray, parameter[]], ==, literal[2]]] begin[{] assign[member[.interval], binary_operation[Cast(expression=MethodInvocation(arguments=[], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None)), ==, literal[1L]]] else begin[{] None end[}] call[obj.put, parameter[literal["subselector"], member[.subselector]]] call[obj.put, parameter[literal["interval"], member[.interval]]] return[literal[null]] end[}] END[}]
Keyword[private] identifier[String] identifier[parseParamsForStatistics] operator[SEP] identifier[ParameterSet] identifier[params] , identifier[JSONObject] identifier[obj] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[<] Other[1] operator[SEP] operator[||] operator[SEP] identifier[params] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[>] Other[2] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[+] identifier[params] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[+] literal[String] operator[SEP] } identifier[Object] identifier[first] operator[=] identifier[params] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[first] Keyword[instanceof] identifier[String] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[+] identifier[first] operator[SEP] } identifier[String] identifier[subselector] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[first] operator[SEP] Keyword[try] { identifier[StatsSelector] identifier[s] operator[=] identifier[StatsSelector] operator[SEP] identifier[valueOf] operator[SEP] identifier[subselector] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[subselector] operator[=] identifier[s] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[return] literal[String] operator[+] identifier[first] operator[SEP] } Keyword[boolean] identifier[interval] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[params] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] { identifier[interval] operator[=] operator[SEP] operator[SEP] identifier[Number] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[==] Other[1L] operator[SEP] } identifier[obj] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[subselector] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[interval] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
public java.util.List<com.google.bigtable.v2.ReadRowsResponse.CellChunk> getChunksList() { return chunks_; }
class class_name[name] begin[{] method[getChunksList, return_type[type[java]], modifier[public], parameter[]] begin[{] return[member[.chunks_]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[bigtable] operator[SEP] identifier[v2] operator[SEP] identifier[ReadRowsResponse] operator[SEP] identifier[CellChunk] operator[>] identifier[getChunksList] operator[SEP] operator[SEP] { Keyword[return] identifier[chunks_] operator[SEP] }
public boolean kickChatMember(String chatId, int userId) { HttpResponse<String> response; JSONObject jsonResponse; try { MultipartBody request = Unirest.post(getBotAPIUrl() + "kickChatMember") .field("chat_id", chatId, "application/json; charset=utf8;") .field("user_id", userId); response = request.asString(); jsonResponse = Utils.processResponse(response); if(jsonResponse != null) { if(jsonResponse.getBoolean("result")) return true; } } catch (UnirestException e) { e.printStackTrace(); } return false; }
class class_name[name] begin[{] method[kickChatMember, return_type[type[boolean]], modifier[public], parameter[chatId, userId]] begin[{] local_variable[type[HttpResponse], response] local_variable[type[JSONObject], jsonResponse] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getBotAPIUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="kickChatMember"), operator=+)], member=post, postfix_operators=[], prefix_operators=[], qualifier=Unirest, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="chat_id"), MemberReference(member=chatId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="application/json; charset=utf8;")], member=field, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user_id"), MemberReference(member=userId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=field, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=request)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MultipartBody, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=asString, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=jsonResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processResponse, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=jsonResponse, 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=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="result")], member=getBoolean, postfix_operators=[], prefix_operators=[], qualifier=jsonResponse, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None))]))], 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=['UnirestException']))], finally_block=None, label=None, resources=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[kickChatMember] operator[SEP] identifier[String] identifier[chatId] , Keyword[int] identifier[userId] operator[SEP] { identifier[HttpResponse] operator[<] identifier[String] operator[>] identifier[response] operator[SEP] identifier[JSONObject] identifier[jsonResponse] operator[SEP] Keyword[try] { identifier[MultipartBody] identifier[request] operator[=] identifier[Unirest] operator[SEP] identifier[post] operator[SEP] identifier[getBotAPIUrl] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[field] operator[SEP] literal[String] , identifier[chatId] , literal[String] operator[SEP] operator[SEP] identifier[field] operator[SEP] literal[String] , identifier[userId] operator[SEP] operator[SEP] identifier[response] operator[=] identifier[request] operator[SEP] identifier[asString] operator[SEP] operator[SEP] operator[SEP] identifier[jsonResponse] operator[=] identifier[Utils] operator[SEP] identifier[processResponse] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jsonResponse] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[jsonResponse] operator[SEP] identifier[getBoolean] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } } Keyword[catch] operator[SEP] identifier[UnirestException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public void handleNavigation(FacesContext context, String fromAction, String outcome, String toFlowDocumentId) { this.handleNavigation(context, fromAction, outcome); }
class class_name[name] begin[{] method[handleNavigation, return_type[void], modifier[public], parameter[context, fromAction, outcome, toFlowDocumentId]] begin[{] THIS[call[None.handleNavigation, parameter[member[.context], member[.fromAction], member[.outcome]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[handleNavigation] operator[SEP] identifier[FacesContext] identifier[context] , identifier[String] identifier[fromAction] , identifier[String] identifier[outcome] , identifier[String] identifier[toFlowDocumentId] operator[SEP] { Keyword[this] operator[SEP] identifier[handleNavigation] operator[SEP] identifier[context] , identifier[fromAction] , identifier[outcome] operator[SEP] operator[SEP] }
public void deleteUndoLog(String groupId, String unitId) throws SQLException { String sql = "DELETE FROM TXC_UNDO_LOG WHERE GROUP_ID=? AND UNIT_ID=?"; h2DbHelper.queryRunner().update(sql, groupId, unitId); }
class class_name[name] begin[{] method[deleteUndoLog, return_type[void], modifier[public], parameter[groupId, unitId]] begin[{] local_variable[type[String], sql] call[h2DbHelper.queryRunner, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[deleteUndoLog] operator[SEP] identifier[String] identifier[groupId] , identifier[String] identifier[unitId] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[String] identifier[sql] operator[=] literal[String] operator[SEP] identifier[h2DbHelper] operator[SEP] identifier[queryRunner] operator[SEP] operator[SEP] operator[SEP] identifier[update] operator[SEP] identifier[sql] , identifier[groupId] , identifier[unitId] operator[SEP] operator[SEP] }
@Override public ResourceSet<UserChannel> read(final TwilioRestClient client) { return new ResourceSet<>(this, client, firstPage(client)); }
class class_name[name] begin[{] method[read, return_type[type[ResourceSet]], modifier[public], parameter[client]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=firstPage, 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=[], dimensions=None, name=ResourceSet, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ResourceSet] operator[<] identifier[UserChannel] operator[>] identifier[read] operator[SEP] Keyword[final] identifier[TwilioRestClient] identifier[client] operator[SEP] { Keyword[return] Keyword[new] identifier[ResourceSet] operator[<] operator[>] operator[SEP] Keyword[this] , identifier[client] , identifier[firstPage] operator[SEP] identifier[client] operator[SEP] operator[SEP] operator[SEP] }
private static final void x_to_y2(long10 t, long10 y2, long10 x) { sqr(t, x); mul_small(y2, x, 486662); add(t, t, y2); t._0++; mul(y2, t, x); }
class class_name[name] begin[{] method[x_to_y2, return_type[void], modifier[final private static], parameter[t, y2, x]] begin[{] call[.sqr, parameter[member[.t], member[.x]]] call[.mul_small, parameter[member[.y2], member[.x], literal[486662]]] call[.add, parameter[member[.t], member[.t], member[.y2]]] member[t._0] call[.mul, parameter[member[.y2], member[.t], member[.x]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[final] Keyword[void] identifier[x_to_y2] operator[SEP] identifier[long10] identifier[t] , identifier[long10] identifier[y2] , identifier[long10] identifier[x] operator[SEP] { identifier[sqr] operator[SEP] identifier[t] , identifier[x] operator[SEP] operator[SEP] identifier[mul_small] operator[SEP] identifier[y2] , identifier[x] , Other[486662] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[t] , identifier[t] , identifier[y2] operator[SEP] operator[SEP] identifier[t] operator[SEP] identifier[_0] operator[++] operator[SEP] identifier[mul] operator[SEP] identifier[y2] , identifier[t] , identifier[x] operator[SEP] operator[SEP] }
void init(VarMap varMap) { ArrayList<Type> upperBoundsList = new ArrayList<>(); upperBoundsList.addAll(Arrays.asList(varMap.map(variable.getBounds()))); List<Type> wildcardUpperBounds = Arrays.asList(wildcard.getUpperBounds()); if (wildcardUpperBounds.size() > 0 && wildcardUpperBounds.get(0) == Object.class) { // skip the Object bound, we already have a first upper bound from 'variable' upperBoundsList.addAll(wildcardUpperBounds.subList(1, wildcardUpperBounds.size())); } else { upperBoundsList.addAll(wildcardUpperBounds); } upperBounds = new Type[upperBoundsList.size()]; upperBoundsList.toArray(upperBounds); }
class class_name[name] begin[{] method[init, return_type[void], modifier[default], parameter[varMap]] begin[{] local_variable[type[ArrayList], upperBoundsList] call[upperBoundsList.addAll, parameter[call[Arrays.asList, parameter[call[varMap.map, parameter[call[variable.getBounds, parameter[]]]]]]]] local_variable[type[List], wildcardUpperBounds] if[binary_operation[binary_operation[call[wildcardUpperBounds.size, parameter[]], >, literal[0]], &&, binary_operation[call[wildcardUpperBounds.get, parameter[literal[0]]], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]] begin[{] call[upperBoundsList.addAll, parameter[call[wildcardUpperBounds.subList, parameter[literal[1], call[wildcardUpperBounds.size, parameter[]]]]]] else begin[{] call[upperBoundsList.addAll, parameter[member[.wildcardUpperBounds]]] end[}] assign[member[.upperBounds], ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=upperBoundsList, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Type, sub_type=None))] call[upperBoundsList.toArray, parameter[member[.upperBounds]]] end[}] END[}]
Keyword[void] identifier[init] operator[SEP] identifier[VarMap] identifier[varMap] operator[SEP] { identifier[ArrayList] operator[<] identifier[Type] operator[>] identifier[upperBoundsList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[upperBoundsList] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[varMap] operator[SEP] identifier[map] operator[SEP] identifier[variable] operator[SEP] identifier[getBounds] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Type] operator[>] identifier[wildcardUpperBounds] operator[=] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[wildcard] operator[SEP] identifier[getUpperBounds] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[wildcardUpperBounds] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] identifier[wildcardUpperBounds] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[==] identifier[Object] operator[SEP] Keyword[class] operator[SEP] { identifier[upperBoundsList] operator[SEP] identifier[addAll] operator[SEP] identifier[wildcardUpperBounds] operator[SEP] identifier[subList] operator[SEP] Other[1] , identifier[wildcardUpperBounds] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[upperBoundsList] operator[SEP] identifier[addAll] operator[SEP] identifier[wildcardUpperBounds] operator[SEP] operator[SEP] } identifier[upperBounds] operator[=] Keyword[new] identifier[Type] operator[SEP] identifier[upperBoundsList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[upperBoundsList] operator[SEP] identifier[toArray] operator[SEP] identifier[upperBounds] operator[SEP] operator[SEP] }
public String getHomeBeanClassName() { // There is no generated home bean if there is neither a remote or // local home interface (webservice endpoint or EJB 3.0 without a // component interface). String homeInterface = (ivRemoteHomeInterface == null) ? ivLocalHomeInterface : ivRemoteHomeInterface; if (homeInterface == null) return null; // ----------------------------------------------------------------------- // The component home bean name was changed in EJB 2.x to use the bean // name and hash suffix, and only modified slightly again in EJB 3.0. // The only 3 differences in EJB 3.0 are : // // 1 - "C" indicating component interface added // 2 - beantype shortened for Stateless and Stateful (now SL/SF) // 3 - hash code uses modified algorithm, and includes business interfaces // // The last two differences are pre-calculated in the constructor, and // so the code here appears common. // ----------------------------------------------------------------------- StringBuffer result = new StringBuffer(); // Note: uses remote home interface package by default. String packageName = packageName(homeInterface); if (packageName != null) { result.append(packageName); result.append('.'); } result.append(homeBeanPrefix); // EJS if (ivVersion >= EJB_3X) result.append("C"); // Component interface result.append(ivBeanType); // SL/SF/BMP/CMP, etc. if (ivVersion >= EJB_2X) { result.append(ivBeanName); // First 32 characters result.append("HomeBean"); result.append('_'); result.append(ivHashSuffix); // 8 digit hashcode } else { result.append(relativeName(ivRemoteHomeInterface)); result.append("Bean"); if (ivHashVersion > 0) // d369262.3 { result.append('_'); result.append(ivHashSuffix); // 8 digit hashcode } } return result.toString(); }
class class_name[name] begin[{] method[getHomeBeanClassName, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], homeInterface] if[binary_operation[member[.homeInterface], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[StringBuffer], result] local_variable[type[String], packageName] if[binary_operation[member[.packageName], !=, literal[null]]] begin[{] call[result.append, parameter[member[.packageName]]] call[result.append, parameter[literal['.']]] else begin[{] None end[}] call[result.append, parameter[member[.homeBeanPrefix]]] if[binary_operation[member[.ivVersion], >=, member[.EJB_3X]]] begin[{] call[result.append, parameter[literal["C"]]] else begin[{] None end[}] call[result.append, parameter[member[.ivBeanType]]] if[binary_operation[member[.ivVersion], >=, member[.EJB_2X]]] begin[{] call[result.append, parameter[member[.ivBeanName]]] call[result.append, parameter[literal["HomeBean"]]] call[result.append, parameter[literal['_']]] call[result.append, parameter[member[.ivHashSuffix]]] else begin[{] call[result.append, parameter[call[.relativeName, parameter[member[.ivRemoteHomeInterface]]]]] call[result.append, parameter[literal["Bean"]]] if[binary_operation[member[.ivHashVersion], >, literal[0]]] begin[{] call[result.append, parameter[literal['_']]] call[result.append, parameter[member[.ivHashSuffix]]] else begin[{] None end[}] end[}] return[call[result.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getHomeBeanClassName] operator[SEP] operator[SEP] { identifier[String] identifier[homeInterface] operator[=] operator[SEP] identifier[ivRemoteHomeInterface] operator[==] Other[null] operator[SEP] operator[?] identifier[ivLocalHomeInterface] operator[:] identifier[ivRemoteHomeInterface] operator[SEP] Keyword[if] operator[SEP] identifier[homeInterface] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[StringBuffer] identifier[result] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[packageName] operator[=] identifier[packageName] operator[SEP] identifier[homeInterface] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[packageName] operator[!=] Other[null] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[packageName] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[homeBeanPrefix] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ivVersion] operator[>=] identifier[EJB_3X] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[ivBeanType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ivVersion] operator[>=] identifier[EJB_2X] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[ivBeanName] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[ivHashSuffix] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[relativeName] operator[SEP] identifier[ivRemoteHomeInterface] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ivHashVersion] operator[>] Other[0] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[ivHashSuffix] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
@Override public T first() { if (elements instanceof SortedSet<?>) return ((SortedSet<T>) elements).first(); if (elements instanceof List<?>) return ((List<T>) elements).get(0); return super.first(); }
class class_name[name] begin[{] method[first, return_type[type[T]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.elements], instanceof, type[SortedSet]]] begin[{] return[Cast(expression=MemberReference(member=elements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=SortedSet, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.elements], instanceof, type[List]]] begin[{] return[Cast(expression=MemberReference(member=elements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=List, sub_type=None))] else begin[{] None end[}] return[SuperMethodInvocation(arguments=[], member=first, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[first] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[elements] Keyword[instanceof] identifier[SortedSet] operator[<] operator[?] operator[>] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[SortedSet] operator[<] identifier[T] operator[>] operator[SEP] identifier[elements] operator[SEP] operator[SEP] identifier[first] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[elements] Keyword[instanceof] identifier[List] operator[<] operator[?] operator[>] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[T] operator[>] operator[SEP] identifier[elements] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[return] Keyword[super] operator[SEP] identifier[first] operator[SEP] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") private static Method findSetScriptContextMethod(Class clazz) { try { Method setCtxMethod = clazz.getMethod("setScriptContext", new Class[] { ScriptContext.class }); int modifiers = setCtxMethod.getModifiers(); if (Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers)) { return setCtxMethod; } } catch (NoSuchMethodException nsme) { } return null; }
class class_name[name] begin[{] method[findSetScriptContextMethod, return_type[type[Method]], modifier[private static], parameter[clazz]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="setScriptContext"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ScriptContext, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None))], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), name=setCtxMethod)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getModifiers, postfix_operators=[], prefix_operators=[], qualifier=setCtxMethod, selectors=[], type_arguments=None), name=modifiers)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=modifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPublic, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=modifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isStatic, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=setCtxMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nsme, types=['NoSuchMethodException']))], finally_block=None, label=None, resources=None) return[literal[null]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[static] identifier[Method] identifier[findSetScriptContextMethod] operator[SEP] identifier[Class] identifier[clazz] operator[SEP] { Keyword[try] { identifier[Method] identifier[setCtxMethod] operator[=] identifier[clazz] operator[SEP] identifier[getMethod] operator[SEP] literal[String] , Keyword[new] identifier[Class] operator[SEP] operator[SEP] { identifier[ScriptContext] operator[SEP] Keyword[class] } operator[SEP] operator[SEP] Keyword[int] identifier[modifiers] operator[=] identifier[setCtxMethod] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isPublic] operator[SEP] identifier[modifiers] operator[SEP] operator[&&] identifier[Modifier] operator[SEP] identifier[isStatic] operator[SEP] identifier[modifiers] operator[SEP] operator[SEP] { Keyword[return] identifier[setCtxMethod] operator[SEP] } } Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[nsme] operator[SEP] { } Keyword[return] Other[null] operator[SEP] }
private void setupStormCode(String topologyId, String tmpJarLocation, Map<Object, Object> stormConf, StormTopology topology, boolean update) throws Exception { String codeKey = StormConfig.master_stormcode_key(topologyId); String confKey = StormConfig.master_stormconf_key(topologyId); String codeKeyBak = StormConfig.master_stormcode_bak_key(topologyId); // in local mode there is no jar if (tmpJarLocation != null) { setupJar(tmpJarLocation, topologyId, update); } if (update) { backupBlob(codeKey, codeKeyBak, topologyId); } createOrUpdateBlob(confKey, Utils.serialize(stormConf), update, topologyId); createOrUpdateBlob(codeKey, Utils.serialize(topology), update, topologyId); }
class class_name[name] begin[{] method[setupStormCode, return_type[void], modifier[private], parameter[topologyId, tmpJarLocation, stormConf, topology, update]] begin[{] local_variable[type[String], codeKey] local_variable[type[String], confKey] local_variable[type[String], codeKeyBak] if[binary_operation[member[.tmpJarLocation], !=, literal[null]]] begin[{] call[.setupJar, parameter[member[.tmpJarLocation], member[.topologyId], member[.update]]] else begin[{] None end[}] if[member[.update]] begin[{] call[.backupBlob, parameter[member[.codeKey], member[.codeKeyBak], member[.topologyId]]] else begin[{] None end[}] call[.createOrUpdateBlob, parameter[member[.confKey], call[Utils.serialize, parameter[member[.stormConf]]], member[.update], member[.topologyId]]] call[.createOrUpdateBlob, parameter[member[.codeKey], call[Utils.serialize, parameter[member[.topology]]], member[.update], member[.topologyId]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[setupStormCode] operator[SEP] identifier[String] identifier[topologyId] , identifier[String] identifier[tmpJarLocation] , identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[stormConf] , identifier[StormTopology] identifier[topology] , Keyword[boolean] identifier[update] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[codeKey] operator[=] identifier[StormConfig] operator[SEP] identifier[master_stormcode_key] operator[SEP] identifier[topologyId] operator[SEP] operator[SEP] identifier[String] identifier[confKey] operator[=] identifier[StormConfig] operator[SEP] identifier[master_stormconf_key] operator[SEP] identifier[topologyId] operator[SEP] operator[SEP] identifier[String] identifier[codeKeyBak] operator[=] identifier[StormConfig] operator[SEP] identifier[master_stormcode_bak_key] operator[SEP] identifier[topologyId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tmpJarLocation] operator[!=] Other[null] operator[SEP] { identifier[setupJar] operator[SEP] identifier[tmpJarLocation] , identifier[topologyId] , identifier[update] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[update] operator[SEP] { identifier[backupBlob] operator[SEP] identifier[codeKey] , identifier[codeKeyBak] , identifier[topologyId] operator[SEP] operator[SEP] } identifier[createOrUpdateBlob] operator[SEP] identifier[confKey] , identifier[Utils] operator[SEP] identifier[serialize] operator[SEP] identifier[stormConf] operator[SEP] , identifier[update] , identifier[topologyId] operator[SEP] operator[SEP] identifier[createOrUpdateBlob] operator[SEP] identifier[codeKey] , identifier[Utils] operator[SEP] identifier[serialize] operator[SEP] identifier[topology] operator[SEP] , identifier[update] , identifier[topologyId] operator[SEP] operator[SEP] }
@Implementation protected void setNdefPushMessage( NdefMessage message, Activity activity, Activity... activities) { if (activity == null) { throw new NullPointerException("activity cannot be null"); } for (Activity a : activities) { if (a == null) { throw new NullPointerException("activities cannot contain null"); } } this.ndefPushMessage = message; this.ndefPushMessageSet = true; }
class class_name[name] begin[{] method[setNdefPushMessage, return_type[void], modifier[protected], parameter[message, activity, activities]] begin[{] if[binary_operation[member[.activity], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="activity cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=a, 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=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="activities cannot contain null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=activities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=a)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Activity, sub_type=None))), label=None) assign[THIS[member[None.ndefPushMessage]], member[.message]] assign[THIS[member[None.ndefPushMessageSet]], literal[true]] end[}] END[}]
annotation[@] identifier[Implementation] Keyword[protected] Keyword[void] identifier[setNdefPushMessage] operator[SEP] identifier[NdefMessage] identifier[message] , identifier[Activity] identifier[activity] , identifier[Activity] operator[...] identifier[activities] operator[SEP] { Keyword[if] operator[SEP] identifier[activity] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Activity] identifier[a] operator[:] identifier[activities] operator[SEP] { Keyword[if] operator[SEP] identifier[a] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[this] operator[SEP] identifier[ndefPushMessage] operator[=] identifier[message] operator[SEP] Keyword[this] operator[SEP] identifier[ndefPushMessageSet] operator[=] literal[boolean] operator[SEP] }
@When("^I send a '(.+?)' request to '(.+?)'( with user and password '(.+:.+?)')? based on '([^:]+?)'( as '(json|string|gov)')? with:$") public void sendRequest(String requestType, String endPoint, String foo, String loginInfo, String baseData, String baz, String type, DataTable modifications) throws Exception { // Retrieve data String retrievedData = commonspec.retrieveData(baseData, type); // Modify data commonspec.getLogger().debug("Modifying data {} as {}", retrievedData, type); String modifiedData = commonspec.modifyData(retrievedData, type, modifications).toString(); String user = null; String password = null; if (loginInfo != null) { user = loginInfo.substring(0, loginInfo.indexOf(':')); password = loginInfo.substring(loginInfo.indexOf(':') + 1, loginInfo.length()); } commonspec.getLogger().debug("Generating request {} to {} with data {} as {}", requestType, endPoint, modifiedData, type); Future<Response> response = commonspec.generateRequest(requestType, false, user, password, endPoint, modifiedData, type, ""); // Save response commonspec.getLogger().debug("Saving response"); commonspec.setResponse(requestType, response.get()); }
class class_name[name] begin[{] method[sendRequest, return_type[void], modifier[public], parameter[requestType, endPoint, foo, loginInfo, baseData, baz, type, modifications]] begin[{] local_variable[type[String], retrievedData] call[commonspec.getLogger, parameter[]] local_variable[type[String], modifiedData] local_variable[type[String], user] local_variable[type[String], password] if[binary_operation[member[.loginInfo], !=, literal[null]]] begin[{] assign[member[.user], call[loginInfo.substring, parameter[literal[0], call[loginInfo.indexOf, parameter[literal[':']]]]]] assign[member[.password], call[loginInfo.substring, parameter[binary_operation[call[loginInfo.indexOf, parameter[literal[':']]], +, literal[1]], call[loginInfo.length, parameter[]]]]] else begin[{] None end[}] call[commonspec.getLogger, parameter[]] local_variable[type[Future], response] call[commonspec.getLogger, parameter[]] call[commonspec.setResponse, parameter[member[.requestType], call[response.get, parameter[]]]] end[}] END[}]
annotation[@] identifier[When] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[sendRequest] operator[SEP] identifier[String] identifier[requestType] , identifier[String] identifier[endPoint] , identifier[String] identifier[foo] , identifier[String] identifier[loginInfo] , identifier[String] identifier[baseData] , identifier[String] identifier[baz] , identifier[String] identifier[type] , identifier[DataTable] identifier[modifications] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[retrievedData] operator[=] identifier[commonspec] operator[SEP] identifier[retrieveData] operator[SEP] identifier[baseData] , identifier[type] operator[SEP] operator[SEP] identifier[commonspec] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[retrievedData] , identifier[type] operator[SEP] operator[SEP] identifier[String] identifier[modifiedData] operator[=] identifier[commonspec] operator[SEP] identifier[modifyData] operator[SEP] identifier[retrievedData] , identifier[type] , identifier[modifications] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[user] operator[=] Other[null] operator[SEP] identifier[String] identifier[password] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[loginInfo] operator[!=] Other[null] operator[SEP] { identifier[user] operator[=] identifier[loginInfo] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[loginInfo] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[password] operator[=] identifier[loginInfo] operator[SEP] identifier[substring] operator[SEP] identifier[loginInfo] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] , identifier[loginInfo] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[commonspec] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[requestType] , identifier[endPoint] , identifier[modifiedData] , identifier[type] operator[SEP] operator[SEP] identifier[Future] operator[<] identifier[Response] operator[>] identifier[response] operator[=] identifier[commonspec] operator[SEP] identifier[generateRequest] operator[SEP] identifier[requestType] , literal[boolean] , identifier[user] , identifier[password] , identifier[endPoint] , identifier[modifiedData] , identifier[type] , literal[String] operator[SEP] operator[SEP] identifier[commonspec] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[commonspec] operator[SEP] identifier[setResponse] operator[SEP] identifier[requestType] , identifier[response] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private List<TimephasedWork> splitDays(ProjectCalendar calendar, List<TimephasedWork> list, TimephasedWork first, TimephasedWork last) { List<TimephasedWork> result = new LinkedList<TimephasedWork>(); for (TimephasedWork assignment : list) { Date startDate = assignment.getStart(); Date finishDate = assignment.getFinish(); Date startDay = DateHelper.getDayStartDate(startDate); Date finishDay = DateHelper.getDayStartDate(finishDate); if (startDay.getTime() == finishDay.getTime()) { Date startTime = calendar.getStartTime(startDay); Date currentStart = DateHelper.setTime(startDay, startTime); if (startDate.getTime() > currentStart.getTime()) { boolean paddingRequired = true; if (last != null) { Date lastFinish = last.getFinish(); if (lastFinish.getTime() == startDate.getTime()) { paddingRequired = false; } else { Date lastFinishDay = DateHelper.getDayStartDate(lastFinish); if (startDay.getTime() == lastFinishDay.getTime()) { currentStart = lastFinish; } } } if (paddingRequired) { Duration zeroHours = Duration.getInstance(0, TimeUnit.HOURS); TimephasedWork padding = new TimephasedWork(); padding.setStart(currentStart); padding.setFinish(startDate); padding.setTotalAmount(zeroHours); padding.setAmountPerDay(zeroHours); result.add(padding); } } result.add(assignment); Date endTime = calendar.getFinishTime(startDay); Date currentFinish = DateHelper.setTime(startDay, endTime); if (finishDate.getTime() < currentFinish.getTime()) { boolean paddingRequired = true; if (first != null) { Date firstStart = first.getStart(); if (firstStart.getTime() == finishDate.getTime()) { paddingRequired = false; } else { Date firstStartDay = DateHelper.getDayStartDate(firstStart); if (finishDay.getTime() == firstStartDay.getTime()) { currentFinish = firstStart; } } } if (paddingRequired) { Duration zeroHours = Duration.getInstance(0, TimeUnit.HOURS); TimephasedWork padding = new TimephasedWork(); padding.setStart(finishDate); padding.setFinish(currentFinish); padding.setTotalAmount(zeroHours); padding.setAmountPerDay(zeroHours); result.add(padding); } } } else { Date currentStart = startDate; boolean isWorking = calendar.isWorkingDate(currentStart); while (currentStart.getTime() < finishDate.getTime()) { if (isWorking) { Date endTime = calendar.getFinishTime(currentStart); Date currentFinish = DateHelper.setTime(currentStart, endTime); if (currentFinish.getTime() > finishDate.getTime()) { currentFinish = finishDate; } TimephasedWork split = new TimephasedWork(); split.setStart(currentStart); split.setFinish(currentFinish); split.setTotalAmount(assignment.getAmountPerDay()); split.setAmountPerDay(assignment.getAmountPerDay()); result.add(split); } Calendar cal = DateHelper.popCalendar(currentStart); cal.add(Calendar.DAY_OF_YEAR, 1); currentStart = cal.getTime(); isWorking = calendar.isWorkingDate(currentStart); if (isWorking) { Date startTime = calendar.getStartTime(currentStart); DateHelper.setTime(cal, startTime); currentStart = cal.getTime(); } DateHelper.pushCalendar(cal); } } } return result; }
class class_name[name] begin[{] method[splitDays, return_type[type[List]], modifier[private], parameter[calendar, list, first, last]] begin[{] local_variable[type[List], result] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getStart, postfix_operators=[], prefix_operators=[], qualifier=assignment, selectors=[], type_arguments=None), name=startDate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFinish, postfix_operators=[], prefix_operators=[], qualifier=assignment, selectors=[], type_arguments=None), name=finishDate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=startDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDayStartDate, postfix_operators=[], prefix_operators=[], qualifier=DateHelper, selectors=[], type_arguments=None), name=startDay)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=finishDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDayStartDate, postfix_operators=[], prefix_operators=[], qualifier=DateHelper, selectors=[], type_arguments=None), name=finishDay)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=startDay, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=finishDay, selectors=[], type_arguments=None), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=startDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=currentStart)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=currentStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isWorkingDate, postfix_operators=[], prefix_operators=[], qualifier=calendar, selectors=[], type_arguments=None), name=isWorking)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=isWorking, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=currentStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFinishTime, postfix_operators=[], prefix_operators=[], qualifier=calendar, selectors=[], type_arguments=None), name=endTime)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=currentStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=endTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTime, postfix_operators=[], prefix_operators=[], qualifier=DateHelper, selectors=[], type_arguments=None), name=currentFinish)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=currentFinish, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=finishDate, selectors=[], type_arguments=None), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentFinish, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=finishDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=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=TimephasedWork, sub_type=None)), name=split)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TimephasedWork, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=currentStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setStart, postfix_operators=[], prefix_operators=[], qualifier=split, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=currentFinish, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setFinish, postfix_operators=[], prefix_operators=[], qualifier=split, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAmountPerDay, postfix_operators=[], prefix_operators=[], qualifier=assignment, selectors=[], type_arguments=None)], member=setTotalAmount, postfix_operators=[], prefix_operators=[], qualifier=split, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAmountPerDay, postfix_operators=[], prefix_operators=[], qualifier=assignment, selectors=[], type_arguments=None)], member=setAmountPerDay, postfix_operators=[], prefix_operators=[], qualifier=split, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=split, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=currentStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=popCalendar, postfix_operators=[], prefix_operators=[], qualifier=DateHelper, selectors=[], type_arguments=None), name=cal)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Calendar, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DAY_OF_YEAR, postfix_operators=[], prefix_operators=[], qualifier=Calendar, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=add, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=isWorking, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=currentStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isWorkingDate, postfix_operators=[], prefix_operators=[], qualifier=calendar, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=isWorking, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=currentStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStartTime, postfix_operators=[], prefix_operators=[], qualifier=calendar, selectors=[], type_arguments=None), name=startTime)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=startTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTime, postfix_operators=[], prefix_operators=[], qualifier=DateHelper, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushCalendar, postfix_operators=[], prefix_operators=[], qualifier=DateHelper, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=currentStart, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=finishDate, selectors=[], type_arguments=None), operator=<), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=startDay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStartTime, postfix_operators=[], prefix_operators=[], qualifier=calendar, selectors=[], type_arguments=None), name=startTime)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=startDay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=startTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTime, postfix_operators=[], prefix_operators=[], qualifier=DateHelper, selectors=[], type_arguments=None), name=currentStart)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=startDate, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=currentStart, selectors=[], type_arguments=None), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), name=paddingRequired)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=last, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFinish, postfix_operators=[], prefix_operators=[], qualifier=last, selectors=[], type_arguments=None), name=lastFinish)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=lastFinish, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=startDate, selectors=[], type_arguments=None), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=lastFinish, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDayStartDate, postfix_operators=[], prefix_operators=[], qualifier=DateHelper, selectors=[], type_arguments=None), name=lastFinishDay)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=startDay, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=lastFinishDay, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=lastFinish, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=paddingRequired, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]))])), IfStatement(condition=MemberReference(member=paddingRequired, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=HOURS, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Duration, selectors=[], type_arguments=None), name=zeroHours)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Duration, 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=TimephasedWork, sub_type=None)), name=padding)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TimephasedWork, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=currentStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setStart, postfix_operators=[], prefix_operators=[], qualifier=padding, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=startDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setFinish, postfix_operators=[], prefix_operators=[], qualifier=padding, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=zeroHours, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTotalAmount, postfix_operators=[], prefix_operators=[], qualifier=padding, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=zeroHours, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAmountPerDay, postfix_operators=[], prefix_operators=[], qualifier=padding, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=padding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=assignment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=startDay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFinishTime, postfix_operators=[], prefix_operators=[], qualifier=calendar, selectors=[], type_arguments=None), name=endTime)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=startDay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=endTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTime, postfix_operators=[], prefix_operators=[], qualifier=DateHelper, selectors=[], type_arguments=None), name=currentFinish)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=finishDate, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=currentFinish, selectors=[], type_arguments=None), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), name=paddingRequired)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getStart, postfix_operators=[], prefix_operators=[], qualifier=first, selectors=[], type_arguments=None), name=firstStart)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=firstStart, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=finishDate, selectors=[], type_arguments=None), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=firstStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDayStartDate, postfix_operators=[], prefix_operators=[], qualifier=DateHelper, selectors=[], type_arguments=None), name=firstStartDay)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=finishDay, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=firstStartDay, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentFinish, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=firstStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=paddingRequired, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]))])), IfStatement(condition=MemberReference(member=paddingRequired, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=HOURS, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Duration, selectors=[], type_arguments=None), name=zeroHours)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Duration, 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=TimephasedWork, sub_type=None)), name=padding)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TimephasedWork, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=finishDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setStart, postfix_operators=[], prefix_operators=[], qualifier=padding, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=currentFinish, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setFinish, postfix_operators=[], prefix_operators=[], qualifier=padding, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=zeroHours, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTotalAmount, postfix_operators=[], prefix_operators=[], qualifier=padding, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=zeroHours, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAmountPerDay, postfix_operators=[], prefix_operators=[], qualifier=padding, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=padding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]))]))]), control=EnhancedForControl(iterable=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=assignment)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TimephasedWork, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[TimephasedWork] operator[>] identifier[splitDays] operator[SEP] identifier[ProjectCalendar] identifier[calendar] , identifier[List] operator[<] identifier[TimephasedWork] operator[>] identifier[list] , identifier[TimephasedWork] identifier[first] , identifier[TimephasedWork] identifier[last] operator[SEP] { identifier[List] operator[<] identifier[TimephasedWork] operator[>] identifier[result] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[TimephasedWork] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[TimephasedWork] identifier[assignment] operator[:] identifier[list] operator[SEP] { identifier[Date] identifier[startDate] operator[=] identifier[assignment] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[Date] identifier[finishDate] operator[=] identifier[assignment] operator[SEP] identifier[getFinish] operator[SEP] operator[SEP] operator[SEP] identifier[Date] identifier[startDay] operator[=] identifier[DateHelper] operator[SEP] identifier[getDayStartDate] operator[SEP] identifier[startDate] operator[SEP] operator[SEP] identifier[Date] identifier[finishDay] operator[=] identifier[DateHelper] operator[SEP] identifier[getDayStartDate] operator[SEP] identifier[finishDate] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[startDay] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[==] identifier[finishDay] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] { identifier[Date] identifier[startTime] operator[=] identifier[calendar] operator[SEP] identifier[getStartTime] operator[SEP] identifier[startDay] operator[SEP] operator[SEP] identifier[Date] identifier[currentStart] operator[=] identifier[DateHelper] operator[SEP] identifier[setTime] operator[SEP] identifier[startDay] , identifier[startTime] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[startDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[>] identifier[currentStart] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] { Keyword[boolean] identifier[paddingRequired] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[last] operator[!=] Other[null] operator[SEP] { identifier[Date] identifier[lastFinish] operator[=] identifier[last] operator[SEP] identifier[getFinish] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastFinish] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[==] identifier[startDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] { identifier[paddingRequired] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[Date] identifier[lastFinishDay] operator[=] identifier[DateHelper] operator[SEP] identifier[getDayStartDate] operator[SEP] identifier[lastFinish] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[startDay] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[==] identifier[lastFinishDay] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] { identifier[currentStart] operator[=] identifier[lastFinish] operator[SEP] } } } Keyword[if] operator[SEP] identifier[paddingRequired] operator[SEP] { identifier[Duration] identifier[zeroHours] operator[=] identifier[Duration] operator[SEP] identifier[getInstance] operator[SEP] Other[0] , identifier[TimeUnit] operator[SEP] identifier[HOURS] operator[SEP] operator[SEP] identifier[TimephasedWork] identifier[padding] operator[=] Keyword[new] identifier[TimephasedWork] operator[SEP] operator[SEP] operator[SEP] identifier[padding] operator[SEP] identifier[setStart] operator[SEP] identifier[currentStart] operator[SEP] operator[SEP] identifier[padding] operator[SEP] identifier[setFinish] operator[SEP] identifier[startDate] operator[SEP] operator[SEP] identifier[padding] operator[SEP] identifier[setTotalAmount] operator[SEP] identifier[zeroHours] operator[SEP] operator[SEP] identifier[padding] operator[SEP] identifier[setAmountPerDay] operator[SEP] identifier[zeroHours] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[padding] operator[SEP] operator[SEP] } } identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[assignment] operator[SEP] operator[SEP] identifier[Date] identifier[endTime] operator[=] identifier[calendar] operator[SEP] identifier[getFinishTime] operator[SEP] identifier[startDay] operator[SEP] operator[SEP] identifier[Date] identifier[currentFinish] operator[=] identifier[DateHelper] operator[SEP] identifier[setTime] operator[SEP] identifier[startDay] , identifier[endTime] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[finishDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[<] identifier[currentFinish] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] { Keyword[boolean] identifier[paddingRequired] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[first] operator[!=] Other[null] operator[SEP] { identifier[Date] identifier[firstStart] operator[=] identifier[first] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[firstStart] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[==] identifier[finishDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] { identifier[paddingRequired] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[Date] identifier[firstStartDay] operator[=] identifier[DateHelper] operator[SEP] identifier[getDayStartDate] operator[SEP] identifier[firstStart] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[finishDay] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[==] identifier[firstStartDay] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] { identifier[currentFinish] operator[=] identifier[firstStart] operator[SEP] } } } Keyword[if] operator[SEP] identifier[paddingRequired] operator[SEP] { identifier[Duration] identifier[zeroHours] operator[=] identifier[Duration] operator[SEP] identifier[getInstance] operator[SEP] Other[0] , identifier[TimeUnit] operator[SEP] identifier[HOURS] operator[SEP] operator[SEP] identifier[TimephasedWork] identifier[padding] operator[=] Keyword[new] identifier[TimephasedWork] operator[SEP] operator[SEP] operator[SEP] identifier[padding] operator[SEP] identifier[setStart] operator[SEP] identifier[finishDate] operator[SEP] operator[SEP] identifier[padding] operator[SEP] identifier[setFinish] operator[SEP] identifier[currentFinish] operator[SEP] operator[SEP] identifier[padding] operator[SEP] identifier[setTotalAmount] operator[SEP] identifier[zeroHours] operator[SEP] operator[SEP] identifier[padding] operator[SEP] identifier[setAmountPerDay] operator[SEP] identifier[zeroHours] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[padding] operator[SEP] operator[SEP] } } } Keyword[else] { identifier[Date] identifier[currentStart] operator[=] identifier[startDate] operator[SEP] Keyword[boolean] identifier[isWorking] operator[=] identifier[calendar] operator[SEP] identifier[isWorkingDate] operator[SEP] identifier[currentStart] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[currentStart] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[<] identifier[finishDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isWorking] operator[SEP] { identifier[Date] identifier[endTime] operator[=] identifier[calendar] operator[SEP] identifier[getFinishTime] operator[SEP] identifier[currentStart] operator[SEP] operator[SEP] identifier[Date] identifier[currentFinish] operator[=] identifier[DateHelper] operator[SEP] identifier[setTime] operator[SEP] identifier[currentStart] , identifier[endTime] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentFinish] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[>] identifier[finishDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] { identifier[currentFinish] operator[=] identifier[finishDate] operator[SEP] } identifier[TimephasedWork] identifier[split] operator[=] Keyword[new] identifier[TimephasedWork] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] identifier[setStart] operator[SEP] identifier[currentStart] operator[SEP] operator[SEP] identifier[split] operator[SEP] identifier[setFinish] operator[SEP] identifier[currentFinish] operator[SEP] operator[SEP] identifier[split] operator[SEP] identifier[setTotalAmount] operator[SEP] identifier[assignment] operator[SEP] identifier[getAmountPerDay] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] identifier[setAmountPerDay] operator[SEP] identifier[assignment] operator[SEP] identifier[getAmountPerDay] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[split] operator[SEP] operator[SEP] } identifier[Calendar] identifier[cal] operator[=] identifier[DateHelper] operator[SEP] identifier[popCalendar] operator[SEP] identifier[currentStart] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[add] operator[SEP] identifier[Calendar] operator[SEP] identifier[DAY_OF_YEAR] , Other[1] operator[SEP] operator[SEP] identifier[currentStart] operator[=] identifier[cal] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] identifier[isWorking] operator[=] identifier[calendar] operator[SEP] identifier[isWorkingDate] operator[SEP] identifier[currentStart] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isWorking] operator[SEP] { identifier[Date] identifier[startTime] operator[=] identifier[calendar] operator[SEP] identifier[getStartTime] operator[SEP] identifier[currentStart] operator[SEP] operator[SEP] identifier[DateHelper] operator[SEP] identifier[setTime] operator[SEP] identifier[cal] , identifier[startTime] operator[SEP] operator[SEP] identifier[currentStart] operator[=] identifier[cal] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] } identifier[DateHelper] operator[SEP] identifier[pushCalendar] operator[SEP] identifier[cal] operator[SEP] operator[SEP] } } } Keyword[return] identifier[result] operator[SEP] }
public StringConstant getString(String name) { for (int i = 0; i < _entries.size(); i++) { ConstantPoolEntry entry = _entries.get(i); if (! (entry instanceof StringConstant)) continue; StringConstant stringEntry = (StringConstant) entry; if (stringEntry.getString().equals(name)) return stringEntry; } return null; }
class class_name[name] begin[{] method[getString, return_type[type[StringConstant]], modifier[public], parameter[name]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=_entries, selectors=[], type_arguments=None), name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConstantPoolEntry, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=StringConstant, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=StringConstant, sub_type=None)), name=stringEntry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringConstant, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getString, postfix_operators=[], prefix_operators=[], qualifier=stringEntry, selectors=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=stringEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=_entries, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[StringConstant] identifier[getString] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[_entries] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[ConstantPoolEntry] identifier[entry] operator[=] identifier[_entries] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[entry] Keyword[instanceof] identifier[StringConstant] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[StringConstant] identifier[stringEntry] operator[=] operator[SEP] identifier[StringConstant] operator[SEP] identifier[entry] operator[SEP] Keyword[if] operator[SEP] identifier[stringEntry] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] identifier[stringEntry] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
@SuppressWarnings("unchecked") public <T> Macros with(Macro<T> macro) { Class<?> type = Type.supertype(Macro.class, Type.raw(macro.getClass())).parameter(0).rawType; return with((Class<? super T>) type, macro); }
class class_name[name] begin[{] method[with, return_type[type[Macros]], modifier[public], parameter[macro]] begin[{] local_variable[type[Class], type] return[call[.with, parameter[Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=super, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Class, sub_type=None)), member[.macro]]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[T] operator[>] identifier[Macros] identifier[with] operator[SEP] identifier[Macro] operator[<] identifier[T] operator[>] identifier[macro] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[=] identifier[Type] operator[SEP] identifier[supertype] operator[SEP] identifier[Macro] operator[SEP] Keyword[class] , identifier[Type] operator[SEP] identifier[raw] operator[SEP] identifier[macro] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[parameter] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[rawType] operator[SEP] Keyword[return] identifier[with] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[super] identifier[T] operator[>] operator[SEP] identifier[type] , identifier[macro] operator[SEP] operator[SEP] }
@Override public EClass getIfcShearModulusMeasure() { if (ifcShearModulusMeasureEClass == null) { ifcShearModulusMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(863); } return ifcShearModulusMeasureEClass; }
class class_name[name] begin[{] method[getIfcShearModulusMeasure, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcShearModulusMeasureEClass], ==, literal[null]]] begin[{] assign[member[.ifcShearModulusMeasureEClass], 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=863)], 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[.ifcShearModulusMeasureEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcShearModulusMeasure] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcShearModulusMeasureEClass] operator[==] Other[null] operator[SEP] { identifier[ifcShearModulusMeasureEClass] 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[863] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcShearModulusMeasureEClass] operator[SEP] }
public static ImmutableLongArray copyOf(LongStream stream) { // Note this uses very different growth behavior from copyOf(Iterable) and the builder. long[] array = stream.toArray(); return (array.length == 0) ? EMPTY : new ImmutableLongArray(array); }
class class_name[name] begin[{] method[copyOf, return_type[type[ImmutableLongArray]], modifier[public static], parameter[stream]] begin[{] local_variable[type[long], array] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=array, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=ClassCreator(arguments=[MemberReference(member=array, 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=ImmutableLongArray, sub_type=None)), if_true=MemberReference(member=EMPTY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ImmutableLongArray] identifier[copyOf] operator[SEP] identifier[LongStream] identifier[stream] operator[SEP] { Keyword[long] operator[SEP] operator[SEP] identifier[array] operator[=] identifier[stream] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[array] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] operator[?] identifier[EMPTY] operator[:] Keyword[new] identifier[ImmutableLongArray] operator[SEP] identifier[array] operator[SEP] operator[SEP] }
@Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) servletRequest; String uri = request.getRequestURI(); if(!uri.endsWith(".js")) { filterChain.doFilter(servletRequest, servletResponse); return; } // check if we have this in cache if(CACHE.containsKey(uri)) { ModifiedServletResponse cr = CACHE.get(uri); cr.copyToResponse(servletResponse); return; } // not in cache, obtain fresh response HttpServletResponseWrapperImpl wrapper = new HttpServletResponseWrapperImpl(servletResponse); filterChain.doFilter(servletRequest, wrapper); // flush buffer so that we can read everything wrapper.flushBuffer(); // check for empty response byte[] bytes = wrapper.getBytes(); if(bytes == null || bytes.length == 0) { wrapper.copyToResponse(servletResponse); return; } // check if output is of type text/javascript final String type = wrapper.getContentType(); final String encoding = wrapper.getCharacterEncoding(); LOGGER.info("Content encoding being sent to client: " + encoding); LOGGER.info("Content type being sent to client: " + type); // check if we are JS if(type != null && !isJavascript(type)) { // no JS // output as such wrapper.copyToResponse(servletResponse); return; } // add marker that we processed data wrapper.addHeader("X-Jerry-Minified", "true"); // check if this is gzip-compressed bytes byte[] newBytes = bytes; if(isGZip(bytes)) { newBytes = unGZip(bytes); } // check if we have something here if(newBytes == null) { wrapper.copyToResponse(servletResponse); return; } // go ahead and compress this data String jsCode = null; if (encoding != null) { try { jsCode = new String(newBytes, encoding); } catch (UnsupportedEncodingException e) { LOGGER.error("Unable to encode byte response to string for encoding: " + encoding, e); } } else { jsCode = new String(newBytes); } // compress the code String compressedCode = null; try { compressedCode = compressJavascriptEmbedded(uri, jsCode); } catch(Exception e) { LOGGER.error("Unable to compress Javascript at URL: " + uri, e); wrapper.copyToResponse(servletResponse); return; } if(encoding != null) { bytes = compressedCode.getBytes(encoding); } else { bytes = compressedCode.getBytes(); } // create CACHEABLE RESPONSE ResponseUtils.setCacheHeaders(wrapper, DateUtils.ONE_MONTH); ModifiedServletResponse cr = new ModifiedServletResponse(wrapper, bytes); CACHE.put(uri, cr); // write and move ahead cr.copyToResponse(servletResponse); }
class class_name[name] begin[{] method[doFilter, return_type[void], modifier[public], parameter[servletRequest, servletResponse, filterChain]] begin[{] local_variable[type[HttpServletRequest], request] local_variable[type[String], uri] if[call[uri.endsWith, parameter[literal[".js"]]]] begin[{] call[filterChain.doFilter, parameter[member[.servletRequest], member[.servletResponse]]] return[None] else begin[{] None end[}] if[call[CACHE.containsKey, parameter[member[.uri]]]] begin[{] local_variable[type[ModifiedServletResponse], cr] call[cr.copyToResponse, parameter[member[.servletResponse]]] return[None] else begin[{] None end[}] local_variable[type[HttpServletResponseWrapperImpl], wrapper] call[filterChain.doFilter, parameter[member[.servletRequest], member[.wrapper]]] call[wrapper.flushBuffer, parameter[]] local_variable[type[byte], bytes] if[binary_operation[binary_operation[member[.bytes], ==, literal[null]], ||, binary_operation[member[bytes.length], ==, literal[0]]]] begin[{] call[wrapper.copyToResponse, parameter[member[.servletResponse]]] return[None] else begin[{] None end[}] local_variable[type[String], type] local_variable[type[String], encoding] call[LOGGER.info, parameter[binary_operation[literal["Content encoding being sent to client: "], +, member[.encoding]]]] call[LOGGER.info, parameter[binary_operation[literal["Content type being sent to client: "], +, member[.type]]]] if[binary_operation[binary_operation[member[.type], !=, literal[null]], &&, call[.isJavascript, parameter[member[.type]]]]] begin[{] call[wrapper.copyToResponse, parameter[member[.servletResponse]]] return[None] else begin[{] None end[}] call[wrapper.addHeader, parameter[literal["X-Jerry-Minified"], literal["true"]]] local_variable[type[byte], newBytes] if[call[.isGZip, parameter[member[.bytes]]]] begin[{] assign[member[.newBytes], call[.unGZip, parameter[member[.bytes]]]] else begin[{] None end[}] if[binary_operation[member[.newBytes], ==, literal[null]]] begin[{] call[wrapper.copyToResponse, parameter[member[.servletResponse]]] return[None] else begin[{] None end[}] local_variable[type[String], jsCode] if[binary_operation[member[.encoding], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=jsCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=newBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to encode byte response to string for encoding: "), operandr=MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None) else begin[{] assign[member[.jsCode], ClassCreator(arguments=[MemberReference(member=newBytes, 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[}] local_variable[type[String], compressedCode] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=compressedCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compressJavascriptEmbedded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to compress Javascript at URL: "), operandr=MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=servletResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copyToResponse, postfix_operators=[], prefix_operators=[], qualifier=wrapper, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.encoding], !=, literal[null]]] begin[{] assign[member[.bytes], call[compressedCode.getBytes, parameter[member[.encoding]]]] else begin[{] assign[member[.bytes], call[compressedCode.getBytes, parameter[]]] end[}] call[ResponseUtils.setCacheHeaders, parameter[member[.wrapper], member[DateUtils.ONE_MONTH]]] local_variable[type[ModifiedServletResponse], cr] call[CACHE.put, parameter[member[.uri], member[.cr]]] call[cr.copyToResponse, parameter[member[.servletResponse]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doFilter] operator[SEP] identifier[ServletRequest] identifier[servletRequest] , identifier[ServletResponse] identifier[servletResponse] , identifier[FilterChain] identifier[filterChain] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] { identifier[HttpServletRequest] identifier[request] operator[=] operator[SEP] identifier[HttpServletRequest] operator[SEP] identifier[servletRequest] operator[SEP] identifier[String] identifier[uri] operator[=] identifier[request] operator[SEP] identifier[getRequestURI] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[uri] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[filterChain] operator[SEP] identifier[doFilter] operator[SEP] identifier[servletRequest] , identifier[servletResponse] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[CACHE] operator[SEP] identifier[containsKey] operator[SEP] identifier[uri] operator[SEP] operator[SEP] { identifier[ModifiedServletResponse] identifier[cr] operator[=] identifier[CACHE] operator[SEP] identifier[get] operator[SEP] identifier[uri] operator[SEP] operator[SEP] identifier[cr] operator[SEP] identifier[copyToResponse] operator[SEP] identifier[servletResponse] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[HttpServletResponseWrapperImpl] identifier[wrapper] operator[=] Keyword[new] identifier[HttpServletResponseWrapperImpl] operator[SEP] identifier[servletResponse] operator[SEP] operator[SEP] identifier[filterChain] operator[SEP] identifier[doFilter] operator[SEP] identifier[servletRequest] , identifier[wrapper] operator[SEP] operator[SEP] identifier[wrapper] operator[SEP] identifier[flushBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] identifier[wrapper] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bytes] operator[==] Other[null] operator[||] identifier[bytes] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { identifier[wrapper] operator[SEP] identifier[copyToResponse] operator[SEP] identifier[servletResponse] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[final] identifier[String] identifier[type] operator[=] identifier[wrapper] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[encoding] operator[=] identifier[wrapper] operator[SEP] identifier[getCharacterEncoding] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[encoding] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[type] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[!=] Other[null] operator[&&] operator[!] identifier[isJavascript] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[wrapper] operator[SEP] identifier[copyToResponse] operator[SEP] identifier[servletResponse] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[wrapper] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[newBytes] operator[=] identifier[bytes] operator[SEP] Keyword[if] operator[SEP] identifier[isGZip] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] { identifier[newBytes] operator[=] identifier[unGZip] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[newBytes] operator[==] Other[null] operator[SEP] { identifier[wrapper] operator[SEP] identifier[copyToResponse] operator[SEP] identifier[servletResponse] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[String] identifier[jsCode] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[encoding] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[jsCode] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[newBytes] , identifier[encoding] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[encoding] , identifier[e] operator[SEP] operator[SEP] } } Keyword[else] { identifier[jsCode] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[newBytes] operator[SEP] operator[SEP] } identifier[String] identifier[compressedCode] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[compressedCode] operator[=] identifier[compressJavascriptEmbedded] operator[SEP] identifier[uri] , identifier[jsCode] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[uri] , identifier[e] operator[SEP] operator[SEP] identifier[wrapper] operator[SEP] identifier[copyToResponse] operator[SEP] identifier[servletResponse] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[encoding] operator[!=] Other[null] operator[SEP] { identifier[bytes] operator[=] identifier[compressedCode] operator[SEP] identifier[getBytes] operator[SEP] identifier[encoding] operator[SEP] operator[SEP] } Keyword[else] { identifier[bytes] operator[=] identifier[compressedCode] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] } identifier[ResponseUtils] operator[SEP] identifier[setCacheHeaders] operator[SEP] identifier[wrapper] , identifier[DateUtils] operator[SEP] identifier[ONE_MONTH] operator[SEP] operator[SEP] identifier[ModifiedServletResponse] identifier[cr] operator[=] Keyword[new] identifier[ModifiedServletResponse] operator[SEP] identifier[wrapper] , identifier[bytes] operator[SEP] operator[SEP] identifier[CACHE] operator[SEP] identifier[put] operator[SEP] identifier[uri] , identifier[cr] operator[SEP] operator[SEP] identifier[cr] operator[SEP] identifier[copyToResponse] operator[SEP] identifier[servletResponse] operator[SEP] operator[SEP] }
private boolean isPathContaining(String otherPath) { if (otherPath == null) { return false; } if (DatasetDescriptorConfigKeys.DATASET_DESCRIPTOR_CONFIG_ANY.equals(this.getPath())) { return true; } if (PathUtils.isGlob(new Path(otherPath))) { return false; } GlobPattern globPattern = new GlobPattern(this.getPath()); return globPattern.matches(otherPath); }
class class_name[name] begin[{] method[isPathContaining, return_type[type[boolean]], modifier[private], parameter[otherPath]] begin[{] if[binary_operation[member[.otherPath], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[DatasetDescriptorConfigKeys.DATASET_DESCRIPTOR_CONFIG_ANY.equals, parameter[THIS[call[None.getPath, parameter[]]]]]] begin[{] return[literal[true]] else begin[{] None end[}] if[call[PathUtils.isGlob, parameter[ClassCreator(arguments=[MemberReference(member=otherPath, 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=Path, sub_type=None))]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[GlobPattern], globPattern] return[call[globPattern.matches, parameter[member[.otherPath]]]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isPathContaining] operator[SEP] identifier[String] identifier[otherPath] operator[SEP] { Keyword[if] operator[SEP] identifier[otherPath] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[DatasetDescriptorConfigKeys] operator[SEP] identifier[DATASET_DESCRIPTOR_CONFIG_ANY] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[PathUtils] operator[SEP] identifier[isGlob] operator[SEP] Keyword[new] identifier[Path] operator[SEP] identifier[otherPath] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[GlobPattern] identifier[globPattern] operator[=] Keyword[new] identifier[GlobPattern] operator[SEP] Keyword[this] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[globPattern] operator[SEP] identifier[matches] operator[SEP] identifier[otherPath] operator[SEP] operator[SEP] }
private int countTasksShouldPreempt() { int tasksToPreempt = 0; long now = ClusterManager.clock.getTime(); for (PoolGroupSchedulable poolGroup : poolGroupManager.getPoolGroups()) { for (PoolSchedulable pool : poolGroup.getPools()) { if (pool.isStarving(now)) { tasksToPreempt += Math.min(pool.getPending(), pool.getShare() - pool.getGranted()); } } } return tasksToPreempt; }
class class_name[name] begin[{] method[countTasksShouldPreempt, return_type[type[int]], modifier[private], parameter[]] begin[{] local_variable[type[int], tasksToPreempt] local_variable[type[long], now] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=now, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isStarving, postfix_operators=[], prefix_operators=[], qualifier=pool, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tasksToPreempt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPending, postfix_operators=[], prefix_operators=[], qualifier=pool, selectors=[], type_arguments=None), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getShare, postfix_operators=[], prefix_operators=[], qualifier=pool, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getGranted, postfix_operators=[], prefix_operators=[], qualifier=pool, selectors=[], type_arguments=None), operator=-)], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getPools, postfix_operators=[], prefix_operators=[], qualifier=poolGroup, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pool)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PoolSchedulable, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getPoolGroups, postfix_operators=[], prefix_operators=[], qualifier=poolGroupManager, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=poolGroup)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PoolGroupSchedulable, sub_type=None))), label=None) return[member[.tasksToPreempt]] end[}] END[}]
Keyword[private] Keyword[int] identifier[countTasksShouldPreempt] operator[SEP] operator[SEP] { Keyword[int] identifier[tasksToPreempt] operator[=] Other[0] operator[SEP] Keyword[long] identifier[now] operator[=] identifier[ClusterManager] operator[SEP] identifier[clock] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PoolGroupSchedulable] identifier[poolGroup] operator[:] identifier[poolGroupManager] operator[SEP] identifier[getPoolGroups] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[PoolSchedulable] identifier[pool] operator[:] identifier[poolGroup] operator[SEP] identifier[getPools] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[pool] operator[SEP] identifier[isStarving] operator[SEP] identifier[now] operator[SEP] operator[SEP] { identifier[tasksToPreempt] operator[+=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[pool] operator[SEP] identifier[getPending] operator[SEP] operator[SEP] , identifier[pool] operator[SEP] identifier[getShare] operator[SEP] operator[SEP] operator[-] identifier[pool] operator[SEP] identifier[getGranted] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] identifier[tasksToPreempt] operator[SEP] }
private void copyLibraryRecursive(Path input, Path output) throws IOException { for (Path dirItem : Files.list(input).collect(Collectors.toList())) { Path outputName = output.resolve(dirItem.getFileName()); if (Files.isDirectory(dirItem)) { if(!Files.exists(outputName)) Files.createDirectory(outputName); copyLibraryRecursive(dirItem, outputName); } else { Files.copy(dirItem, outputName, StandardCopyOption.REPLACE_EXISTING); } } }
class class_name[name] begin[{] method[copyLibraryRecursive, return_type[void], modifier[private], parameter[input, output]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFileName, postfix_operators=[], prefix_operators=[], qualifier=dirItem, selectors=[], type_arguments=None)], member=resolve, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[], type_arguments=None), name=outputName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=dirItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isDirectory, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dirItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=outputName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=REPLACE_EXISTING, postfix_operators=[], prefix_operators=[], qualifier=StandardCopyOption, selectors=[])], member=copy, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=outputName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exists, postfix_operators=[], prefix_operators=['!'], qualifier=Files, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=outputName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createDirectory, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dirItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=outputName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copyLibraryRecursive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=list, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toList, postfix_operators=[], prefix_operators=[], qualifier=Collectors, selectors=[], type_arguments=None)], member=collect, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dirItem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[copyLibraryRecursive] operator[SEP] identifier[Path] identifier[input] , identifier[Path] identifier[output] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[for] operator[SEP] identifier[Path] identifier[dirItem] operator[:] identifier[Files] operator[SEP] identifier[list] operator[SEP] identifier[input] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Path] identifier[outputName] operator[=] identifier[output] operator[SEP] identifier[resolve] operator[SEP] identifier[dirItem] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Files] operator[SEP] identifier[isDirectory] operator[SEP] identifier[dirItem] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[Files] operator[SEP] identifier[exists] operator[SEP] identifier[outputName] operator[SEP] operator[SEP] identifier[Files] operator[SEP] identifier[createDirectory] operator[SEP] identifier[outputName] operator[SEP] operator[SEP] identifier[copyLibraryRecursive] operator[SEP] identifier[dirItem] , identifier[outputName] operator[SEP] operator[SEP] } Keyword[else] { identifier[Files] operator[SEP] identifier[copy] operator[SEP] identifier[dirItem] , identifier[outputName] , identifier[StandardCopyOption] operator[SEP] identifier[REPLACE_EXISTING] operator[SEP] operator[SEP] } } }
public boolean shouldSelectProperty(String property) { // no restriction if (getRoot().eagerLoad || restrictedProperties == null) { return true; } // explicit restriction if (getRoot().eagerLoad || restrictedProperties.contains(property)) { return true; } return false; }
class class_name[name] begin[{] method[shouldSelectProperty, return_type[type[boolean]], modifier[public], parameter[property]] begin[{] if[binary_operation[call[.getRoot, parameter[]], ||, binary_operation[member[.restrictedProperties], ==, literal[null]]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[call[.getRoot, parameter[]], ||, call[restrictedProperties.contains, parameter[member[.property]]]]] begin[{] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[shouldSelectProperty] operator[SEP] identifier[String] identifier[property] operator[SEP] { Keyword[if] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] identifier[eagerLoad] operator[||] identifier[restrictedProperties] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] identifier[eagerLoad] operator[||] identifier[restrictedProperties] operator[SEP] identifier[contains] operator[SEP] identifier[property] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public void marshall(ActionExecution actionExecution, ProtocolMarshaller protocolMarshaller) { if (actionExecution == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(actionExecution.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(actionExecution.getSummary(), SUMMARY_BINDING); protocolMarshaller.marshall(actionExecution.getLastStatusChange(), LASTSTATUSCHANGE_BINDING); protocolMarshaller.marshall(actionExecution.getToken(), TOKEN_BINDING); protocolMarshaller.marshall(actionExecution.getLastUpdatedBy(), LASTUPDATEDBY_BINDING); protocolMarshaller.marshall(actionExecution.getExternalExecutionId(), EXTERNALEXECUTIONID_BINDING); protocolMarshaller.marshall(actionExecution.getExternalExecutionUrl(), EXTERNALEXECUTIONURL_BINDING); protocolMarshaller.marshall(actionExecution.getPercentComplete(), PERCENTCOMPLETE_BINDING); protocolMarshaller.marshall(actionExecution.getErrorDetails(), ERRORDETAILS_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[actionExecution, protocolMarshaller]] begin[{] if[binary_operation[member[.actionExecution], ==, 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=getStatus, postfix_operators=[], prefix_operators=[], qualifier=actionExecution, selectors=[], type_arguments=None), MemberReference(member=STATUS_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=getSummary, postfix_operators=[], prefix_operators=[], qualifier=actionExecution, selectors=[], type_arguments=None), MemberReference(member=SUMMARY_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=getLastStatusChange, postfix_operators=[], prefix_operators=[], qualifier=actionExecution, selectors=[], type_arguments=None), MemberReference(member=LASTSTATUSCHANGE_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=getToken, postfix_operators=[], prefix_operators=[], qualifier=actionExecution, selectors=[], type_arguments=None), MemberReference(member=TOKEN_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=getLastUpdatedBy, postfix_operators=[], prefix_operators=[], qualifier=actionExecution, selectors=[], type_arguments=None), MemberReference(member=LASTUPDATEDBY_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=getExternalExecutionId, postfix_operators=[], prefix_operators=[], qualifier=actionExecution, selectors=[], type_arguments=None), MemberReference(member=EXTERNALEXECUTIONID_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=getExternalExecutionUrl, postfix_operators=[], prefix_operators=[], qualifier=actionExecution, selectors=[], type_arguments=None), MemberReference(member=EXTERNALEXECUTIONURL_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=getPercentComplete, postfix_operators=[], prefix_operators=[], qualifier=actionExecution, selectors=[], type_arguments=None), MemberReference(member=PERCENTCOMPLETE_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=getErrorDetails, postfix_operators=[], prefix_operators=[], qualifier=actionExecution, selectors=[], type_arguments=None), MemberReference(member=ERRORDETAILS_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[ActionExecution] identifier[actionExecution] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[actionExecution] 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[actionExecution] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[STATUS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[actionExecution] operator[SEP] identifier[getSummary] operator[SEP] operator[SEP] , identifier[SUMMARY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[actionExecution] operator[SEP] identifier[getLastStatusChange] operator[SEP] operator[SEP] , identifier[LASTSTATUSCHANGE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[actionExecution] operator[SEP] identifier[getToken] operator[SEP] operator[SEP] , identifier[TOKEN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[actionExecution] operator[SEP] identifier[getLastUpdatedBy] operator[SEP] operator[SEP] , identifier[LASTUPDATEDBY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[actionExecution] operator[SEP] identifier[getExternalExecutionId] operator[SEP] operator[SEP] , identifier[EXTERNALEXECUTIONID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[actionExecution] operator[SEP] identifier[getExternalExecutionUrl] operator[SEP] operator[SEP] , identifier[EXTERNALEXECUTIONURL_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[actionExecution] operator[SEP] identifier[getPercentComplete] operator[SEP] operator[SEP] , identifier[PERCENTCOMPLETE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[actionExecution] operator[SEP] identifier[getErrorDetails] operator[SEP] operator[SEP] , identifier[ERRORDETAILS_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] } }
@Override protected String initValuesImpl(final FieldCase ca) { double summe = 0; boolean found = false; for (ConstraintWrap constraint : summands) { Double d = constraint.getSum(ca); if (d != null) { found = true; summe += d; } } // a string is only returned if there is at least one value found, otherwise Null if (found) { return format.format(summe); } return null; }
class class_name[name] begin[{] method[initValuesImpl, return_type[type[String]], modifier[protected], parameter[ca]] begin[{] local_variable[type[double], summe] local_variable[type[boolean], found] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ca, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSum, postfix_operators=[], prefix_operators=[], qualifier=constraint, selectors=[], type_arguments=None), name=d)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=summe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=summands, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=constraint)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConstraintWrap, sub_type=None))), label=None) if[member[.found]] begin[{] return[call[format.format, parameter[member[.summe]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[String] identifier[initValuesImpl] operator[SEP] Keyword[final] identifier[FieldCase] identifier[ca] operator[SEP] { Keyword[double] identifier[summe] operator[=] Other[0] operator[SEP] Keyword[boolean] identifier[found] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[ConstraintWrap] identifier[constraint] operator[:] identifier[summands] operator[SEP] { identifier[Double] identifier[d] operator[=] identifier[constraint] operator[SEP] identifier[getSum] operator[SEP] identifier[ca] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[d] operator[!=] Other[null] operator[SEP] { identifier[found] operator[=] literal[boolean] operator[SEP] identifier[summe] operator[+=] identifier[d] operator[SEP] } } Keyword[if] operator[SEP] identifier[found] operator[SEP] { Keyword[return] identifier[format] operator[SEP] identifier[format] operator[SEP] identifier[summe] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler, ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) { if (discoveredEndpoint != null) { request.setEndpoint(discoveredEndpoint); request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery"); } else if (uriFromEndpointTrait != null) { request.setEndpoint(uriFromEndpointTrait); } else { request.setEndpoint(endpoint); } request.setTimeOffset(timeOffset); HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata() .withCustomErrorCodeFieldName("code")); return client.execute(request, responseHandler, errorResponseHandler, executionContext); }
class class_name[name] begin[{] method[doInvoke, return_type[type[Response]], modifier[private], parameter[request, responseHandler, executionContext, discoveredEndpoint, uriFromEndpointTrait]] begin[{] if[binary_operation[member[.discoveredEndpoint], !=, literal[null]]] begin[{] call[request.setEndpoint, parameter[member[.discoveredEndpoint]]] call[request.getOriginalRequest, parameter[]] else begin[{] if[binary_operation[member[.uriFromEndpointTrait], !=, literal[null]]] begin[{] call[request.setEndpoint, parameter[member[.uriFromEndpointTrait]]] else begin[{] call[request.setEndpoint, parameter[member[.endpoint]]] end[}] end[}] call[request.setTimeOffset, parameter[member[.timeOffset]]] local_variable[type[HttpResponseHandler], errorResponseHandler] return[call[client.execute, parameter[member[.request], member[.responseHandler], member[.errorResponseHandler], member[.executionContext]]]] end[}] END[}]
Keyword[private] operator[<] identifier[X] , identifier[Y] Keyword[extends] identifier[AmazonWebServiceRequest] operator[>] identifier[Response] operator[<] identifier[X] operator[>] identifier[doInvoke] operator[SEP] identifier[Request] operator[<] identifier[Y] operator[>] identifier[request] , identifier[HttpResponseHandler] operator[<] identifier[AmazonWebServiceResponse] operator[<] identifier[X] operator[>] operator[>] identifier[responseHandler] , identifier[ExecutionContext] identifier[executionContext] , identifier[URI] identifier[discoveredEndpoint] , identifier[URI] identifier[uriFromEndpointTrait] operator[SEP] { Keyword[if] operator[SEP] identifier[discoveredEndpoint] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[setEndpoint] operator[SEP] identifier[discoveredEndpoint] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[getOriginalRequest] operator[SEP] operator[SEP] operator[SEP] identifier[getRequestClientOptions] operator[SEP] operator[SEP] operator[SEP] identifier[appendUserAgent] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[uriFromEndpointTrait] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[setEndpoint] operator[SEP] identifier[uriFromEndpointTrait] operator[SEP] operator[SEP] } Keyword[else] { identifier[request] operator[SEP] identifier[setEndpoint] operator[SEP] identifier[endpoint] operator[SEP] operator[SEP] } identifier[request] operator[SEP] identifier[setTimeOffset] operator[SEP] identifier[timeOffset] operator[SEP] operator[SEP] identifier[HttpResponseHandler] operator[<] identifier[AmazonServiceException] operator[>] identifier[errorResponseHandler] operator[=] identifier[protocolFactory] operator[SEP] identifier[createErrorResponseHandler] operator[SEP] Keyword[new] identifier[JsonErrorResponseMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[withCustomErrorCodeFieldName] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[client] operator[SEP] identifier[execute] operator[SEP] identifier[request] , identifier[responseHandler] , identifier[errorResponseHandler] , identifier[executionContext] operator[SEP] operator[SEP] }
public ServiceFuture<List<AvailablePrebuiltEntityModel>> listPrebuiltEntitiesAsync(UUID appId, String versionId, final ServiceCallback<List<AvailablePrebuiltEntityModel>> serviceCallback) { return ServiceFuture.fromResponse(listPrebuiltEntitiesWithServiceResponseAsync(appId, versionId), serviceCallback); }
class class_name[name] begin[{] method[listPrebuiltEntitiesAsync, return_type[type[ServiceFuture]], modifier[public], parameter[appId, versionId, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.listPrebuiltEntitiesWithServiceResponseAsync, parameter[member[.appId], member[.versionId]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[AvailablePrebuiltEntityModel] operator[>] operator[>] identifier[listPrebuiltEntitiesAsync] operator[SEP] identifier[UUID] identifier[appId] , identifier[String] identifier[versionId] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[List] operator[<] identifier[AvailablePrebuiltEntityModel] operator[>] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[listPrebuiltEntitiesWithServiceResponseAsync] operator[SEP] identifier[appId] , identifier[versionId] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
public int getChunkForKey(byte[] key) throws IllegalStateException { if(numChunks == 0) { throw new IllegalStateException("The ChunkedFileSet is closed."); } switch(storageFormat) { case READONLY_V0: { return ReadOnlyUtils.chunk(ByteUtils.md5(key), numChunks); } case READONLY_V1: { if(nodePartitionIds == null) { throw new IllegalStateException("nodePartitionIds is null."); } List<Integer> routingPartitionList = routingStrategy.getPartitionList(key); routingPartitionList.retainAll(nodePartitionIds); if(routingPartitionList.size() != 1) { throw new IllegalStateException("The key does not belong on this node."); } return chunkIdToChunkStart.get(routingPartitionList.get(0)) + ReadOnlyUtils.chunk(ByteUtils.md5(key), chunkIdToNumChunks.get(routingPartitionList.get(0))); } case READONLY_V2: { List<Integer> routingPartitionList = routingStrategy.getPartitionList(key); Pair<Integer, Integer> bucket = null; for(int replicaType = 0; replicaType < routingPartitionList.size(); replicaType++) { if(nodePartitionIds == null) { throw new IllegalStateException("nodePartitionIds is null."); } if(nodePartitionIds.contains(routingPartitionList.get(replicaType))) { if(bucket == null) { bucket = Pair.create(routingPartitionList.get(0), replicaType); } else { throw new IllegalStateException("Found more than one replica for a given partition on the current node!"); } } } if(bucket == null) { throw new IllegalStateException("The key does not belong on this node."); } Integer chunkStart = chunkIdToChunkStart.get(bucket); if (chunkStart == null) { throw new IllegalStateException("chunkStart is null."); } return chunkStart + ReadOnlyUtils.chunk(ByteUtils.md5(key), chunkIdToNumChunks.get(bucket)); } default: { throw new IllegalStateException("Unsupported storageFormat: " + storageFormat); } } }
class class_name[name] begin[{] method[getChunkForKey, return_type[type[int]], modifier[public], parameter[key]] begin[{] if[binary_operation[member[.numChunks], ==, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The ChunkedFileSet is closed.")], 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[}] SwitchStatement(cases=[SwitchStatementCase(case=['READONLY_V0'], statements=[BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=md5, postfix_operators=[], prefix_operators=[], qualifier=ByteUtils, selectors=[], type_arguments=None), MemberReference(member=numChunks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=chunk, postfix_operators=[], prefix_operators=[], qualifier=ReadOnlyUtils, selectors=[], type_arguments=None), label=None)])]), SwitchStatementCase(case=['READONLY_V1'], statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=nodePartitionIds, 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=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="nodePartitionIds is null.")], 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)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPartitionList, postfix_operators=[], prefix_operators=[], qualifier=routingStrategy, selectors=[], type_arguments=None), name=routingPartitionList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nodePartitionIds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=retainAll, postfix_operators=[], prefix_operators=[], qualifier=routingPartitionList, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=routingPartitionList, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The key does not belong on this node.")], 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)])), ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=routingPartitionList, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=chunkIdToChunkStart, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=md5, postfix_operators=[], prefix_operators=[], qualifier=ByteUtils, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=routingPartitionList, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=chunkIdToNumChunks, selectors=[], type_arguments=None)], member=chunk, postfix_operators=[], prefix_operators=[], qualifier=ReadOnlyUtils, selectors=[], type_arguments=None), operator=+), label=None)])]), SwitchStatementCase(case=['READONLY_V2'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPartitionList, postfix_operators=[], prefix_operators=[], qualifier=routingStrategy, selectors=[], type_arguments=None), name=routingPartitionList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=bucket)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=Pair, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=nodePartitionIds, 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=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="nodePartitionIds is null.")], 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)])), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=replicaType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=routingPartitionList, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=nodePartitionIds, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Found more than one replica for a given partition on the current node!")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=routingPartitionList, selectors=[], type_arguments=None), MemberReference(member=replicaType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=Pair, selectors=[], type_arguments=None)), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=replicaType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=routingPartitionList, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=replicaType)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=replicaType, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bucket, 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=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The key does not belong on this node.")], 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)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=chunkIdToChunkStart, selectors=[], type_arguments=None), name=chunkStart)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=chunkStart, 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=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="chunkStart is null.")], 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)])), ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=chunkStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=md5, postfix_operators=[], prefix_operators=[], qualifier=ByteUtils, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=chunkIdToNumChunks, selectors=[], type_arguments=None)], member=chunk, postfix_operators=[], prefix_operators=[], qualifier=ReadOnlyUtils, selectors=[], type_arguments=None), operator=+), label=None)])]), SwitchStatementCase(case=[], statements=[BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported storageFormat: "), operandr=MemberReference(member=storageFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)])])], expression=MemberReference(member=storageFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] Keyword[int] identifier[getChunkForKey] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[key] operator[SEP] Keyword[throws] identifier[IllegalStateException] { Keyword[if] operator[SEP] identifier[numChunks] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[switch] operator[SEP] identifier[storageFormat] operator[SEP] { Keyword[case] identifier[READONLY_V0] operator[:] { Keyword[return] identifier[ReadOnlyUtils] operator[SEP] identifier[chunk] operator[SEP] identifier[ByteUtils] operator[SEP] identifier[md5] operator[SEP] identifier[key] operator[SEP] , identifier[numChunks] operator[SEP] operator[SEP] } Keyword[case] identifier[READONLY_V1] operator[:] { Keyword[if] operator[SEP] identifier[nodePartitionIds] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[Integer] operator[>] identifier[routingPartitionList] operator[=] identifier[routingStrategy] operator[SEP] identifier[getPartitionList] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[routingPartitionList] operator[SEP] identifier[retainAll] operator[SEP] identifier[nodePartitionIds] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[routingPartitionList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] Other[1] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[chunkIdToChunkStart] operator[SEP] identifier[get] operator[SEP] identifier[routingPartitionList] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[+] identifier[ReadOnlyUtils] operator[SEP] identifier[chunk] operator[SEP] identifier[ByteUtils] operator[SEP] identifier[md5] operator[SEP] identifier[key] operator[SEP] , identifier[chunkIdToNumChunks] operator[SEP] identifier[get] operator[SEP] identifier[routingPartitionList] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[case] identifier[READONLY_V2] operator[:] { identifier[List] operator[<] identifier[Integer] operator[>] identifier[routingPartitionList] operator[=] identifier[routingStrategy] operator[SEP] identifier[getPartitionList] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[Pair] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[bucket] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[replicaType] operator[=] Other[0] operator[SEP] identifier[replicaType] operator[<] identifier[routingPartitionList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[replicaType] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[nodePartitionIds] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[nodePartitionIds] operator[SEP] identifier[contains] operator[SEP] identifier[routingPartitionList] operator[SEP] identifier[get] operator[SEP] identifier[replicaType] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[bucket] operator[==] Other[null] operator[SEP] { identifier[bucket] operator[=] identifier[Pair] operator[SEP] identifier[create] operator[SEP] identifier[routingPartitionList] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] , identifier[replicaType] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[bucket] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Integer] identifier[chunkStart] operator[=] identifier[chunkIdToChunkStart] operator[SEP] identifier[get] operator[SEP] identifier[bucket] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[chunkStart] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[chunkStart] operator[+] identifier[ReadOnlyUtils] operator[SEP] identifier[chunk] operator[SEP] identifier[ByteUtils] operator[SEP] identifier[md5] operator[SEP] identifier[key] operator[SEP] , identifier[chunkIdToNumChunks] operator[SEP] identifier[get] operator[SEP] identifier[bucket] operator[SEP] operator[SEP] operator[SEP] } Keyword[default] operator[:] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[storageFormat] operator[SEP] operator[SEP] } } }
public static Date getFromTimestamp(Timestamp timestamp) { if (timestamp == null) { return null; } return new Date(timestamp.getTime()); }
class class_name[name] begin[{] method[getFromTimestamp, return_type[type[Date]], modifier[public static], parameter[timestamp]] begin[{] if[binary_operation[member[.timestamp], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=timestamp, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Date] identifier[getFromTimestamp] operator[SEP] identifier[Timestamp] identifier[timestamp] operator[SEP] { Keyword[if] operator[SEP] identifier[timestamp] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] Keyword[new] identifier[Date] operator[SEP] identifier[timestamp] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override final protected void addSinglePoint(int position, int additionalId, long additionalRef, Integer id, Long ref) { addRange(position, position, additionalId, additionalRef, id, ref); }
class class_name[name] begin[{] method[addSinglePoint, return_type[void], modifier[final protected], parameter[position, additionalId, additionalRef, id, ref]] begin[{] call[.addRange, parameter[member[.position], member[.position], member[.additionalId], member[.additionalRef], member[.id], member[.ref]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[final] Keyword[protected] Keyword[void] identifier[addSinglePoint] operator[SEP] Keyword[int] identifier[position] , Keyword[int] identifier[additionalId] , Keyword[long] identifier[additionalRef] , identifier[Integer] identifier[id] , identifier[Long] identifier[ref] operator[SEP] { identifier[addRange] operator[SEP] identifier[position] , identifier[position] , identifier[additionalId] , identifier[additionalRef] , identifier[id] , identifier[ref] operator[SEP] operator[SEP] }
@Override public void requestWake() { try { _state = _state.toWake(); requestLoop(); } catch (Exception e) { log.log(Level.WARNING, e.toString(), e); } /* if (_stateRef.get().toWake(_stateRef)) { offer(getConnectionTask()); } */ }
class class_name[name] begin[{] method[requestWake, return_type[void], modifier[public], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toWake, postfix_operators=[], prefix_operators=[], qualifier=_state, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=requestLoop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[requestWake] operator[SEP] operator[SEP] { Keyword[try] { identifier[_state] operator[=] identifier[_state] operator[SEP] identifier[toWake] operator[SEP] operator[SEP] operator[SEP] identifier[requestLoop] operator[SEP] 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[WARNING] , identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static vpnsessionpolicy_vpnvserver_binding[] get(nitro_service service, String name) throws Exception{ vpnsessionpolicy_vpnvserver_binding obj = new vpnsessionpolicy_vpnvserver_binding(); obj.set_name(name); vpnsessionpolicy_vpnvserver_binding response[] = (vpnsessionpolicy_vpnvserver_binding[]) obj.get_resources(service); return response; }
class class_name[name] begin[{] method[get, return_type[type[vpnsessionpolicy_vpnvserver_binding]], modifier[public static], parameter[service, name]] begin[{] local_variable[type[vpnsessionpolicy_vpnvserver_binding], obj] call[obj.set_name, parameter[member[.name]]] local_variable[type[vpnsessionpolicy_vpnvserver_binding], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[vpnsessionpolicy_vpnvserver_binding] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[Exception] { identifier[vpnsessionpolicy_vpnvserver_binding] identifier[obj] operator[=] Keyword[new] identifier[vpnsessionpolicy_vpnvserver_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_name] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[vpnsessionpolicy_vpnvserver_binding] identifier[response] operator[SEP] operator[SEP] operator[=] operator[SEP] identifier[vpnsessionpolicy_vpnvserver_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[get_resources] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
@SuppressWarnings("unchecked") @Override public void activateAutoRefresh() { final ChangeListener<Object> changeListener = new ChangeListener<Object>() { /** * Called when the value is updated. * * @param value the observable value * @param oldValue the old value * @param newValue the new value */ @Override public void changed(final ObservableValue<? extends Object> value, final Object oldValue, final Object newValue) { if (ObjectUtility.notEquals(oldValue, newValue)) { LOGGER.trace(value.toString() + " has changed"); hasChanged(true); } } }; // Iterate over each field that is a JavaFX Property for (final Field field : this.getClass().getDeclaredFields()) { if (Property.class.isAssignableFrom(field.getDeclaringClass())) { try { ((Property<Object>) field.get(this)).addListener(changeListener); } catch (IllegalArgumentException | IllegalAccessException e) { LOGGER.error("Cannot access to property " + field.getName() + " of class " + this.getClass(), e); } } } }
class class_name[name] begin[{] method[activateAutoRefresh, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[ChangeListener], changeListener] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDeclaringClass, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Property, sub_type=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Cast(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Property, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot access to property "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" of class "), operator=+), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalArgumentException', 'IllegalAccessException']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getDeclaredFields, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=field)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[activateAutoRefresh] operator[SEP] operator[SEP] { Keyword[final] identifier[ChangeListener] operator[<] identifier[Object] operator[>] identifier[changeListener] operator[=] Keyword[new] identifier[ChangeListener] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[changed] operator[SEP] Keyword[final] identifier[ObservableValue] operator[<] operator[?] Keyword[extends] identifier[Object] operator[>] identifier[value] , Keyword[final] identifier[Object] identifier[oldValue] , Keyword[final] identifier[Object] identifier[newValue] operator[SEP] { Keyword[if] operator[SEP] identifier[ObjectUtility] operator[SEP] identifier[notEquals] operator[SEP] identifier[oldValue] , identifier[newValue] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[hasChanged] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } } } operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Field] identifier[field] operator[:] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getDeclaredFields] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[Property] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[field] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { operator[SEP] operator[SEP] identifier[Property] operator[<] identifier[Object] operator[>] operator[SEP] identifier[field] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] operator[SEP] operator[SEP] identifier[addListener] operator[SEP] identifier[changeListener] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] operator[|] identifier[IllegalAccessException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } } }
void clear() { m_cleared = true; m_changed = false; m_file.tryUnlock(); OpenCms.getWorkplaceAppManager().storeAppSettings( A_CmsUI.getCmsObject(), EditorSettings.class, getCurrentSettings()); }
class class_name[name] begin[{] method[clear, return_type[void], modifier[default], parameter[]] begin[{] assign[member[.m_cleared], literal[true]] assign[member[.m_changed], literal[false]] call[m_file.tryUnlock, parameter[]] call[OpenCms.getWorkplaceAppManager, parameter[]] end[}] END[}]
Keyword[void] identifier[clear] operator[SEP] operator[SEP] { identifier[m_cleared] operator[=] literal[boolean] operator[SEP] identifier[m_changed] operator[=] literal[boolean] operator[SEP] identifier[m_file] operator[SEP] identifier[tryUnlock] operator[SEP] operator[SEP] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getWorkplaceAppManager] operator[SEP] operator[SEP] operator[SEP] identifier[storeAppSettings] operator[SEP] identifier[A_CmsUI] operator[SEP] identifier[getCmsObject] operator[SEP] operator[SEP] , identifier[EditorSettings] operator[SEP] Keyword[class] , identifier[getCurrentSettings] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public DescribeTransitGatewayAttachmentsResult describeTransitGatewayAttachments(DescribeTransitGatewayAttachmentsRequest request) { request = beforeClientExecution(request); return executeDescribeTransitGatewayAttachments(request); }
class class_name[name] begin[{] method[describeTransitGatewayAttachments, return_type[type[DescribeTransitGatewayAttachmentsResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDescribeTransitGatewayAttachments, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DescribeTransitGatewayAttachmentsResult] identifier[describeTransitGatewayAttachments] operator[SEP] identifier[DescribeTransitGatewayAttachmentsRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDescribeTransitGatewayAttachments] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public Rule invokableCopy(FunctionRegistry functionRegistry) { final Builder builder = toBuilder(); final Class<? extends GeneratedRule> ruleClass = generatedRuleClass(); if (ruleClass != null) { try { //noinspection unchecked final Set<Constructor> constructors = ReflectionUtils.getConstructors(ruleClass); final Constructor onlyElement = Iterables.getOnlyElement(constructors); final GeneratedRule instance = (GeneratedRule) onlyElement.newInstance(functionRegistry); builder.generatedRule(instance); } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { LOG.warn("Unable to generate code for rule {}: {}", id(), e); } } return builder.build(); }
class class_name[name] begin[{] method[invokableCopy, return_type[type[Rule]], modifier[public], parameter[functionRegistry]] begin[{] local_variable[type[Builder], builder] local_variable[type[Class], ruleClass] if[binary_operation[member[.ruleClass], !=, literal[null]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ruleClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConstructors, postfix_operators=[], prefix_operators=[], qualifier=ReflectionUtils, selectors=[], type_arguments=None), name=constructors)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Constructor, sub_type=None))], dimensions=[], name=Set, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=constructors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOnlyElement, postfix_operators=[], prefix_operators=[], qualifier=Iterables, selectors=[], type_arguments=None), name=onlyElement)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Constructor, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=functionRegistry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=onlyElement, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=GeneratedRule, sub_type=None)), name=instance)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=GeneratedRule, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generatedRule, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to generate code for rule {}: {}"), MethodInvocation(arguments=[], member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException', 'InstantiationException', 'InvocationTargetException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[call[builder.build, parameter[]]] end[}] END[}]
Keyword[public] identifier[Rule] identifier[invokableCopy] operator[SEP] identifier[FunctionRegistry] identifier[functionRegistry] operator[SEP] { Keyword[final] identifier[Builder] identifier[builder] operator[=] identifier[toBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[GeneratedRule] operator[>] identifier[ruleClass] operator[=] identifier[generatedRuleClass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ruleClass] operator[!=] Other[null] operator[SEP] { Keyword[try] { Keyword[final] identifier[Set] operator[<] identifier[Constructor] operator[>] identifier[constructors] operator[=] identifier[ReflectionUtils] operator[SEP] identifier[getConstructors] operator[SEP] identifier[ruleClass] operator[SEP] operator[SEP] Keyword[final] identifier[Constructor] identifier[onlyElement] operator[=] identifier[Iterables] operator[SEP] identifier[getOnlyElement] operator[SEP] identifier[constructors] operator[SEP] operator[SEP] Keyword[final] identifier[GeneratedRule] identifier[instance] operator[=] operator[SEP] identifier[GeneratedRule] operator[SEP] identifier[onlyElement] operator[SEP] identifier[newInstance] operator[SEP] identifier[functionRegistry] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[generatedRule] operator[SEP] identifier[instance] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalAccessException] operator[|] identifier[InstantiationException] operator[|] identifier[InvocationTargetException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[id] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public MobicentsSipApplicationSession findSipApplicationSession(HttpSession httpSession) { for (MobicentsSipApplicationSession sipApplicationSessionImpl : sipApplicationSessions.values()) { if(sipApplicationSessionImpl.findHttpSession(httpSession.getId()) != null) { return sipApplicationSessionImpl; } } return null; }
class class_name[name] begin[{] method[findSipApplicationSession, return_type[type[MobicentsSipApplicationSession]], modifier[public], parameter[httpSession]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=httpSession, selectors=[], type_arguments=None)], member=findHttpSession, postfix_operators=[], prefix_operators=[], qualifier=sipApplicationSessionImpl, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=sipApplicationSessionImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=sipApplicationSessions, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sipApplicationSessionImpl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MobicentsSipApplicationSession, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[MobicentsSipApplicationSession] identifier[findSipApplicationSession] operator[SEP] identifier[HttpSession] identifier[httpSession] operator[SEP] { Keyword[for] operator[SEP] identifier[MobicentsSipApplicationSession] identifier[sipApplicationSessionImpl] operator[:] identifier[sipApplicationSessions] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[sipApplicationSessionImpl] operator[SEP] identifier[findHttpSession] operator[SEP] identifier[httpSession] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[sipApplicationSessionImpl] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { GetField fields = in.readFields(); classLoaderIdentifier = (String) fields.get(CLASS_LOADER_IDENTIFIER, null); // Note that further processing is required in JEEMetadataContextProviderImpl.deserializeThreadContext // in order to re-establish the thread context based on the metadata identifier if not defaulted. }
class class_name[name] begin[{] method[readObject, return_type[void], modifier[private], parameter[in]] begin[{] local_variable[type[GetField], fields] assign[member[.classLoaderIdentifier], Cast(expression=MethodInvocation(arguments=[MemberReference(member=CLASS_LOADER_IDENTIFIER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=get, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))] end[}] END[}]
Keyword[private] Keyword[void] identifier[readObject] operator[SEP] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[ObjectInputStream] identifier[in] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ClassNotFoundException] { identifier[GetField] identifier[fields] operator[=] identifier[in] operator[SEP] identifier[readFields] operator[SEP] operator[SEP] operator[SEP] identifier[classLoaderIdentifier] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[fields] operator[SEP] identifier[get] operator[SEP] identifier[CLASS_LOADER_IDENTIFIER] , Other[null] operator[SEP] operator[SEP] }
private StateListDrawable getSelectorDrawable() { StateListDrawable d = null; try { d = new StateListDrawable(); ShapeDrawable selectedDrawable = new ShapeDrawable(new OvalShape()); selectedDrawable.getPaint().setColor(mItemSelectedColor); selectedDrawable.setIntrinsicHeight(mItemRadius * 2); selectedDrawable.setIntrinsicWidth(mItemRadius * 2); ShapeDrawable unselectedDrawable = new ShapeDrawable(new OvalShape()); unselectedDrawable.getPaint().setColor(mItemUnselectedColor); unselectedDrawable.setIntrinsicHeight(mItemRadius * 2); unselectedDrawable.setIntrinsicWidth(mItemRadius * 2); d.addState(new int[]{android.R.attr.state_checked}, selectedDrawable); d.addState(new int[]{}, unselectedDrawable); } catch(Exception e) { Log.e(TAG, getMessageFor(e)); } return d; }
class class_name[name] begin[{] method[getSelectorDrawable, return_type[type[StateListDrawable]], modifier[private], parameter[]] begin[{] local_variable[type[StateListDrawable], d] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=d, 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=StateListDrawable, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvalShape, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShapeDrawable, sub_type=None)), name=selectedDrawable)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ShapeDrawable, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=getPaint, postfix_operators=[], prefix_operators=[], qualifier=selectedDrawable, selectors=[MethodInvocation(arguments=[MemberReference(member=mItemSelectedColor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setColor, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=mItemRadius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*)], member=setIntrinsicHeight, postfix_operators=[], prefix_operators=[], qualifier=selectedDrawable, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=mItemRadius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*)], member=setIntrinsicWidth, postfix_operators=[], prefix_operators=[], qualifier=selectedDrawable, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvalShape, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShapeDrawable, sub_type=None)), name=unselectedDrawable)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ShapeDrawable, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=getPaint, postfix_operators=[], prefix_operators=[], qualifier=unselectedDrawable, selectors=[MethodInvocation(arguments=[MemberReference(member=mItemUnselectedColor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setColor, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=mItemRadius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*)], member=setIntrinsicHeight, postfix_operators=[], prefix_operators=[], qualifier=unselectedDrawable, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=mItemRadius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*)], member=setIntrinsicWidth, postfix_operators=[], prefix_operators=[], qualifier=unselectedDrawable, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=state_checked, postfix_operators=[], prefix_operators=[], qualifier=android.R.attr, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int)), MemberReference(member=selectedDrawable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addState, postfix_operators=[], prefix_operators=[], qualifier=d, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int)), MemberReference(member=unselectedDrawable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addState, postfix_operators=[], prefix_operators=[], qualifier=d, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMessageFor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=e, 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[member[.d]] end[}] END[}]
Keyword[private] identifier[StateListDrawable] identifier[getSelectorDrawable] operator[SEP] operator[SEP] { identifier[StateListDrawable] identifier[d] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[d] operator[=] Keyword[new] identifier[StateListDrawable] operator[SEP] operator[SEP] operator[SEP] identifier[ShapeDrawable] identifier[selectedDrawable] operator[=] Keyword[new] identifier[ShapeDrawable] operator[SEP] Keyword[new] identifier[OvalShape] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[selectedDrawable] operator[SEP] identifier[getPaint] operator[SEP] operator[SEP] operator[SEP] identifier[setColor] operator[SEP] identifier[mItemSelectedColor] operator[SEP] operator[SEP] identifier[selectedDrawable] operator[SEP] identifier[setIntrinsicHeight] operator[SEP] identifier[mItemRadius] operator[*] Other[2] operator[SEP] operator[SEP] identifier[selectedDrawable] operator[SEP] identifier[setIntrinsicWidth] operator[SEP] identifier[mItemRadius] operator[*] Other[2] operator[SEP] operator[SEP] identifier[ShapeDrawable] identifier[unselectedDrawable] operator[=] Keyword[new] identifier[ShapeDrawable] operator[SEP] Keyword[new] identifier[OvalShape] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[unselectedDrawable] operator[SEP] identifier[getPaint] operator[SEP] operator[SEP] operator[SEP] identifier[setColor] operator[SEP] identifier[mItemUnselectedColor] operator[SEP] operator[SEP] identifier[unselectedDrawable] operator[SEP] identifier[setIntrinsicHeight] operator[SEP] identifier[mItemRadius] operator[*] Other[2] operator[SEP] operator[SEP] identifier[unselectedDrawable] operator[SEP] identifier[setIntrinsicWidth] operator[SEP] identifier[mItemRadius] operator[*] Other[2] operator[SEP] operator[SEP] identifier[d] operator[SEP] identifier[addState] operator[SEP] Keyword[new] Keyword[int] operator[SEP] operator[SEP] { identifier[android] operator[SEP] identifier[R] operator[SEP] identifier[attr] operator[SEP] identifier[state_checked] } , identifier[selectedDrawable] operator[SEP] operator[SEP] identifier[d] operator[SEP] identifier[addState] operator[SEP] Keyword[new] Keyword[int] operator[SEP] operator[SEP] { } , identifier[unselectedDrawable] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[TAG] , identifier[getMessageFor] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[d] operator[SEP] }
private boolean findJavaSourceFiles(String[] args) { String prev = ""; for (String s : args) { if (s.endsWith(".java") && !prev.equals("-xf") && !prev.equals("-if")) { return true; } prev = s; } return false; }
class class_name[name] begin[{] method[findJavaSourceFiles, return_type[type[boolean]], modifier[private], parameter[args]] begin[{] local_variable[type[String], prev] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".java")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-xf")], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=prev, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-if")], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=prev, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[findJavaSourceFiles] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] { identifier[String] identifier[prev] operator[=] literal[String] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[s] operator[:] identifier[args] operator[SEP] { Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[prev] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[prev] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[prev] operator[=] identifier[s] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public void endStatsCollection(long cache1Size, long cache2Size, CacheUse cacheUse, long partitionId) { if (m_currentStartTime != null) { long delta = System.nanoTime() - m_currentStartTime; if (delta < 0) { if (Math.abs(delta) > 1000000000) { log.info("Planner statistics recorded a negative planning time larger than one second: " + delta); } } else { m_totalPlanningTime += delta; m_minPlanningTime = Math.min(delta, m_minPlanningTime); m_maxPlanningTime = Math.max(delta, m_maxPlanningTime); m_lastMinPlanningTime = Math.min(delta, m_lastMinPlanningTime); m_lastMaxPlanningTime = Math.max(delta, m_lastMaxPlanningTime); } m_currentStartTime = null; } m_cache1Level = cache1Size; m_cache2Level = cache2Size; switch(cacheUse) { case HIT1: m_cache1Hits++; break; case HIT2: m_cache2Hits++; break; case MISS: m_cacheMisses++; break; case FAIL: m_failures++; break; } m_invocations++; m_partitionId = partitionId; }
class class_name[name] begin[{] method[endStatsCollection, return_type[void], modifier[public], parameter[cache1Size, cache2Size, cacheUse, partitionId]] begin[{] if[binary_operation[member[.m_currentStartTime], !=, literal[null]]] begin[{] local_variable[type[long], delta] if[binary_operation[member[.delta], <, literal[0]]] begin[{] if[binary_operation[call[Math.abs, parameter[member[.delta]]], >, literal[1000000000]]] begin[{] call[log.info, parameter[binary_operation[literal["Planner statistics recorded a negative planning time larger than one second: "], +, member[.delta]]]] else begin[{] None end[}] else begin[{] assign[member[.m_totalPlanningTime], member[.delta]] assign[member[.m_minPlanningTime], call[Math.min, parameter[member[.delta], member[.m_minPlanningTime]]]] assign[member[.m_maxPlanningTime], call[Math.max, parameter[member[.delta], member[.m_maxPlanningTime]]]] assign[member[.m_lastMinPlanningTime], call[Math.min, parameter[member[.delta], member[.m_lastMinPlanningTime]]]] assign[member[.m_lastMaxPlanningTime], call[Math.max, parameter[member[.delta], member[.m_lastMaxPlanningTime]]]] end[}] assign[member[.m_currentStartTime], literal[null]] else begin[{] None end[}] assign[member[.m_cache1Level], member[.cache1Size]] assign[member[.m_cache2Level], member[.cache2Size]] SwitchStatement(cases=[SwitchStatementCase(case=['HIT1'], statements=[StatementExpression(expression=MemberReference(member=m_cache1Hits, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['HIT2'], statements=[StatementExpression(expression=MemberReference(member=m_cache2Hits, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['MISS'], statements=[StatementExpression(expression=MemberReference(member=m_cacheMisses, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['FAIL'], statements=[StatementExpression(expression=MemberReference(member=m_failures, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=cacheUse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) member[.m_invocations] assign[member[.m_partitionId], member[.partitionId]] end[}] END[}]
Keyword[public] Keyword[void] identifier[endStatsCollection] operator[SEP] Keyword[long] identifier[cache1Size] , Keyword[long] identifier[cache2Size] , identifier[CacheUse] identifier[cacheUse] , Keyword[long] identifier[partitionId] operator[SEP] { Keyword[if] operator[SEP] identifier[m_currentStartTime] operator[!=] Other[null] operator[SEP] { Keyword[long] identifier[delta] operator[=] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[-] identifier[m_currentStartTime] operator[SEP] Keyword[if] operator[SEP] identifier[delta] operator[<] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[delta] operator[SEP] operator[>] Other[1000000000] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[delta] operator[SEP] operator[SEP] } } Keyword[else] { identifier[m_totalPlanningTime] operator[+=] identifier[delta] operator[SEP] identifier[m_minPlanningTime] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[delta] , identifier[m_minPlanningTime] operator[SEP] operator[SEP] identifier[m_maxPlanningTime] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[delta] , identifier[m_maxPlanningTime] operator[SEP] operator[SEP] identifier[m_lastMinPlanningTime] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[delta] , identifier[m_lastMinPlanningTime] operator[SEP] operator[SEP] identifier[m_lastMaxPlanningTime] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[delta] , identifier[m_lastMaxPlanningTime] operator[SEP] operator[SEP] } identifier[m_currentStartTime] operator[=] Other[null] operator[SEP] } identifier[m_cache1Level] operator[=] identifier[cache1Size] operator[SEP] identifier[m_cache2Level] operator[=] identifier[cache2Size] operator[SEP] Keyword[switch] operator[SEP] identifier[cacheUse] operator[SEP] { Keyword[case] identifier[HIT1] operator[:] identifier[m_cache1Hits] operator[++] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[HIT2] operator[:] identifier[m_cache2Hits] operator[++] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[MISS] operator[:] identifier[m_cacheMisses] operator[++] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[FAIL] operator[:] identifier[m_failures] operator[++] operator[SEP] Keyword[break] operator[SEP] } identifier[m_invocations] operator[++] operator[SEP] identifier[m_partitionId] operator[=] identifier[partitionId] operator[SEP] }
@Override public T inject(com.ibm.wsspi.injectionengine.InjectionTarget[] targets, InjectionTargetContext injectionContext) throws ManagedObjectException { T instance = getObject(); synchronized (this) { //we really don't want inject being called twice at the same time try { this.currentInjectionTargets = new HashSet<>(); this.currentInjectionContext = injectionContext; this.websphereInjectionServices.registerInjectionTargetListener(this); //save away the list of current WS Injection Targets for (com.ibm.wsspi.injectionengine.InjectionTarget it : targets) { this.currentInjectionTargets.add(it); } //use Weld to do the CDI injection instance = cdiInjection(instance); //when cdi injection occurs, we will "cross off" some of the injection targets as they are processed //if there are any left then we directly use the injection engine to do the injection for those targets for (com.ibm.wsspi.injectionengine.InjectionTarget it : this.currentInjectionTargets) { if (it.getInjectionBinding().getAnnotationType() != Inject.class) { try { it.inject(instance, injectionContext); } catch (InjectionException e) { throw new ManagedObjectException(e); } } } } finally { //always tidy up before we release the lock this.websphereInjectionServices.deregisterInjectionTargetListener(this); this.currentInjectionContext = null; this.currentInjectionTargets = null; } } return instance; }
class class_name[name] begin[{] method[inject, return_type[type[T]], modifier[public], parameter[targets, injectionContext]] begin[{] local_variable[type[T], instance] SYNCHRONIZED[THIS[]] BEGIN[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=currentInjectionTargets, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=currentInjectionContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=injectionContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=websphereInjectionServices, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=registerInjectionTargetListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=currentInjectionTargets, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=it, 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=targets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=ibm, sub_type=ReferenceType(arguments=None, dimensions=None, name=wsspi, sub_type=ReferenceType(arguments=None, dimensions=None, name=injectionengine, sub_type=ReferenceType(arguments=None, dimensions=None, name=InjectionTarget, sub_type=None))))))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cdiInjection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getInjectionBinding, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[MethodInvocation(arguments=[], member=getAnnotationType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Inject, sub_type=None)), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=injectionContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=inject, postfix_operators=[], prefix_operators=[], qualifier=it, 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=ManagedObjectException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InjectionException']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=currentInjectionTargets, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=ibm, sub_type=ReferenceType(arguments=None, dimensions=None, name=wsspi, sub_type=ReferenceType(arguments=None, dimensions=None, name=injectionengine, sub_type=ReferenceType(arguments=None, dimensions=None, name=InjectionTarget, sub_type=None))))))), label=None)], catches=None, finally_block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=websphereInjectionServices, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=deregisterInjectionTargetListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=currentInjectionContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=currentInjectionTargets, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None) END[}] return[member[.instance]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[inject] operator[SEP] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[wsspi] operator[SEP] identifier[injectionengine] operator[SEP] identifier[InjectionTarget] operator[SEP] operator[SEP] identifier[targets] , identifier[InjectionTargetContext] identifier[injectionContext] operator[SEP] Keyword[throws] identifier[ManagedObjectException] { identifier[T] identifier[instance] operator[=] identifier[getObject] operator[SEP] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { Keyword[try] { Keyword[this] operator[SEP] identifier[currentInjectionTargets] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[currentInjectionContext] operator[=] identifier[injectionContext] operator[SEP] Keyword[this] operator[SEP] identifier[websphereInjectionServices] operator[SEP] identifier[registerInjectionTargetListener] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[wsspi] operator[SEP] identifier[injectionengine] operator[SEP] identifier[InjectionTarget] identifier[it] operator[:] identifier[targets] operator[SEP] { Keyword[this] operator[SEP] identifier[currentInjectionTargets] operator[SEP] identifier[add] operator[SEP] identifier[it] operator[SEP] operator[SEP] } identifier[instance] operator[=] identifier[cdiInjection] operator[SEP] identifier[instance] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[wsspi] operator[SEP] identifier[injectionengine] operator[SEP] identifier[InjectionTarget] identifier[it] operator[:] Keyword[this] operator[SEP] identifier[currentInjectionTargets] operator[SEP] { Keyword[if] operator[SEP] identifier[it] operator[SEP] identifier[getInjectionBinding] operator[SEP] operator[SEP] operator[SEP] identifier[getAnnotationType] operator[SEP] operator[SEP] operator[!=] identifier[Inject] operator[SEP] Keyword[class] operator[SEP] { Keyword[try] { identifier[it] operator[SEP] identifier[inject] operator[SEP] identifier[instance] , identifier[injectionContext] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InjectionException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ManagedObjectException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } } } Keyword[finally] { Keyword[this] operator[SEP] identifier[websphereInjectionServices] operator[SEP] identifier[deregisterInjectionTargetListener] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[currentInjectionContext] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[currentInjectionTargets] operator[=] Other[null] operator[SEP] } } Keyword[return] identifier[instance] operator[SEP] }
void start(final Context context) { checkConversationQueue(); ApptentiveLog.i(TROUBLESHOOT, "Overriding log level: " + VERBOSE); oldLogLevel = ApptentiveLog.getLogLevel(); ApptentiveLog.overrideLogLevel(VERBOSE); // show debug notification showDebugNotification(context); }
class class_name[name] begin[{] method[start, return_type[void], modifier[default], parameter[context]] begin[{] call[.checkConversationQueue, parameter[]] call[ApptentiveLog.i, parameter[member[.TROUBLESHOOT], binary_operation[literal["Overriding log level: "], +, member[.VERBOSE]]]] assign[member[.oldLogLevel], call[ApptentiveLog.getLogLevel, parameter[]]] call[ApptentiveLog.overrideLogLevel, parameter[member[.VERBOSE]]] call[.showDebugNotification, parameter[member[.context]]] end[}] END[}]
Keyword[void] identifier[start] operator[SEP] Keyword[final] identifier[Context] identifier[context] operator[SEP] { identifier[checkConversationQueue] operator[SEP] operator[SEP] operator[SEP] identifier[ApptentiveLog] operator[SEP] identifier[i] operator[SEP] identifier[TROUBLESHOOT] , literal[String] operator[+] identifier[VERBOSE] operator[SEP] operator[SEP] identifier[oldLogLevel] operator[=] identifier[ApptentiveLog] operator[SEP] identifier[getLogLevel] operator[SEP] operator[SEP] operator[SEP] identifier[ApptentiveLog] operator[SEP] identifier[overrideLogLevel] operator[SEP] identifier[VERBOSE] operator[SEP] operator[SEP] identifier[showDebugNotification] operator[SEP] identifier[context] operator[SEP] operator[SEP] }
public void setError(@Nullable final CharSequence error, @Nullable final Drawable icon) { setLeftMessage(error, icon); setActivated(error != null); }
class class_name[name] begin[{] method[setError, return_type[void], modifier[public], parameter[error, icon]] begin[{] call[.setLeftMessage, parameter[member[.error], member[.icon]]] call[.setActivated, parameter[binary_operation[member[.error], !=, literal[null]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setError] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[CharSequence] identifier[error] , annotation[@] identifier[Nullable] Keyword[final] identifier[Drawable] identifier[icon] operator[SEP] { identifier[setLeftMessage] operator[SEP] identifier[error] , identifier[icon] operator[SEP] operator[SEP] identifier[setActivated] operator[SEP] identifier[error] operator[!=] Other[null] operator[SEP] operator[SEP] }
public ReferSubscriber refer(String refereeUri, SipURI referToUri, String eventId, long timeout, String viaNonProxyRoute) { return refer(refereeUri, referToUri, eventId, timeout, viaNonProxyRoute, null, null, null); }
class class_name[name] begin[{] method[refer, return_type[type[ReferSubscriber]], modifier[public], parameter[refereeUri, referToUri, eventId, timeout, viaNonProxyRoute]] begin[{] return[call[.refer, parameter[member[.refereeUri], member[.referToUri], member[.eventId], member[.timeout], member[.viaNonProxyRoute], literal[null], literal[null], literal[null]]]] end[}] END[}]
Keyword[public] identifier[ReferSubscriber] identifier[refer] operator[SEP] identifier[String] identifier[refereeUri] , identifier[SipURI] identifier[referToUri] , identifier[String] identifier[eventId] , Keyword[long] identifier[timeout] , identifier[String] identifier[viaNonProxyRoute] operator[SEP] { Keyword[return] identifier[refer] operator[SEP] identifier[refereeUri] , identifier[referToUri] , identifier[eventId] , identifier[timeout] , identifier[viaNonProxyRoute] , Other[null] , Other[null] , Other[null] operator[SEP] operator[SEP] }
@Override public void handleControlMessage(SIBUuid8 sourceMEUuid, ControlMessage cMsg) throws SIIncorrectCallException, SIErrorException, SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "handleControlMessage", new Object[] { cMsg }); // Note that this method is called by the PubSubOutputHandler // and not by the RemoteMessageReceiver for Ack, Nack, RequestFlush // and AreYouFlushed messages // Work out type of ControlMessage and process it ControlMessageType type = cMsg.getControlMessageType(); // IMPORTANT: do the flush related messages first so that we answer // consistently with respect to any in progress flush. if (type == ControlMessageType.REQUESTFLUSH) { // TODO: this should invoke some higher-level interface indicating that // our target wants to be flushed. } // Now we can process the rest of the control messages... // Someone downstream has completed an ack prefix // or can't handle a nack. else if (type == ControlMessageType.ACK) { processAck((ControlAck) cMsg); } else if (type == ControlMessageType.NACK) { processNack((ControlNack) cMsg); } else if (type == ControlMessageType.ACKEXPECTED) { processAckExpected((ControlAckExpected) cMsg); } else { //call the super class to handle downstream (target) control messages super.handleControlMessage(sourceMEUuid, cMsg); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "handleControlMessage"); }
class class_name[name] begin[{] method[handleControlMessage, return_type[void], modifier[public], parameter[sourceMEUuid, cMsg]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["handleControlMessage"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=cMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] local_variable[type[ControlMessageType], type] if[binary_operation[member[.type], ==, member[ControlMessageType.REQUESTFLUSH]]] begin[{] else begin[{] if[binary_operation[member[.type], ==, member[ControlMessageType.ACK]]] begin[{] call[.processAck, parameter[Cast(expression=MemberReference(member=cMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ControlAck, sub_type=None))]] else begin[{] if[binary_operation[member[.type], ==, member[ControlMessageType.NACK]]] begin[{] call[.processNack, parameter[Cast(expression=MemberReference(member=cMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ControlNack, sub_type=None))]] else begin[{] if[binary_operation[member[.type], ==, member[ControlMessageType.ACKEXPECTED]]] begin[{] call[.processAckExpected, parameter[Cast(expression=MemberReference(member=cMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ControlAckExpected, sub_type=None))]] else begin[{] SuperMethodInvocation(arguments=[MemberReference(member=sourceMEUuid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleControlMessage, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] end[}] end[}] end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["handleControlMessage"]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handleControlMessage] operator[SEP] identifier[SIBUuid8] identifier[sourceMEUuid] , identifier[ControlMessage] identifier[cMsg] operator[SEP] Keyword[throws] identifier[SIIncorrectCallException] , identifier[SIErrorException] , identifier[SIResourceException] { 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[cMsg] } operator[SEP] operator[SEP] identifier[ControlMessageType] identifier[type] operator[=] identifier[cMsg] operator[SEP] identifier[getControlMessageType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[==] identifier[ControlMessageType] operator[SEP] identifier[REQUESTFLUSH] operator[SEP] { } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[==] identifier[ControlMessageType] operator[SEP] identifier[ACK] operator[SEP] { identifier[processAck] operator[SEP] operator[SEP] identifier[ControlAck] operator[SEP] identifier[cMsg] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[==] identifier[ControlMessageType] operator[SEP] identifier[NACK] operator[SEP] { identifier[processNack] operator[SEP] operator[SEP] identifier[ControlNack] operator[SEP] identifier[cMsg] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[==] identifier[ControlMessageType] operator[SEP] identifier[ACKEXPECTED] operator[SEP] { identifier[processAckExpected] operator[SEP] operator[SEP] identifier[ControlAckExpected] operator[SEP] identifier[cMsg] operator[SEP] operator[SEP] } Keyword[else] { Keyword[super] operator[SEP] identifier[handleControlMessage] operator[SEP] identifier[sourceMEUuid] , identifier[cMsg] 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 static long getFreeSpace(final File pPath) { // NOTE: Allow null, to get space in current/system volume File path = pPath != null ? pPath : new File("."); Long space = getSpace16("getFreeSpace", path); if (space != null) { return space; } return FS.getFreeSpace(path); }
class class_name[name] begin[{] method[getFreeSpace, return_type[type[long]], modifier[public static], parameter[pPath]] begin[{] local_variable[type[File], path] local_variable[type[Long], space] if[binary_operation[member[.space], !=, literal[null]]] begin[{] return[member[.space]] else begin[{] None end[}] return[call[FS.getFreeSpace, parameter[member[.path]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[long] identifier[getFreeSpace] operator[SEP] Keyword[final] identifier[File] identifier[pPath] operator[SEP] { identifier[File] identifier[path] operator[=] identifier[pPath] operator[!=] Other[null] operator[?] identifier[pPath] operator[:] Keyword[new] identifier[File] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Long] identifier[space] operator[=] identifier[getSpace16] operator[SEP] literal[String] , identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[space] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[space] operator[SEP] } Keyword[return] identifier[FS] operator[SEP] identifier[getFreeSpace] operator[SEP] identifier[path] operator[SEP] operator[SEP] }
public static String expand( String baseUrl, String uriTemplate, Object parameters, boolean addUnusedParamsAsQueryParams) { String pathUri; if (uriTemplate.startsWith("/")) { // Remove the base path from the base URL. GenericUrl url = new GenericUrl(baseUrl); url.setRawPath(null); pathUri = url.build() + uriTemplate; } else if (uriTemplate.startsWith("http://") || uriTemplate.startsWith("https://")) { pathUri = uriTemplate; } else { pathUri = baseUrl + uriTemplate; } return expand(pathUri, parameters, addUnusedParamsAsQueryParams); }
class class_name[name] begin[{] method[expand, return_type[type[String]], modifier[public static], parameter[baseUrl, uriTemplate, parameters, addUnusedParamsAsQueryParams]] begin[{] local_variable[type[String], pathUri] if[call[uriTemplate.startsWith, parameter[literal["/"]]]] begin[{] local_variable[type[GenericUrl], url] call[url.setRawPath, parameter[literal[null]]] assign[member[.pathUri], binary_operation[call[url.build, parameter[]], +, member[.uriTemplate]]] else begin[{] if[binary_operation[call[uriTemplate.startsWith, parameter[literal["http://"]]], ||, call[uriTemplate.startsWith, parameter[literal["https://"]]]]] begin[{] assign[member[.pathUri], member[.uriTemplate]] else begin[{] assign[member[.pathUri], binary_operation[member[.baseUrl], +, member[.uriTemplate]]] end[}] end[}] return[call[.expand, parameter[member[.pathUri], member[.parameters], member[.addUnusedParamsAsQueryParams]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[expand] operator[SEP] identifier[String] identifier[baseUrl] , identifier[String] identifier[uriTemplate] , identifier[Object] identifier[parameters] , Keyword[boolean] identifier[addUnusedParamsAsQueryParams] operator[SEP] { identifier[String] identifier[pathUri] operator[SEP] Keyword[if] operator[SEP] identifier[uriTemplate] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[GenericUrl] identifier[url] operator[=] Keyword[new] identifier[GenericUrl] operator[SEP] identifier[baseUrl] operator[SEP] operator[SEP] identifier[url] operator[SEP] identifier[setRawPath] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[pathUri] operator[=] identifier[url] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[+] identifier[uriTemplate] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[uriTemplate] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[uriTemplate] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[pathUri] operator[=] identifier[uriTemplate] operator[SEP] } Keyword[else] { identifier[pathUri] operator[=] identifier[baseUrl] operator[+] identifier[uriTemplate] operator[SEP] } Keyword[return] identifier[expand] operator[SEP] identifier[pathUri] , identifier[parameters] , identifier[addUnusedParamsAsQueryParams] operator[SEP] operator[SEP] }
public static ModuleIdentifier asModuleIdentifier(ModelNode value, ModuleIdentifier defaultValue) { return value.isDefined() ? ModuleIdentifier.fromString(value.asString()) : defaultValue; }
class class_name[name] begin[{] method[asModuleIdentifier, return_type[type[ModuleIdentifier]], modifier[public static], parameter[value, defaultValue]] begin[{] return[TernaryExpression(condition=MethodInvocation(arguments=[], member=isDefined, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), if_false=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=asString, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], member=fromString, postfix_operators=[], prefix_operators=[], qualifier=ModuleIdentifier, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ModuleIdentifier] identifier[asModuleIdentifier] operator[SEP] identifier[ModelNode] identifier[value] , identifier[ModuleIdentifier] identifier[defaultValue] operator[SEP] { Keyword[return] identifier[value] operator[SEP] identifier[isDefined] operator[SEP] operator[SEP] operator[?] identifier[ModuleIdentifier] operator[SEP] identifier[fromString] operator[SEP] identifier[value] operator[SEP] identifier[asString] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[defaultValue] operator[SEP] }
private void validateClusterSpecification(ClusterSpecification clusterSpecification) throws FlinkException { try { final long taskManagerMemorySize = clusterSpecification.getTaskManagerMemoryMB(); // We do the validation by calling the calculation methods here // Internally these methods will check whether the cluster can be started with the provided // ClusterSpecification and the configured memory requirements final long cutoff = ContaineredTaskManagerParameters.calculateCutoffMB(flinkConfiguration, taskManagerMemorySize); TaskManagerServices.calculateHeapSizeMB(taskManagerMemorySize - cutoff, flinkConfiguration); } catch (IllegalArgumentException iae) { throw new FlinkException("Cannot fulfill the minimum memory requirements with the provided " + "cluster specification. Please increase the memory of the cluster.", iae); } }
class class_name[name] begin[{] method[validateClusterSpecification, return_type[void], modifier[private], parameter[clusterSpecification]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTaskManagerMemoryMB, postfix_operators=[], prefix_operators=[], qualifier=clusterSpecification, selectors=[], type_arguments=None), name=taskManagerMemorySize)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=flinkConfiguration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=taskManagerMemorySize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=calculateCutoffMB, postfix_operators=[], prefix_operators=[], qualifier=ContaineredTaskManagerParameters, selectors=[], type_arguments=None), name=cutoff)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=taskManagerMemorySize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=cutoff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), MemberReference(member=flinkConfiguration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=calculateHeapSizeMB, postfix_operators=[], prefix_operators=[], qualifier=TaskManagerServices, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot fulfill the minimum memory requirements with the provided "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cluster specification. Please increase the memory of the cluster."), operator=+), MemberReference(member=iae, 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=FlinkException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=iae, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[validateClusterSpecification] operator[SEP] identifier[ClusterSpecification] identifier[clusterSpecification] operator[SEP] Keyword[throws] identifier[FlinkException] { Keyword[try] { Keyword[final] Keyword[long] identifier[taskManagerMemorySize] operator[=] identifier[clusterSpecification] operator[SEP] identifier[getTaskManagerMemoryMB] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[cutoff] operator[=] identifier[ContaineredTaskManagerParameters] operator[SEP] identifier[calculateCutoffMB] operator[SEP] identifier[flinkConfiguration] , identifier[taskManagerMemorySize] operator[SEP] operator[SEP] identifier[TaskManagerServices] operator[SEP] identifier[calculateHeapSizeMB] operator[SEP] identifier[taskManagerMemorySize] operator[-] identifier[cutoff] , identifier[flinkConfiguration] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[iae] operator[SEP] { Keyword[throw] Keyword[new] identifier[FlinkException] operator[SEP] literal[String] operator[+] literal[String] , identifier[iae] operator[SEP] operator[SEP] } }
private ExprKraken parseAndExpr() { // AndExpr oldAndExpr = _andExpr; AndExpr andExpr = new AndExpr(); // _andExpr = andExpr; andExpr.add(parseNotExpr()); while (true) { Token token = scanToken(); switch (token) { case AND: andExpr.add(parseNotExpr()); break; default: _token = token; // _andExpr = oldAndExpr; return andExpr.getSingleExpr(); } } }
class class_name[name] begin[{] method[parseAndExpr, return_type[type[ExprKraken]], modifier[private], parameter[]] begin[{] local_variable[type[AndExpr], andExpr] call[andExpr.add, parameter[call[.parseNotExpr, parameter[]]]] while[literal[true]] begin[{] local_variable[type[Token], token] SwitchStatement(cases=[SwitchStatementCase(case=['AND'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=parseNotExpr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=andExpr, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=getSingleExpr, postfix_operators=[], prefix_operators=[], qualifier=andExpr, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] end[}] END[}]
Keyword[private] identifier[ExprKraken] identifier[parseAndExpr] operator[SEP] operator[SEP] { identifier[AndExpr] identifier[andExpr] operator[=] Keyword[new] identifier[AndExpr] operator[SEP] operator[SEP] operator[SEP] identifier[andExpr] operator[SEP] identifier[add] operator[SEP] identifier[parseNotExpr] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { identifier[Token] identifier[token] operator[=] identifier[scanToken] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[token] operator[SEP] { Keyword[case] identifier[AND] operator[:] identifier[andExpr] operator[SEP] identifier[add] operator[SEP] identifier[parseNotExpr] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[_token] operator[=] identifier[token] operator[SEP] Keyword[return] identifier[andExpr] operator[SEP] identifier[getSingleExpr] operator[SEP] operator[SEP] operator[SEP] } } }
public final void updateCatalog(final long timestamp, final boolean isStreamUpdate, final String diffCommands) throws EEException { try { setupProcedure(null); m_fragmentContext = FragmentContext.CATALOG_UPDATE; coreUpdateCatalog(timestamp, isStreamUpdate, diffCommands); } finally { m_fragmentContext = FragmentContext.UNKNOWN; } }
class class_name[name] begin[{] method[updateCatalog, return_type[void], modifier[final public], parameter[timestamp, isStreamUpdate, diffCommands]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setupProcedure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_fragmentContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=CATALOG_UPDATE, postfix_operators=[], prefix_operators=[], qualifier=FragmentContext, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=timestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=isStreamUpdate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=diffCommands, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=coreUpdateCatalog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_fragmentContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=UNKNOWN, postfix_operators=[], prefix_operators=[], qualifier=FragmentContext, selectors=[])), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[updateCatalog] operator[SEP] Keyword[final] Keyword[long] identifier[timestamp] , Keyword[final] Keyword[boolean] identifier[isStreamUpdate] , Keyword[final] identifier[String] identifier[diffCommands] operator[SEP] Keyword[throws] identifier[EEException] { Keyword[try] { identifier[setupProcedure] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[m_fragmentContext] operator[=] identifier[FragmentContext] operator[SEP] identifier[CATALOG_UPDATE] operator[SEP] identifier[coreUpdateCatalog] operator[SEP] identifier[timestamp] , identifier[isStreamUpdate] , identifier[diffCommands] operator[SEP] operator[SEP] } Keyword[finally] { identifier[m_fragmentContext] operator[=] identifier[FragmentContext] operator[SEP] identifier[UNKNOWN] operator[SEP] } }
public void registerTaskConfig(String taskName, TedProcessorFactory tedProcessorFactory, Integer workTimeoutInMinutes, TedRetryScheduler retryScheduler, String channel) { FieldValidator.validateTaskName(taskName); context.registry.registerTaskConfig(taskName, tedProcessorFactory, workTimeoutInMinutes, retryScheduler, channel); }
class class_name[name] begin[{] method[registerTaskConfig, return_type[void], modifier[public], parameter[taskName, tedProcessorFactory, workTimeoutInMinutes, retryScheduler, channel]] begin[{] call[FieldValidator.validateTaskName, parameter[member[.taskName]]] call[context.registry.registerTaskConfig, parameter[member[.taskName], member[.tedProcessorFactory], member[.workTimeoutInMinutes], member[.retryScheduler], member[.channel]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[registerTaskConfig] operator[SEP] identifier[String] identifier[taskName] , identifier[TedProcessorFactory] identifier[tedProcessorFactory] , identifier[Integer] identifier[workTimeoutInMinutes] , identifier[TedRetryScheduler] identifier[retryScheduler] , identifier[String] identifier[channel] operator[SEP] { identifier[FieldValidator] operator[SEP] identifier[validateTaskName] operator[SEP] identifier[taskName] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[registry] operator[SEP] identifier[registerTaskConfig] operator[SEP] identifier[taskName] , identifier[tedProcessorFactory] , identifier[workTimeoutInMinutes] , identifier[retryScheduler] , identifier[channel] operator[SEP] operator[SEP] }
public static Set<Class<?>> getAllInterfaces(final Class<?> cls) { final Set<Class<?>> interfacesFound = new LinkedHashSet<>(); getAllInterfaces(cls, interfacesFound); return interfacesFound; }
class class_name[name] begin[{] method[getAllInterfaces, return_type[type[Set]], modifier[public static], parameter[cls]] begin[{] local_variable[type[Set], interfacesFound] call[.getAllInterfaces, parameter[member[.cls], member[.interfacesFound]]] return[member[.interfacesFound]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Set] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[getAllInterfaces] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[cls] operator[SEP] { Keyword[final] identifier[Set] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[interfacesFound] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[getAllInterfaces] operator[SEP] identifier[cls] , identifier[interfacesFound] operator[SEP] operator[SEP] Keyword[return] identifier[interfacesFound] operator[SEP] }
public I_CmsXmlContentValue addValue(CmsObject cms, I_CmsXmlSchemaType type, int index) { String xpath = CmsXmlUtils.concatXpath(CmsXmlUtils.removeLastXpathElement(getPath()), type.getName()); return addValue(cms, xpath, index); }
class class_name[name] begin[{] method[addValue, return_type[type[I_CmsXmlContentValue]], modifier[public], parameter[cms, type, index]] begin[{] local_variable[type[String], xpath] return[call[.addValue, parameter[member[.cms], member[.xpath], member[.index]]]] end[}] END[}]
Keyword[public] identifier[I_CmsXmlContentValue] identifier[addValue] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[I_CmsXmlSchemaType] identifier[type] , Keyword[int] identifier[index] operator[SEP] { identifier[String] identifier[xpath] operator[=] identifier[CmsXmlUtils] operator[SEP] identifier[concatXpath] operator[SEP] identifier[CmsXmlUtils] operator[SEP] identifier[removeLastXpathElement] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] , identifier[type] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[addValue] operator[SEP] identifier[cms] , identifier[xpath] , identifier[index] operator[SEP] operator[SEP] }
public final HttpClient cookie(String name, Consumer<? super Cookie> cookieBuilder) { return new HttpClientCookie(this, name, cookieBuilder); }
class class_name[name] begin[{] method[cookie, return_type[type[HttpClient]], modifier[final public], parameter[name, cookieBuilder]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cookieBuilder, 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=HttpClientCookie, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[final] identifier[HttpClient] identifier[cookie] operator[SEP] identifier[String] identifier[name] , identifier[Consumer] operator[<] operator[?] Keyword[super] identifier[Cookie] operator[>] identifier[cookieBuilder] operator[SEP] { Keyword[return] Keyword[new] identifier[HttpClientCookie] operator[SEP] Keyword[this] , identifier[name] , identifier[cookieBuilder] operator[SEP] operator[SEP] }
public static void sharpen() { BufferedImage buffered = UtilImageIO.loadImage(UtilIO.pathExample(imagePath)); GrayU8 gray = ConvertBufferedImage.convertFrom(buffered,(GrayU8)null); GrayU8 adjusted = gray.createSameShape(); ListDisplayPanel panel = new ListDisplayPanel(); EnhanceImageOps.sharpen4(gray, adjusted); panel.addImage(ConvertBufferedImage.convertTo(adjusted,null),"Sharpen-4"); EnhanceImageOps.sharpen8(gray, adjusted); panel.addImage(ConvertBufferedImage.convertTo(adjusted,null),"Sharpen-8"); panel.addImage(ConvertBufferedImage.convertTo(gray,null),"Original"); panel.setPreferredSize(new Dimension(gray.width,gray.height)); mainPanel.addItem(panel, "Sharpen"); }
class class_name[name] begin[{] method[sharpen, return_type[void], modifier[public static], parameter[]] begin[{] local_variable[type[BufferedImage], buffered] local_variable[type[GrayU8], gray] local_variable[type[GrayU8], adjusted] local_variable[type[ListDisplayPanel], panel] call[EnhanceImageOps.sharpen4, parameter[member[.gray], member[.adjusted]]] call[panel.addImage, parameter[call[ConvertBufferedImage.convertTo, parameter[member[.adjusted], literal[null]]], literal["Sharpen-4"]]] call[EnhanceImageOps.sharpen8, parameter[member[.gray], member[.adjusted]]] call[panel.addImage, parameter[call[ConvertBufferedImage.convertTo, parameter[member[.adjusted], literal[null]]], literal["Sharpen-8"]]] call[panel.addImage, parameter[call[ConvertBufferedImage.convertTo, parameter[member[.gray], literal[null]]], literal["Original"]]] call[panel.setPreferredSize, parameter[ClassCreator(arguments=[MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=gray, selectors=[]), MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=gray, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Dimension, sub_type=None))]] call[mainPanel.addItem, parameter[member[.panel], literal["Sharpen"]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[sharpen] operator[SEP] operator[SEP] { identifier[BufferedImage] identifier[buffered] operator[=] identifier[UtilImageIO] operator[SEP] identifier[loadImage] operator[SEP] identifier[UtilIO] operator[SEP] identifier[pathExample] operator[SEP] identifier[imagePath] operator[SEP] operator[SEP] operator[SEP] identifier[GrayU8] identifier[gray] operator[=] identifier[ConvertBufferedImage] operator[SEP] identifier[convertFrom] operator[SEP] identifier[buffered] , operator[SEP] identifier[GrayU8] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[GrayU8] identifier[adjusted] operator[=] identifier[gray] operator[SEP] identifier[createSameShape] operator[SEP] operator[SEP] operator[SEP] identifier[ListDisplayPanel] identifier[panel] operator[=] Keyword[new] identifier[ListDisplayPanel] operator[SEP] operator[SEP] operator[SEP] identifier[EnhanceImageOps] operator[SEP] identifier[sharpen4] operator[SEP] identifier[gray] , identifier[adjusted] operator[SEP] operator[SEP] identifier[panel] operator[SEP] identifier[addImage] operator[SEP] identifier[ConvertBufferedImage] operator[SEP] identifier[convertTo] operator[SEP] identifier[adjusted] , Other[null] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[EnhanceImageOps] operator[SEP] identifier[sharpen8] operator[SEP] identifier[gray] , identifier[adjusted] operator[SEP] operator[SEP] identifier[panel] operator[SEP] identifier[addImage] operator[SEP] identifier[ConvertBufferedImage] operator[SEP] identifier[convertTo] operator[SEP] identifier[adjusted] , Other[null] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[panel] operator[SEP] identifier[addImage] operator[SEP] identifier[ConvertBufferedImage] operator[SEP] identifier[convertTo] operator[SEP] identifier[gray] , Other[null] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[panel] operator[SEP] identifier[setPreferredSize] operator[SEP] Keyword[new] identifier[Dimension] operator[SEP] identifier[gray] operator[SEP] identifier[width] , identifier[gray] operator[SEP] identifier[height] operator[SEP] operator[SEP] operator[SEP] identifier[mainPanel] operator[SEP] identifier[addItem] operator[SEP] identifier[panel] , literal[String] operator[SEP] operator[SEP] }
public static <T> Bag<T> toBag(Iterable<? extends T> iterable) { return new ArrayBag<T>(iterable); }
class class_name[name] begin[{] method[toBag, return_type[type[Bag]], modifier[public static], parameter[iterable]] begin[{] return[ClassCreator(arguments=[MemberReference(member=iterable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=ArrayBag, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Bag] operator[<] identifier[T] operator[>] identifier[toBag] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[iterable] operator[SEP] { Keyword[return] Keyword[new] identifier[ArrayBag] operator[<] identifier[T] operator[>] operator[SEP] identifier[iterable] operator[SEP] operator[SEP] }
public void timedJoin(Thread thread, long timeout) throws InterruptedException { if (timeout > 0) { long ms = toMillis(timeout); int ns = excessNanos(timeout, ms); thread.join(ms, ns); } }
class class_name[name] begin[{] method[timedJoin, return_type[void], modifier[public], parameter[thread, timeout]] begin[{] if[binary_operation[member[.timeout], >, literal[0]]] begin[{] local_variable[type[long], ms] local_variable[type[int], ns] call[thread.join, parameter[member[.ms], member[.ns]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[timedJoin] operator[SEP] identifier[Thread] identifier[thread] , Keyword[long] identifier[timeout] operator[SEP] Keyword[throws] identifier[InterruptedException] { Keyword[if] operator[SEP] identifier[timeout] operator[>] Other[0] operator[SEP] { Keyword[long] identifier[ms] operator[=] identifier[toMillis] operator[SEP] identifier[timeout] operator[SEP] operator[SEP] Keyword[int] identifier[ns] operator[=] identifier[excessNanos] operator[SEP] identifier[timeout] , identifier[ms] operator[SEP] operator[SEP] identifier[thread] operator[SEP] identifier[join] operator[SEP] identifier[ms] , identifier[ns] operator[SEP] operator[SEP] } }
private Iterable<Version> loadData(InputStream in) throws IOException, StreamCorruptedException { DataInputStream dis = new DataInputStream(in); if (dis.readByte() != 1) { throw new StreamCorruptedException("File format not recognised"); } // group String groupId = dis.readUTF(); if ("TZDB".equals(groupId) == false) { throw new StreamCorruptedException("File format not recognised"); } // versions int versionCount = dis.readShort(); String[] versionArray = new String[versionCount]; for (int i = 0; i < versionCount; i++) { versionArray[i] = dis.readUTF(); } // regions int regionCount = dis.readShort(); String[] regionArray = new String[regionCount]; for (int i = 0; i < regionCount; i++) { regionArray[i] = dis.readUTF(); } regionIds = Arrays.asList(regionArray); // rules int ruleCount = dis.readShort(); Object[] ruleArray = new Object[ruleCount]; for (int i = 0; i < ruleCount; i++) { byte[] bytes = new byte[dis.readShort()]; dis.readFully(bytes); ruleArray[i] = bytes; } AtomicReferenceArray<Object> ruleData = new AtomicReferenceArray<Object>(ruleArray); // link version-region-rules Set<Version> versionSet = new HashSet<Version>(versionCount); for (int i = 0; i < versionCount; i++) { int versionRegionCount = dis.readShort(); String[] versionRegionArray = new String[versionRegionCount]; short[] versionRulesArray = new short[versionRegionCount]; for (int j = 0; j < versionRegionCount; j++) { versionRegionArray[j] = regionArray[dis.readShort()]; versionRulesArray[j] = dis.readShort(); } versionSet.add(new Version(versionArray[i], versionRegionArray, versionRulesArray, ruleData)); } return versionSet; }
class class_name[name] begin[{] method[loadData, return_type[type[Iterable]], modifier[private], parameter[in]] begin[{] local_variable[type[DataInputStream], dis] if[binary_operation[call[dis.readByte, parameter[]], !=, literal[1]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="File format not recognised")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StreamCorruptedException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], groupId] if[binary_operation[literal["TZDB"], ==, literal[false]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="File format not recognised")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StreamCorruptedException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], versionCount] local_variable[type[String], versionArray] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=versionArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=readUTF, postfix_operators=[], prefix_operators=[], qualifier=dis, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=versionCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[int], regionCount] local_variable[type[String], regionArray] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=regionArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=readUTF, postfix_operators=[], prefix_operators=[], qualifier=dis, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=regionCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[member[.regionIds], call[Arrays.asList, parameter[member[.regionArray]]]] local_variable[type[int], ruleCount] local_variable[type[Object], ruleArray] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=readShort, postfix_operators=[], prefix_operators=[], qualifier=dis, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=bytes)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readFully, postfix_operators=[], prefix_operators=[], qualifier=dis, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ruleArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=bytes, 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=ruleCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[AtomicReferenceArray], ruleData] local_variable[type[Set], versionSet] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readShort, postfix_operators=[], prefix_operators=[], qualifier=dis, selectors=[], type_arguments=None), name=versionRegionCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=versionRegionCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=versionRegionArray)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=versionRegionCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=short)), name=versionRulesArray)], modifiers=set(), type=BasicType(dimensions=[None], name=short)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=versionRegionArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=regionArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MethodInvocation(arguments=[], member=readShort, postfix_operators=[], prefix_operators=[], qualifier=dis, selectors=[], type_arguments=None))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=versionRulesArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=readShort, postfix_operators=[], prefix_operators=[], qualifier=dis, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=versionRegionCount, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=versionArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=versionRegionArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=versionRulesArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ruleData, 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))], member=add, postfix_operators=[], prefix_operators=[], qualifier=versionSet, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=versionCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.versionSet]] end[}] END[}]
Keyword[private] identifier[Iterable] operator[<] identifier[Version] operator[>] identifier[loadData] operator[SEP] identifier[InputStream] identifier[in] operator[SEP] Keyword[throws] identifier[IOException] , identifier[StreamCorruptedException] { identifier[DataInputStream] identifier[dis] operator[=] Keyword[new] identifier[DataInputStream] operator[SEP] identifier[in] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dis] operator[SEP] identifier[readByte] operator[SEP] operator[SEP] operator[!=] Other[1] operator[SEP] { Keyword[throw] Keyword[new] identifier[StreamCorruptedException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[groupId] operator[=] identifier[dis] operator[SEP] identifier[readUTF] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[groupId] operator[SEP] operator[==] literal[boolean] operator[SEP] { Keyword[throw] Keyword[new] identifier[StreamCorruptedException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[versionCount] operator[=] identifier[dis] operator[SEP] identifier[readShort] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[versionArray] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[versionCount] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[versionCount] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[versionArray] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[dis] operator[SEP] identifier[readUTF] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[regionCount] operator[=] identifier[dis] operator[SEP] identifier[readShort] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[regionArray] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[regionCount] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[regionCount] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[regionArray] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[dis] operator[SEP] identifier[readUTF] operator[SEP] operator[SEP] operator[SEP] } identifier[regionIds] operator[=] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[regionArray] operator[SEP] operator[SEP] Keyword[int] identifier[ruleCount] operator[=] identifier[dis] operator[SEP] identifier[readShort] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[ruleArray] operator[=] Keyword[new] identifier[Object] operator[SEP] identifier[ruleCount] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ruleCount] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[dis] operator[SEP] identifier[readShort] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dis] operator[SEP] identifier[readFully] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] identifier[ruleArray] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[bytes] operator[SEP] } identifier[AtomicReferenceArray] operator[<] identifier[Object] operator[>] identifier[ruleData] operator[=] Keyword[new] identifier[AtomicReferenceArray] operator[<] identifier[Object] operator[>] operator[SEP] identifier[ruleArray] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Version] operator[>] identifier[versionSet] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Version] operator[>] operator[SEP] identifier[versionCount] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[versionCount] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[versionRegionCount] operator[=] identifier[dis] operator[SEP] identifier[readShort] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[versionRegionArray] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[versionRegionCount] operator[SEP] operator[SEP] Keyword[short] operator[SEP] operator[SEP] identifier[versionRulesArray] operator[=] Keyword[new] Keyword[short] operator[SEP] identifier[versionRegionCount] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[versionRegionCount] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[versionRegionArray] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[regionArray] operator[SEP] identifier[dis] operator[SEP] identifier[readShort] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[versionRulesArray] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[dis] operator[SEP] identifier[readShort] operator[SEP] operator[SEP] operator[SEP] } identifier[versionSet] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Version] operator[SEP] identifier[versionArray] operator[SEP] identifier[i] operator[SEP] , identifier[versionRegionArray] , identifier[versionRulesArray] , identifier[ruleData] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[versionSet] operator[SEP] }
public User getRemoteUser() { HttpServletRequest request = ServletActionContext.getRequest(); if (request != null) { String remoteUserName = request.getRemoteUser(); if (remoteUserName != null) { return getUserAccessor().getUserIfAvailable(remoteUserName); } } return AuthenticatedUserThreadLocal.getUser(); }
class class_name[name] begin[{] method[getRemoteUser, return_type[type[User]], modifier[public], parameter[]] begin[{] local_variable[type[HttpServletRequest], request] if[binary_operation[member[.request], !=, literal[null]]] begin[{] local_variable[type[String], remoteUserName] if[binary_operation[member[.remoteUserName], !=, literal[null]]] begin[{] return[call[.getUserAccessor, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] return[call[AuthenticatedUserThreadLocal.getUser, parameter[]]] end[}] END[}]
Keyword[public] identifier[User] identifier[getRemoteUser] operator[SEP] operator[SEP] { identifier[HttpServletRequest] identifier[request] operator[=] identifier[ServletActionContext] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[request] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[remoteUserName] operator[=] identifier[request] operator[SEP] identifier[getRemoteUser] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[remoteUserName] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[getUserAccessor] operator[SEP] operator[SEP] operator[SEP] identifier[getUserIfAvailable] operator[SEP] identifier[remoteUserName] operator[SEP] operator[SEP] } } Keyword[return] identifier[AuthenticatedUserThreadLocal] operator[SEP] identifier[getUser] operator[SEP] operator[SEP] operator[SEP] }
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "extension", scope = GetTypeDescendants.class) public JAXBElement<CmisExtensionType> createGetTypeDescendantsExtension( CmisExtensionType value) { return new JAXBElement<CmisExtensionType>( _GetPropertiesExtension_QNAME, CmisExtensionType.class, GetTypeDescendants.class, value); }
class class_name[name] begin[{] method[createGetTypeDescendantsExtension, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_GetPropertiesExtension_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmisExtensionType, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GetTypeDescendants, sub_type=None)), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmisExtensionType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] , identifier[scope] operator[=] identifier[GetTypeDescendants] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[CmisExtensionType] operator[>] identifier[createGetTypeDescendantsExtension] operator[SEP] identifier[CmisExtensionType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[CmisExtensionType] operator[>] operator[SEP] identifier[_GetPropertiesExtension_QNAME] , identifier[CmisExtensionType] operator[SEP] Keyword[class] , identifier[GetTypeDescendants] operator[SEP] Keyword[class] , identifier[value] operator[SEP] operator[SEP] }
public static IntSupplier softenIntSupplier(final CheckedIntSupplier s) { return () -> { try { return s.getAsInt(); } catch (final Throwable e) { throw throwSoftenedException(e); } }; }
class class_name[name] begin[{] method[softenIntSupplier, return_type[type[IntSupplier]], modifier[public static], parameter[s]] begin[{] return[LambdaExpression(body=[TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getAsInt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=throwSoftenedException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)], parameters=[])] end[}] END[}]
Keyword[public] Keyword[static] identifier[IntSupplier] identifier[softenIntSupplier] operator[SEP] Keyword[final] identifier[CheckedIntSupplier] identifier[s] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] operator[->] { Keyword[try] { Keyword[return] identifier[s] operator[SEP] identifier[getAsInt] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Throwable] identifier[e] operator[SEP] { Keyword[throw] identifier[throwSoftenedException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } operator[SEP] }
public void setClientInfo(final Properties properties) throws java.sql.SQLClientInfoException { // TODO: actually use these! for (final String key : properties.stringPropertyNames()) { this.clientInfoProperties.setProperty(key, properties.getProperty(key)); } }
class class_name[name] begin[{] method[setClientInfo, return_type[void], modifier[public], parameter[properties]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=clientInfoProperties, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None)], member=setProperty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=stringPropertyNames, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setClientInfo] operator[SEP] Keyword[final] identifier[Properties] identifier[properties] operator[SEP] Keyword[throws] identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[SQLClientInfoException] { Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[key] operator[:] identifier[properties] operator[SEP] identifier[stringPropertyNames] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[clientInfoProperties] operator[SEP] identifier[setProperty] operator[SEP] identifier[key] , identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] } }
protected void appendClause(StringBuffer clause, Criteria crit, StringBuffer stmt) { /** * MBAIRD * when generating the "WHERE/HAVING" clause we need to append the criteria for multi-mapped * tables. We only need to do this for the root classdescriptor and not for joined tables * because we assume you cannot make a relation of the wrong type upon insertion. Of course, * you COULD mess the data up manually and this would cause a problem. */ if (clause != null) { stmt.append(clause.toString()); } if (crit != null) { if (clause == null) { stmt.append(asSQLStatement(crit)); } else { stmt.append(" AND ("); stmt.append(asSQLStatement(crit)); stmt.append(")"); } } }
class class_name[name] begin[{] method[appendClause, return_type[void], modifier[protected], parameter[clause, crit, stmt]] begin[{] if[binary_operation[member[.clause], !=, literal[null]]] begin[{] call[stmt.append, parameter[call[clause.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.crit], !=, literal[null]]] begin[{] if[binary_operation[member[.clause], ==, literal[null]]] begin[{] call[stmt.append, parameter[call[.asSQLStatement, parameter[member[.crit]]]]] else begin[{] call[stmt.append, parameter[literal[" AND ("]]] call[stmt.append, parameter[call[.asSQLStatement, parameter[member[.crit]]]]] call[stmt.append, parameter[literal[")"]]] end[}] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[appendClause] operator[SEP] identifier[StringBuffer] identifier[clause] , identifier[Criteria] identifier[crit] , identifier[StringBuffer] identifier[stmt] operator[SEP] { Keyword[if] operator[SEP] identifier[clause] operator[!=] Other[null] operator[SEP] { identifier[stmt] operator[SEP] identifier[append] operator[SEP] identifier[clause] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[crit] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[clause] operator[==] Other[null] operator[SEP] { identifier[stmt] operator[SEP] identifier[append] operator[SEP] identifier[asSQLStatement] operator[SEP] identifier[crit] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[stmt] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[stmt] operator[SEP] identifier[append] operator[SEP] identifier[asSQLStatement] operator[SEP] identifier[crit] operator[SEP] operator[SEP] operator[SEP] identifier[stmt] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } } }
@Override public Timer createSingleActionTimer(long duration, TimerConfig timerConfig) throws IllegalArgumentException, IllegalStateException, EJBException { assertTimerServiceState(); if (duration < 0) throw EJB3_TIMER_LOGGER.invalidDurationActionTimer(); return createTimer(new Date(System.currentTimeMillis() + duration), 0, timerConfig.getInfo(), timerConfig .isPersistent()); }
class class_name[name] begin[{] method[createSingleActionTimer, return_type[type[Timer]], modifier[public], parameter[duration, timerConfig]] begin[{] call[.assertTimerServiceState, parameter[]] if[binary_operation[member[.duration], <, literal[0]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[], member=invalidDurationActionTimer, postfix_operators=[], prefix_operators=[], qualifier=EJB3_TIMER_LOGGER, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] return[call[.createTimer, parameter[ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operandr=MemberReference(member=duration, 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=Date, sub_type=None)), literal[0], call[timerConfig.getInfo, parameter[]], call[timerConfig.isPersistent, parameter[]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Timer] identifier[createSingleActionTimer] operator[SEP] Keyword[long] identifier[duration] , identifier[TimerConfig] identifier[timerConfig] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] , identifier[IllegalStateException] , identifier[EJBException] { identifier[assertTimerServiceState] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[duration] operator[<] Other[0] operator[SEP] Keyword[throw] identifier[EJB3_TIMER_LOGGER] operator[SEP] identifier[invalidDurationActionTimer] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[createTimer] operator[SEP] Keyword[new] identifier[Date] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[+] identifier[duration] operator[SEP] , Other[0] , identifier[timerConfig] operator[SEP] identifier[getInfo] operator[SEP] operator[SEP] , identifier[timerConfig] operator[SEP] identifier[isPersistent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static Map<String, MultifactorAuthenticationProvider> getAvailableMultifactorAuthenticationProviders( final ApplicationContext applicationContext) { try { return applicationContext.getBeansOfType(MultifactorAuthenticationProvider.class, false, true); } catch (final Exception e) { LOGGER.trace("No beans of type [{}] are available in the application context. " + "CAS may not be configured to handle multifactor authentication requests in absence of a provider", MultifactorAuthenticationProvider.class); } return new HashMap<>(0); }
class class_name[name] begin[{] method[getAvailableMultifactorAuthenticationProviders, return_type[type[Map]], modifier[public static], parameter[applicationContext]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MultifactorAuthenticationProvider, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getBeansOfType, postfix_operators=[], prefix_operators=[], qualifier=applicationContext, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No beans of type [{}] are available in the application context. "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CAS may not be configured to handle multifactor authentication requests in absence of a provider"), operator=+), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MultifactorAuthenticationProvider, sub_type=None))], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[MultifactorAuthenticationProvider] operator[>] identifier[getAvailableMultifactorAuthenticationProviders] operator[SEP] Keyword[final] identifier[ApplicationContext] identifier[applicationContext] operator[SEP] { Keyword[try] { Keyword[return] identifier[applicationContext] operator[SEP] identifier[getBeansOfType] operator[SEP] identifier[MultifactorAuthenticationProvider] operator[SEP] Keyword[class] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] literal[String] , identifier[MultifactorAuthenticationProvider] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] Other[0] operator[SEP] operator[SEP] }
public boolean setXML(String strXML) { Node node = Utility.convertXMLToDOM(strXML); return this.setDOM(node); }
class class_name[name] begin[{] method[setXML, return_type[type[boolean]], modifier[public], parameter[strXML]] begin[{] local_variable[type[Node], node] return[THIS[call[None.setDOM, parameter[member[.node]]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[setXML] operator[SEP] identifier[String] identifier[strXML] operator[SEP] { identifier[Node] identifier[node] operator[=] identifier[Utility] operator[SEP] identifier[convertXMLToDOM] operator[SEP] identifier[strXML] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[setDOM] operator[SEP] identifier[node] operator[SEP] operator[SEP] }
public String getListOfProvidersFromIdentities() { if(this.getIdentities() == null || this.getIdentities().isEmpty()) { return ""; } StringBuilder returnVal = new StringBuilder(); for(Identity identity : this.getIdentities()) { returnVal.append(identity.getProvider()); returnVal.append(","); } String toString = returnVal.toString(); return toString.substring(0,toString.length() - 1); }
class class_name[name] begin[{] method[getListOfProvidersFromIdentities, return_type[type[String]], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[THIS[call[None.getIdentities, parameter[]]], ==, literal[null]], ||, THIS[call[None.getIdentities, parameter[]]call[None.isEmpty, parameter[]]]]] begin[{] return[literal[""]] else begin[{] None end[}] local_variable[type[StringBuilder], returnVal] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProvider, postfix_operators=[], prefix_operators=[], qualifier=identity, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=returnVal, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=append, postfix_operators=[], prefix_operators=[], qualifier=returnVal, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getIdentities, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=identity)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Identity, sub_type=None))), label=None) local_variable[type[String], toString] return[call[toString.substring, parameter[literal[0], binary_operation[call[toString.length, parameter[]], -, literal[1]]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getListOfProvidersFromIdentities] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getIdentities] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] Keyword[this] operator[SEP] identifier[getIdentities] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } identifier[StringBuilder] identifier[returnVal] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Identity] identifier[identity] operator[:] Keyword[this] operator[SEP] identifier[getIdentities] operator[SEP] operator[SEP] operator[SEP] { identifier[returnVal] operator[SEP] identifier[append] operator[SEP] identifier[identity] operator[SEP] identifier[getProvider] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[returnVal] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[toString] operator[=] identifier[returnVal] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[toString] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[toString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] }