code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
static DiagnosticPosition diagnosticPosition(DocTreePath path, VisitorState state) { int startPosition = getStartPosition(path.getLeaf(), state); Tree tree = path.getTreePath().getLeaf(); return getDiagnosticPosition(startPosition, tree); }
class class_name[name] begin[{] method[diagnosticPosition, return_type[type[DiagnosticPosition]], modifier[static], parameter[path, state]] begin[{] local_variable[type[int], startPosition] local_variable[type[Tree], tree] return[call[.getDiagnosticPosition, parameter[member[.startPosition], member[.tree]]]] end[}] END[}]
Keyword[static] identifier[DiagnosticPosition] identifier[diagnosticPosition] operator[SEP] identifier[DocTreePath] identifier[path] , identifier[VisitorState] identifier[state] operator[SEP] { Keyword[int] identifier[startPosition] operator[=] identifier[getStartPosition] operator[SEP] identifier[path] operator[SEP] identifier[getLeaf] operator[SEP] operator[SEP] , identifier[state] operator[SEP] operator[SEP] identifier[Tree] identifier[tree] operator[=] identifier[path] operator[SEP] identifier[getTreePath] operator[SEP] operator[SEP] operator[SEP] identifier[getLeaf] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getDiagnosticPosition] operator[SEP] identifier[startPosition] , identifier[tree] operator[SEP] operator[SEP] }
public void add(String column, Object value) { add(System.currentTimeMillis(), column, value); }
class class_name[name] begin[{] method[add, return_type[void], modifier[public], parameter[column, value]] begin[{] call[.add, parameter[call[System.currentTimeMillis, parameter[]], member[.column], member[.value]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[add] operator[SEP] identifier[String] identifier[column] , identifier[Object] identifier[value] operator[SEP] { identifier[add] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] , identifier[column] , identifier[value] operator[SEP] operator[SEP] }
private void updateCurrentFunction(AbstractFunctionExpression parentExpr) { GroovyExpression expr = parentExpr.getCaller(); if (expr instanceof AbstractFunctionExpression) { AbstractFunctionExpression exprAsFunction = (AbstractFunctionExpression) expr; GroovyExpression exprCaller = exprAsFunction.getCaller(); parentExpr.setCaller(exprCaller); updateCurrentFunctionDefintion(exprAsFunction); } }
class class_name[name] begin[{] method[updateCurrentFunction, return_type[void], modifier[private], parameter[parentExpr]] begin[{] local_variable[type[GroovyExpression], expr] if[binary_operation[member[.expr], instanceof, type[AbstractFunctionExpression]]] begin[{] local_variable[type[AbstractFunctionExpression], exprAsFunction] local_variable[type[GroovyExpression], exprCaller] call[parentExpr.setCaller, parameter[member[.exprCaller]]] call[.updateCurrentFunctionDefintion, parameter[member[.exprAsFunction]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[updateCurrentFunction] operator[SEP] identifier[AbstractFunctionExpression] identifier[parentExpr] operator[SEP] { identifier[GroovyExpression] identifier[expr] operator[=] identifier[parentExpr] operator[SEP] identifier[getCaller] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[expr] Keyword[instanceof] identifier[AbstractFunctionExpression] operator[SEP] { identifier[AbstractFunctionExpression] identifier[exprAsFunction] operator[=] operator[SEP] identifier[AbstractFunctionExpression] operator[SEP] identifier[expr] operator[SEP] identifier[GroovyExpression] identifier[exprCaller] operator[=] identifier[exprAsFunction] operator[SEP] identifier[getCaller] operator[SEP] operator[SEP] operator[SEP] identifier[parentExpr] operator[SEP] identifier[setCaller] operator[SEP] identifier[exprCaller] operator[SEP] operator[SEP] identifier[updateCurrentFunctionDefintion] operator[SEP] identifier[exprAsFunction] operator[SEP] operator[SEP] } }
@Override public GetCostForecastResult getCostForecast(GetCostForecastRequest request) { request = beforeClientExecution(request); return executeGetCostForecast(request); }
class class_name[name] begin[{] method[getCostForecast, return_type[type[GetCostForecastResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeGetCostForecast, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[GetCostForecastResult] identifier[getCostForecast] operator[SEP] identifier[GetCostForecastRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetCostForecast] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static boolean isBetweenHours(long dt, TimeZone tz, int from, int to, int tolerance) { long start = 0L; long end = 0L; // If from > to then the "to" date may be in the next day // or the "from" date may be in the previous day, depending // on whether or not it's before or after midnight if(from > to) { // Assume that start is in today and end is in tomorrow start = getDateForHour(dt, tz, from, 0); end = getDateForHour(dt, tz, to, 1)+(tolerance*1000L); // If we end up before the start date, // try moving the dates back by a day if(dt < start) // move start to yesterday { start = getDateForHour(dt, tz, from, -1); end = getDateForHour(dt, tz, to, 0)+(tolerance*1000L); } } else // to > from { start = getDateForHour(dt, tz, from, 0); end = getDateForHour(dt, tz, to, 0)+(tolerance*1000L); } return dt >= start && dt <= end; }
class class_name[name] begin[{] method[isBetweenHours, return_type[type[boolean]], modifier[public static], parameter[dt, tz, from, to, tolerance]] begin[{] local_variable[type[long], start] local_variable[type[long], end] if[binary_operation[member[.from], >, member[.to]]] begin[{] assign[member[.start], call[.getDateForHour, parameter[member[.dt], member[.tz], member[.from], literal[0]]]] assign[member[.end], binary_operation[call[.getDateForHour, parameter[member[.dt], member[.tz], member[.to], literal[1]]], +, binary_operation[member[.tolerance], *, literal[1000L]]]] if[binary_operation[member[.dt], <, member[.start]]] begin[{] assign[member[.start], call[.getDateForHour, parameter[member[.dt], member[.tz], member[.from], literal[1]]]] assign[member[.end], binary_operation[call[.getDateForHour, parameter[member[.dt], member[.tz], member[.to], literal[0]]], +, binary_operation[member[.tolerance], *, literal[1000L]]]] else begin[{] None end[}] else begin[{] assign[member[.start], call[.getDateForHour, parameter[member[.dt], member[.tz], member[.from], literal[0]]]] assign[member[.end], binary_operation[call[.getDateForHour, parameter[member[.dt], member[.tz], member[.to], literal[0]]], +, binary_operation[member[.tolerance], *, literal[1000L]]]] end[}] return[binary_operation[binary_operation[member[.dt], >=, member[.start]], &&, binary_operation[member[.dt], <=, member[.end]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isBetweenHours] operator[SEP] Keyword[long] identifier[dt] , identifier[TimeZone] identifier[tz] , Keyword[int] identifier[from] , Keyword[int] identifier[to] , Keyword[int] identifier[tolerance] operator[SEP] { Keyword[long] identifier[start] operator[=] Other[0L] operator[SEP] Keyword[long] identifier[end] operator[=] Other[0L] operator[SEP] Keyword[if] operator[SEP] identifier[from] operator[>] identifier[to] operator[SEP] { identifier[start] operator[=] identifier[getDateForHour] operator[SEP] identifier[dt] , identifier[tz] , identifier[from] , Other[0] operator[SEP] operator[SEP] identifier[end] operator[=] identifier[getDateForHour] operator[SEP] identifier[dt] , identifier[tz] , identifier[to] , Other[1] operator[SEP] operator[+] operator[SEP] identifier[tolerance] operator[*] Other[1000L] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dt] operator[<] identifier[start] operator[SEP] { identifier[start] operator[=] identifier[getDateForHour] operator[SEP] identifier[dt] , identifier[tz] , identifier[from] , operator[-] Other[1] operator[SEP] operator[SEP] identifier[end] operator[=] identifier[getDateForHour] operator[SEP] identifier[dt] , identifier[tz] , identifier[to] , Other[0] operator[SEP] operator[+] operator[SEP] identifier[tolerance] operator[*] Other[1000L] operator[SEP] operator[SEP] } } Keyword[else] { identifier[start] operator[=] identifier[getDateForHour] operator[SEP] identifier[dt] , identifier[tz] , identifier[from] , Other[0] operator[SEP] operator[SEP] identifier[end] operator[=] identifier[getDateForHour] operator[SEP] identifier[dt] , identifier[tz] , identifier[to] , Other[0] operator[SEP] operator[+] operator[SEP] identifier[tolerance] operator[*] Other[1000L] operator[SEP] operator[SEP] } Keyword[return] identifier[dt] operator[>=] identifier[start] operator[&&] identifier[dt] operator[<=] identifier[end] operator[SEP] }
public static void main(String[] args) { if (args.length != 0) { LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR, AlluxioSecondaryMaster.class.getCanonicalName()); System.exit(-1); } AlluxioSecondaryMaster master = new AlluxioSecondaryMaster(); ProcessUtils.run(master); }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[args]] begin[{] if[binary_operation[member[args.length], !=, literal[0]]] begin[{] call[LOG.info, parameter[literal["java -cp {} {}"], member[RuntimeConstants.ALLUXIO_JAR], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=AlluxioSecondaryMaster, sub_type=None))]] call[System.exit, parameter[literal[1]]] else begin[{] None end[}] local_variable[type[AlluxioSecondaryMaster], master] call[ProcessUtils.run, parameter[member[.master]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] { Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[!=] Other[0] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[RuntimeConstants] operator[SEP] identifier[ALLUXIO_JAR] , identifier[AlluxioSecondaryMaster] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } identifier[AlluxioSecondaryMaster] identifier[master] operator[=] Keyword[new] identifier[AlluxioSecondaryMaster] operator[SEP] operator[SEP] operator[SEP] identifier[ProcessUtils] operator[SEP] identifier[run] operator[SEP] identifier[master] operator[SEP] operator[SEP] }
public boolean isWhitespace(String text) throws XmlPullParserException { if (text == null) { return false; } return text.split("\\s").length == 0; }
class class_name[name] begin[{] method[isWhitespace, return_type[type[boolean]], modifier[public], parameter[text]] begin[{] if[binary_operation[member[.text], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] return[binary_operation[call[text.split, parameter[literal["\\s"]]], ==, literal[0]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isWhitespace] operator[SEP] identifier[String] identifier[text] operator[SEP] Keyword[throws] identifier[XmlPullParserException] { Keyword[if] operator[SEP] identifier[text] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] identifier[text] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] }
private void writeObject(ObjectOutputStream s) throws IOException { Iterator<E> it = iterator(); s.writeInt(size() * 2); // expectedMaxSize s.writeInt(size()); while (it.hasNext()) s.writeObject(it.next()); }
class class_name[name] begin[{] method[writeObject, return_type[void], modifier[private], parameter[s]] begin[{] local_variable[type[Iterator], it] call[s.writeInt, parameter[binary_operation[call[.size, parameter[]], *, literal[2]]]] call[s.writeInt, parameter[call[.size, parameter[]]]] while[call[it.hasNext, parameter[]]] begin[{] call[s.writeObject, parameter[call[it.next, parameter[]]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[writeObject] operator[SEP] identifier[ObjectOutputStream] identifier[s] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Iterator] operator[<] identifier[E] operator[>] identifier[it] operator[=] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[writeInt] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[*] Other[2] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[writeInt] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[writeObject] operator[SEP] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void setResolved(String v) { if (Coordination_Type.featOkTst && ((Coordination_Type)jcasType).casFeat_resolved == null) jcasType.jcas.throwFeatMissing("resolved", "de.julielab.jules.types.Coordination"); jcasType.ll_cas.ll_setStringValue(addr, ((Coordination_Type)jcasType).casFeatCode_resolved, v);}
class class_name[name] begin[{] method[setResolved, return_type[void], modifier[public], parameter[v]] begin[{] if[binary_operation[member[Coordination_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Coordination_Type, sub_type=None)), ==, literal[null]]]] begin[{] call[jcasType.jcas.throwFeatMissing, parameter[literal["resolved"], literal["de.julielab.jules.types.Coordination"]]] else begin[{] None end[}] call[jcasType.ll_cas.ll_setStringValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Coordination_Type, sub_type=None)), member[.v]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setResolved] operator[SEP] identifier[String] identifier[v] operator[SEP] { Keyword[if] operator[SEP] identifier[Coordination_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[Coordination_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_resolved] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_setStringValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[Coordination_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_resolved] , identifier[v] operator[SEP] operator[SEP] }
@UsedByGeneratedCode public static boolean iincheck(int ids, String nameAndDescriptor) { if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.FINER)) { log.entering("TypeRegistry", "iincheck", new Object[] { ids, nameAndDescriptor }); } int registryId = ids >>> 16; int typeId = ids & 0xffff; TypeRegistry typeRegistry = registryInstances[registryId].get(); ReloadableType reloadableType = typeRegistry.getReloadableType(typeId); if (reloadableType == null) { reloadableType = searchForReloadableType(typeId, typeRegistry); } // Check 2: Info computed earlier if (reloadableType != null && !reloadableType.isAffectedByReload()) { return false; } if (reloadableType != null && reloadableType.hasBeenReloaded()) { MethodMember method = reloadableType.getLiveVersion().incrementalTypeDescriptor.getFromLatestByDescriptor( nameAndDescriptor); boolean dispatchThroughDescriptor = false; if (method == null) { // method does not exist throw new NoSuchMethodError(reloadableType.getBaseName() + "." + nameAndDescriptor); } else if (IncrementalTypeDescriptor.isBrandNewMethod(method)) { // definetly need to use the dispatcher dispatchThroughDescriptor = true; } if (dispatchThroughDescriptor) { if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.FINER)) { log.info("versionstamp " + reloadableType.getLiveVersion().versionstamp); log.exiting("TypeRegistry", "iincheck", true); } return true; } } if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.FINER)) { log.exiting("TypeRegistry", "icheck", false); } return false; }
class class_name[name] begin[{] method[iincheck, return_type[type[boolean]], modifier[public static], parameter[ids, nameAndDescriptor]] begin[{] if[binary_operation[member[GlobalConfiguration.isRuntimeLogging], &&, call[log.isLoggable, parameter[member[Level.FINER]]]]] begin[{] call[log.entering, parameter[literal["TypeRegistry"], literal["iincheck"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=ids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nameAndDescriptor, 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[int], registryId] local_variable[type[int], typeId] local_variable[type[TypeRegistry], typeRegistry] local_variable[type[ReloadableType], reloadableType] if[binary_operation[member[.reloadableType], ==, literal[null]]] begin[{] assign[member[.reloadableType], call[.searchForReloadableType, parameter[member[.typeId], member[.typeRegistry]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.reloadableType], !=, literal[null]], &&, call[reloadableType.isAffectedByReload, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.reloadableType], !=, literal[null]], &&, call[reloadableType.hasBeenReloaded, parameter[]]]] begin[{] local_variable[type[MethodMember], method] local_variable[type[boolean], dispatchThroughDescriptor] if[binary_operation[member[.method], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getBaseName, postfix_operators=[], prefix_operators=[], qualifier=reloadableType, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=nameAndDescriptor, 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=NoSuchMethodError, sub_type=None)), label=None) else begin[{] if[call[IncrementalTypeDescriptor.isBrandNewMethod, parameter[member[.method]]]] begin[{] assign[member[.dispatchThroughDescriptor], literal[true]] else begin[{] None end[}] end[}] if[member[.dispatchThroughDescriptor]] begin[{] if[binary_operation[member[GlobalConfiguration.isRuntimeLogging], &&, call[log.isLoggable, parameter[member[Level.FINER]]]]] begin[{] call[log.info, parameter[binary_operation[literal["versionstamp "], +, call[reloadableType.getLiveVersion, parameter[]]]]] call[log.exiting, parameter[literal["TypeRegistry"], literal["iincheck"], literal[true]]] else begin[{] None end[}] return[literal[true]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[GlobalConfiguration.isRuntimeLogging], &&, call[log.isLoggable, parameter[member[Level.FINER]]]]] begin[{] call[log.exiting, parameter[literal["TypeRegistry"], literal["icheck"], literal[false]]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
annotation[@] identifier[UsedByGeneratedCode] Keyword[public] Keyword[static] Keyword[boolean] identifier[iincheck] operator[SEP] Keyword[int] identifier[ids] , identifier[String] identifier[nameAndDescriptor] operator[SEP] { Keyword[if] operator[SEP] identifier[GlobalConfiguration] operator[SEP] identifier[isRuntimeLogging] operator[&&] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINER] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[entering] operator[SEP] literal[String] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[ids] , identifier[nameAndDescriptor] } operator[SEP] operator[SEP] } Keyword[int] identifier[registryId] operator[=] identifier[ids] operator[>] operator[>] operator[>] Other[16] operator[SEP] Keyword[int] identifier[typeId] operator[=] identifier[ids] operator[&] literal[Integer] operator[SEP] identifier[TypeRegistry] identifier[typeRegistry] operator[=] identifier[registryInstances] operator[SEP] identifier[registryId] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[ReloadableType] identifier[reloadableType] operator[=] identifier[typeRegistry] operator[SEP] identifier[getReloadableType] operator[SEP] identifier[typeId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reloadableType] operator[==] Other[null] operator[SEP] { identifier[reloadableType] operator[=] identifier[searchForReloadableType] operator[SEP] identifier[typeId] , identifier[typeRegistry] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[reloadableType] operator[!=] Other[null] operator[&&] operator[!] identifier[reloadableType] operator[SEP] identifier[isAffectedByReload] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[reloadableType] operator[!=] Other[null] operator[&&] identifier[reloadableType] operator[SEP] identifier[hasBeenReloaded] operator[SEP] operator[SEP] operator[SEP] { identifier[MethodMember] identifier[method] operator[=] identifier[reloadableType] operator[SEP] identifier[getLiveVersion] operator[SEP] operator[SEP] operator[SEP] identifier[incrementalTypeDescriptor] operator[SEP] identifier[getFromLatestByDescriptor] operator[SEP] identifier[nameAndDescriptor] operator[SEP] operator[SEP] Keyword[boolean] identifier[dispatchThroughDescriptor] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[method] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NoSuchMethodError] operator[SEP] identifier[reloadableType] operator[SEP] identifier[getBaseName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[nameAndDescriptor] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[IncrementalTypeDescriptor] operator[SEP] identifier[isBrandNewMethod] operator[SEP] identifier[method] operator[SEP] operator[SEP] { identifier[dispatchThroughDescriptor] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[dispatchThroughDescriptor] operator[SEP] { Keyword[if] operator[SEP] identifier[GlobalConfiguration] operator[SEP] identifier[isRuntimeLogging] operator[&&] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINER] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[reloadableType] operator[SEP] identifier[getLiveVersion] operator[SEP] operator[SEP] operator[SEP] identifier[versionstamp] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[exiting] operator[SEP] literal[String] , literal[String] , literal[boolean] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] identifier[GlobalConfiguration] operator[SEP] identifier[isRuntimeLogging] operator[&&] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINER] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[exiting] operator[SEP] literal[String] , literal[String] , literal[boolean] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public void setProxy(Proxy proxy) { if(proxy != null) { java.net.Proxy p = new java.net.Proxy(java.net.Proxy.Type.HTTP, new InetSocketAddress(proxy.getHost(), proxy.getPort())); client.setProxy(p); } else client.setProxy(java.net.Proxy.NO_PROXY); }
class class_name[name] begin[{] method[setProxy, return_type[void], modifier[public], parameter[proxy]] begin[{] if[binary_operation[member[.proxy], !=, literal[null]]] begin[{] local_variable[type[java], p] call[client.setProxy, parameter[member[.p]]] else begin[{] call[client.setProxy, parameter[member[java.net.Proxy.NO_PROXY]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setProxy] operator[SEP] identifier[Proxy] identifier[proxy] operator[SEP] { Keyword[if] operator[SEP] identifier[proxy] operator[!=] Other[null] operator[SEP] { identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[Proxy] identifier[p] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[Proxy] operator[SEP] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[Proxy] operator[SEP] identifier[Type] operator[SEP] identifier[HTTP] , Keyword[new] identifier[InetSocketAddress] operator[SEP] identifier[proxy] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] , identifier[proxy] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[setProxy] operator[SEP] identifier[p] operator[SEP] operator[SEP] } Keyword[else] identifier[client] operator[SEP] identifier[setProxy] operator[SEP] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[Proxy] operator[SEP] identifier[NO_PROXY] operator[SEP] operator[SEP] }
public static final PhotoList<Photo> createPhotoList(Element photosElement) { PhotoList<Photo> photos = new PhotoList<Photo>(); photos.setPage(photosElement.getAttribute("page")); photos.setPages(photosElement.getAttribute("pages")); photos.setPerPage(photosElement.getAttribute("perpage")); photos.setTotal(photosElement.getAttribute("total")); NodeList photoNodes = photosElement.getElementsByTagName("photo"); for (int i = 0; i < photoNodes.getLength(); i++) { Element photoElement = (Element) photoNodes.item(i); photos.add(PhotoUtils.createPhoto(photoElement)); } return photos; }
class class_name[name] begin[{] method[createPhotoList, return_type[type[PhotoList]], modifier[final public static], parameter[photosElement]] begin[{] local_variable[type[PhotoList], photos] call[photos.setPage, parameter[call[photosElement.getAttribute, parameter[literal["page"]]]]] call[photos.setPages, parameter[call[photosElement.getAttribute, parameter[literal["pages"]]]]] call[photos.setPerPage, parameter[call[photosElement.getAttribute, parameter[literal["perpage"]]]]] call[photos.setTotal, parameter[call[photosElement.getAttribute, parameter[literal["total"]]]]] local_variable[type[NodeList], photoNodes] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=photoNodes, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), name=photoElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=photoElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createPhoto, postfix_operators=[], prefix_operators=[], qualifier=PhotoUtils, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=photos, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=photoNodes, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.photos]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] identifier[PhotoList] operator[<] identifier[Photo] operator[>] identifier[createPhotoList] operator[SEP] identifier[Element] identifier[photosElement] operator[SEP] { identifier[PhotoList] operator[<] identifier[Photo] operator[>] identifier[photos] operator[=] Keyword[new] identifier[PhotoList] operator[<] identifier[Photo] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[setPage] operator[SEP] identifier[photosElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[setPages] operator[SEP] identifier[photosElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[setPerPage] operator[SEP] identifier[photosElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[setTotal] operator[SEP] identifier[photosElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[NodeList] identifier[photoNodes] operator[=] identifier[photosElement] operator[SEP] identifier[getElementsByTagName] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[photoNodes] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Element] identifier[photoElement] operator[=] operator[SEP] identifier[Element] operator[SEP] identifier[photoNodes] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[photos] operator[SEP] identifier[add] operator[SEP] identifier[PhotoUtils] operator[SEP] identifier[createPhoto] operator[SEP] identifier[photoElement] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[photos] operator[SEP] }
public static long getKey(final SAMRecord rec) { final int refIdx = rec.getReferenceIndex(); final int start = rec.getAlignmentStart(); if (!(rec.getReadUnmappedFlag() || refIdx < 0 || start < 0)) return getKey(refIdx, start); // Put unmapped reads at the end, but don't give them all the exact same // key so that they can be distributed to different reducers. // // A random number would probably be best, but to ensure that the same // record always gets the same key we use a fast hash instead. // // We avoid using hashCode(), because it's not guaranteed to have the // same value across different processes. int hash = 0; byte[] var; if ((var = rec.getVariableBinaryRepresentation()) != null) { // Undecoded BAM record: just hash its raw data. hash = (int)MurmurHash3.murmurhash3(var, hash); } else { // Decoded BAM record or any SAM record: hash a few representative // fields together. hash = (int)MurmurHash3.murmurhash3(rec.getReadName(), hash); hash = (int)MurmurHash3.murmurhash3(rec.getReadBases(), hash); hash = (int)MurmurHash3.murmurhash3(rec.getBaseQualities(), hash); hash = (int)MurmurHash3.murmurhash3(rec.getCigarString(), hash); } return getKey0(Integer.MAX_VALUE, hash); }
class class_name[name] begin[{] method[getKey, return_type[type[long]], modifier[public static], parameter[rec]] begin[{] local_variable[type[int], refIdx] local_variable[type[int], start] if[binary_operation[binary_operation[call[rec.getReadUnmappedFlag, parameter[]], ||, binary_operation[member[.refIdx], <, literal[0]]], ||, binary_operation[member[.start], <, literal[0]]]] begin[{] return[call[.getKey, parameter[member[.refIdx], member[.start]]]] else begin[{] None end[}] local_variable[type[int], hash] local_variable[type[byte], var] if[binary_operation[assign[member[.var], call[rec.getVariableBinaryRepresentation, parameter[]]], !=, literal[null]]] begin[{] assign[member[.hash], Cast(expression=MethodInvocation(arguments=[MemberReference(member=var, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=murmurhash3, postfix_operators=[], prefix_operators=[], qualifier=MurmurHash3, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] else begin[{] assign[member[.hash], Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getReadName, postfix_operators=[], prefix_operators=[], qualifier=rec, selectors=[], type_arguments=None), MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=murmurhash3, postfix_operators=[], prefix_operators=[], qualifier=MurmurHash3, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] assign[member[.hash], Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getReadBases, postfix_operators=[], prefix_operators=[], qualifier=rec, selectors=[], type_arguments=None), MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=murmurhash3, postfix_operators=[], prefix_operators=[], qualifier=MurmurHash3, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] assign[member[.hash], Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBaseQualities, postfix_operators=[], prefix_operators=[], qualifier=rec, selectors=[], type_arguments=None), MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=murmurhash3, postfix_operators=[], prefix_operators=[], qualifier=MurmurHash3, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] assign[member[.hash], Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCigarString, postfix_operators=[], prefix_operators=[], qualifier=rec, selectors=[], type_arguments=None), MemberReference(member=hash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=murmurhash3, postfix_operators=[], prefix_operators=[], qualifier=MurmurHash3, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] end[}] return[call[.getKey0, parameter[member[Integer.MAX_VALUE], member[.hash]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[long] identifier[getKey] operator[SEP] Keyword[final] identifier[SAMRecord] identifier[rec] operator[SEP] { Keyword[final] Keyword[int] identifier[refIdx] operator[=] identifier[rec] operator[SEP] identifier[getReferenceIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[start] operator[=] identifier[rec] operator[SEP] identifier[getAlignmentStart] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[rec] operator[SEP] identifier[getReadUnmappedFlag] operator[SEP] operator[SEP] operator[||] identifier[refIdx] operator[<] Other[0] operator[||] identifier[start] operator[<] Other[0] operator[SEP] operator[SEP] Keyword[return] identifier[getKey] operator[SEP] identifier[refIdx] , identifier[start] operator[SEP] operator[SEP] Keyword[int] identifier[hash] operator[=] Other[0] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[var] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[var] operator[=] identifier[rec] operator[SEP] identifier[getVariableBinaryRepresentation] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[hash] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[MurmurHash3] operator[SEP] identifier[murmurhash3] operator[SEP] identifier[var] , identifier[hash] operator[SEP] operator[SEP] } Keyword[else] { identifier[hash] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[MurmurHash3] operator[SEP] identifier[murmurhash3] operator[SEP] identifier[rec] operator[SEP] identifier[getReadName] operator[SEP] operator[SEP] , identifier[hash] operator[SEP] operator[SEP] identifier[hash] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[MurmurHash3] operator[SEP] identifier[murmurhash3] operator[SEP] identifier[rec] operator[SEP] identifier[getReadBases] operator[SEP] operator[SEP] , identifier[hash] operator[SEP] operator[SEP] identifier[hash] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[MurmurHash3] operator[SEP] identifier[murmurhash3] operator[SEP] identifier[rec] operator[SEP] identifier[getBaseQualities] operator[SEP] operator[SEP] , identifier[hash] operator[SEP] operator[SEP] identifier[hash] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[MurmurHash3] operator[SEP] identifier[murmurhash3] operator[SEP] identifier[rec] operator[SEP] identifier[getCigarString] operator[SEP] operator[SEP] , identifier[hash] operator[SEP] operator[SEP] } Keyword[return] identifier[getKey0] operator[SEP] identifier[Integer] operator[SEP] identifier[MAX_VALUE] , identifier[hash] operator[SEP] operator[SEP] }
public static BigInteger nextBigInteger( final BigInteger n, final Random random ) { if (n.compareTo(BigInteger.ONE) < 0) { throw new IllegalArgumentException(format( "n is smaller than one: %d", n )); } BigInteger result = null; if (n.bitLength() <= Integer.SIZE - 1) { result = BigInteger.valueOf(random.nextInt(n.intValue())); } else if (n.bitLength() <= Long.SIZE - 1) { result = BigInteger.valueOf(nextLong(n.longValue(), random)); } else { do { result = new BigInteger(n.bitLength(), random).mod(n); } while (result.compareTo(n) > 0); } return result; }
class class_name[name] begin[{] method[nextBigInteger, return_type[type[BigInteger]], modifier[public static], parameter[n, random]] begin[{] if[binary_operation[call[n.compareTo, parameter[member[BigInteger.ONE]]], <, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="n is smaller than one: %d"), MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[BigInteger], result] if[binary_operation[call[n.bitLength, parameter[]], <=, binary_operation[member[Integer.SIZE], -, literal[1]]]] begin[{] assign[member[.result], call[BigInteger.valueOf, parameter[call[random.nextInt, parameter[call[n.intValue, parameter[]]]]]]] else begin[{] if[binary_operation[call[n.bitLength, parameter[]], <=, binary_operation[member[Long.SIZE], -, literal[1]]]] begin[{] assign[member[.result], call[BigInteger.valueOf, parameter[call[.nextLong, parameter[call[n.longValue, parameter[]], member[.random]]]]]] else begin[{] do[binary_operation[call[result.compareTo, parameter[member[.n]]], >, literal[0]]] begin[{] assign[member[.result], ClassCreator(arguments=[MethodInvocation(arguments=[], member=bitLength, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None), MemberReference(member=random, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BigInteger, sub_type=None))] end[}] end[}] end[}] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[BigInteger] identifier[nextBigInteger] operator[SEP] Keyword[final] identifier[BigInteger] identifier[n] , Keyword[final] identifier[Random] identifier[random] operator[SEP] { Keyword[if] operator[SEP] identifier[n] operator[SEP] identifier[compareTo] operator[SEP] identifier[BigInteger] operator[SEP] identifier[ONE] operator[SEP] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[n] operator[SEP] operator[SEP] operator[SEP] } identifier[BigInteger] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[SEP] identifier[bitLength] operator[SEP] operator[SEP] operator[<=] identifier[Integer] operator[SEP] identifier[SIZE] operator[-] Other[1] operator[SEP] { identifier[result] operator[=] identifier[BigInteger] operator[SEP] identifier[valueOf] operator[SEP] identifier[random] operator[SEP] identifier[nextInt] operator[SEP] identifier[n] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[n] operator[SEP] identifier[bitLength] operator[SEP] operator[SEP] operator[<=] identifier[Long] operator[SEP] identifier[SIZE] operator[-] Other[1] operator[SEP] { identifier[result] operator[=] identifier[BigInteger] operator[SEP] identifier[valueOf] operator[SEP] identifier[nextLong] operator[SEP] identifier[n] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] , identifier[random] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[do] { identifier[result] operator[=] Keyword[new] identifier[BigInteger] operator[SEP] identifier[n] operator[SEP] identifier[bitLength] operator[SEP] operator[SEP] , identifier[random] operator[SEP] operator[SEP] identifier[mod] operator[SEP] identifier[n] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[result] operator[SEP] identifier[compareTo] operator[SEP] identifier[n] operator[SEP] operator[>] Other[0] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public void marshall(DisassociateDeviceFromRoomRequest disassociateDeviceFromRoomRequest, ProtocolMarshaller protocolMarshaller) { if (disassociateDeviceFromRoomRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(disassociateDeviceFromRoomRequest.getDeviceArn(), DEVICEARN_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[disassociateDeviceFromRoomRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.disassociateDeviceFromRoomRequest], ==, 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=getDeviceArn, postfix_operators=[], prefix_operators=[], qualifier=disassociateDeviceFromRoomRequest, selectors=[], type_arguments=None), MemberReference(member=DEVICEARN_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[DisassociateDeviceFromRoomRequest] identifier[disassociateDeviceFromRoomRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[disassociateDeviceFromRoomRequest] 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[disassociateDeviceFromRoomRequest] operator[SEP] identifier[getDeviceArn] operator[SEP] operator[SEP] , identifier[DEVICEARN_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public void updateMaxConnections (final int max) { try { Connection conn = taskBalancer.getConnection(); int update = 0; int targetMaxC = connections.peek().getSettingAsInt(OperationalTextKey.MAX_CONNECTIONS); if (targetMaxC <= max) { if (targetMaxC > maxConnections) { update = targetMaxC - maxConnections; maxConnections = targetMaxC; } } else { if (max >= maxConnections) { update = max - maxConnections; maxConnections = max; } } SettingsMap sm = new SettingsMap(); sm.add(OperationalTextKey.MAX_CONNECTIONS, String.valueOf(maxConnections)); conn.update(sm); taskBalancer.releaseConnection(conn); if (update > 0) { addConnections(update); } else { for (int i = -1; i >= update; i--) { taskBalancer.getConnection().close(); } } } catch (Exception e) { // DO Nothing } }
class class_name[name] begin[{] method[updateMaxConnections, return_type[void], modifier[public], parameter[max]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=taskBalancer, selectors=[], type_arguments=None), name=conn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Connection, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=update)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=peek, postfix_operators=[], prefix_operators=[], qualifier=connections, selectors=[MethodInvocation(arguments=[MemberReference(member=MAX_CONNECTIONS, postfix_operators=[], prefix_operators=[], qualifier=OperationalTextKey, selectors=[])], member=getSettingAsInt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=targetMaxC)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=targetMaxC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxConnections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=update, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxConnections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxConnections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=targetMaxC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxConnections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=update, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=targetMaxC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxConnections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxConnections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=targetMaxC, 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=SettingsMap, sub_type=None)), name=sm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SettingsMap, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MAX_CONNECTIONS, postfix_operators=[], prefix_operators=[], qualifier=OperationalTextKey, selectors=[]), MethodInvocation(arguments=[MemberReference(member=maxConnections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=sm, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=update, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=releaseConnection, postfix_operators=[], prefix_operators=[], qualifier=taskBalancer, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=update, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=taskBalancer, selectors=[MethodInvocation(arguments=[], member=close, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=update, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=update, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addConnections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[updateMaxConnections] operator[SEP] Keyword[final] Keyword[int] identifier[max] operator[SEP] { Keyword[try] { identifier[Connection] identifier[conn] operator[=] identifier[taskBalancer] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[update] operator[=] Other[0] operator[SEP] Keyword[int] identifier[targetMaxC] operator[=] identifier[connections] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] identifier[getSettingAsInt] operator[SEP] identifier[OperationalTextKey] operator[SEP] identifier[MAX_CONNECTIONS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[targetMaxC] operator[<=] identifier[max] operator[SEP] { Keyword[if] operator[SEP] identifier[targetMaxC] operator[>] identifier[maxConnections] operator[SEP] { identifier[update] operator[=] identifier[targetMaxC] operator[-] identifier[maxConnections] operator[SEP] identifier[maxConnections] operator[=] identifier[targetMaxC] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[max] operator[>=] identifier[maxConnections] operator[SEP] { identifier[update] operator[=] identifier[max] operator[-] identifier[maxConnections] operator[SEP] identifier[maxConnections] operator[=] identifier[max] operator[SEP] } } identifier[SettingsMap] identifier[sm] operator[=] Keyword[new] identifier[SettingsMap] operator[SEP] operator[SEP] operator[SEP] identifier[sm] operator[SEP] identifier[add] operator[SEP] identifier[OperationalTextKey] operator[SEP] identifier[MAX_CONNECTIONS] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[maxConnections] operator[SEP] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[update] operator[SEP] identifier[sm] operator[SEP] operator[SEP] identifier[taskBalancer] operator[SEP] identifier[releaseConnection] operator[SEP] identifier[conn] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[update] operator[>] Other[0] operator[SEP] { identifier[addConnections] operator[SEP] identifier[update] operator[SEP] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] identifier[update] operator[SEP] identifier[i] operator[--] operator[SEP] { identifier[taskBalancer] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { } }
public static WQConstraint eq(final String field, final Object value) { if (value == null) return isNull(field); else return new WQConstraint(field, WQFunctionType.EQ, toString(value)); }
class class_name[name] begin[{] method[eq, return_type[type[WQConstraint]], modifier[public static], parameter[field, value]] begin[{] if[binary_operation[member[.value], ==, literal[null]]] begin[{] return[call[.isNull, parameter[member[.field]]]] else begin[{] return[ClassCreator(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EQ, postfix_operators=[], prefix_operators=[], qualifier=WQFunctionType, selectors=[]), MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WQConstraint, sub_type=None))] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[WQConstraint] identifier[eq] operator[SEP] Keyword[final] identifier[String] identifier[field] , Keyword[final] identifier[Object] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] Keyword[return] identifier[isNull] operator[SEP] identifier[field] operator[SEP] operator[SEP] Keyword[else] Keyword[return] Keyword[new] identifier[WQConstraint] operator[SEP] identifier[field] , identifier[WQFunctionType] operator[SEP] identifier[EQ] , identifier[toString] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] }
public static <T extends Collection<?>> T notEmpty(final T collection, final String message, final Object... values) { return INSTANCE.notEmpty(collection, message, values); }
class class_name[name] begin[{] method[notEmpty, return_type[type[T]], modifier[public static], parameter[collection, message, values]] begin[{] return[call[INSTANCE.notEmpty, parameter[member[.collection], member[.message], member[.values]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Collection] operator[<] operator[?] operator[>] operator[>] identifier[T] identifier[notEmpty] operator[SEP] Keyword[final] identifier[T] identifier[collection] , Keyword[final] identifier[String] identifier[message] , Keyword[final] identifier[Object] operator[...] identifier[values] operator[SEP] { Keyword[return] identifier[INSTANCE] operator[SEP] identifier[notEmpty] operator[SEP] identifier[collection] , identifier[message] , identifier[values] operator[SEP] operator[SEP] }
protected String[] combineResultsFromMultipleReads(String[] buffer, String[] lastRead) { String[] t = new String[buffer.length + lastRead.length]; System.arraycopy(buffer, 0, t, 0, buffer.length); System.arraycopy(lastRead, 0, t, buffer.length, lastRead.length); return t; }
class class_name[name] begin[{] method[combineResultsFromMultipleReads, return_type[type[String]], modifier[protected], parameter[buffer, lastRead]] begin[{] local_variable[type[String], t] call[System.arraycopy, parameter[member[.buffer], literal[0], member[.t], literal[0], member[buffer.length]]] call[System.arraycopy, parameter[member[.lastRead], literal[0], member[.t], member[buffer.length], member[lastRead.length]]] return[member[.t]] end[}] END[}]
Keyword[protected] identifier[String] operator[SEP] operator[SEP] identifier[combineResultsFromMultipleReads] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[buffer] , identifier[String] operator[SEP] operator[SEP] identifier[lastRead] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[t] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[buffer] operator[SEP] identifier[length] operator[+] identifier[lastRead] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[buffer] , Other[0] , identifier[t] , Other[0] , identifier[buffer] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[lastRead] , Other[0] , identifier[t] , identifier[buffer] operator[SEP] identifier[length] , identifier[lastRead] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[t] operator[SEP] }
@Override @Deprecated public final org.jdom2.Element setName(String value) { return super.setName(value); }
class class_name[name] begin[{] method[setName, return_type[type[org]], modifier[final public], parameter[value]] begin[{] return[SuperMethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setName, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] annotation[@] identifier[Deprecated] Keyword[public] Keyword[final] identifier[org] operator[SEP] identifier[jdom2] operator[SEP] identifier[Element] identifier[setName] operator[SEP] identifier[String] identifier[value] operator[SEP] { Keyword[return] Keyword[super] operator[SEP] identifier[setName] operator[SEP] identifier[value] operator[SEP] operator[SEP] }
@Override public EEnum getIfcTaskDurationEnum() { if (ifcTaskDurationEnumEEnum == null) { ifcTaskDurationEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(1083); } return ifcTaskDurationEnumEEnum; }
class class_name[name] begin[{] method[getIfcTaskDurationEnum, return_type[type[EEnum]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcTaskDurationEnumEEnum], ==, literal[null]]] begin[{] assign[member[.ifcTaskDurationEnumEEnum], 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=1083)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EEnum, sub_type=None))] else begin[{] None end[}] return[member[.ifcTaskDurationEnumEEnum]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EEnum] identifier[getIfcTaskDurationEnum] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcTaskDurationEnumEEnum] operator[==] Other[null] operator[SEP] { identifier[ifcTaskDurationEnumEEnum] operator[=] operator[SEP] identifier[EEnum] 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[1083] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcTaskDurationEnumEEnum] operator[SEP] }
public Observable<ServiceResponse<Void>> addVideoFrameUrlWithServiceResponseAsync(String teamName, String reviewId, String contentType, List<VideoFrameBodyItem> videoFrameBody, AddVideoFrameUrlOptionalParameter addVideoFrameUrlOptionalParameter) { if (this.client.baseUrl() == null) { throw new IllegalArgumentException("Parameter this.client.baseUrl() is required and cannot be null."); } if (teamName == null) { throw new IllegalArgumentException("Parameter teamName is required and cannot be null."); } if (reviewId == null) { throw new IllegalArgumentException("Parameter reviewId is required and cannot be null."); } if (contentType == null) { throw new IllegalArgumentException("Parameter contentType is required and cannot be null."); } if (videoFrameBody == null) { throw new IllegalArgumentException("Parameter videoFrameBody is required and cannot be null."); } Validator.validate(videoFrameBody); final Integer timescale = addVideoFrameUrlOptionalParameter != null ? addVideoFrameUrlOptionalParameter.timescale() : null; return addVideoFrameUrlWithServiceResponseAsync(teamName, reviewId, contentType, videoFrameBody, timescale); }
class class_name[name] begin[{] method[addVideoFrameUrlWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[teamName, reviewId, contentType, videoFrameBody, addVideoFrameUrlOptionalParameter]] begin[{] if[binary_operation[THIS[member[None.client]call[None.baseUrl, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.baseUrl() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.teamName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter teamName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.reviewId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter reviewId is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.contentType], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter contentType is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.videoFrameBody], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter videoFrameBody is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[Validator.validate, parameter[member[.videoFrameBody]]] local_variable[type[Integer], timescale] return[call[.addVideoFrameUrlWithServiceResponseAsync, parameter[member[.teamName], member[.reviewId], member[.contentType], member[.videoFrameBody], member[.timescale]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Void] operator[>] operator[>] identifier[addVideoFrameUrlWithServiceResponseAsync] operator[SEP] identifier[String] identifier[teamName] , identifier[String] identifier[reviewId] , identifier[String] identifier[contentType] , identifier[List] operator[<] identifier[VideoFrameBodyItem] operator[>] identifier[videoFrameBody] , identifier[AddVideoFrameUrlOptionalParameter] identifier[addVideoFrameUrlOptionalParameter] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[baseUrl] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[teamName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[reviewId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[contentType] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[videoFrameBody] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[videoFrameBody] operator[SEP] operator[SEP] Keyword[final] identifier[Integer] identifier[timescale] operator[=] identifier[addVideoFrameUrlOptionalParameter] operator[!=] Other[null] operator[?] identifier[addVideoFrameUrlOptionalParameter] operator[SEP] identifier[timescale] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[return] identifier[addVideoFrameUrlWithServiceResponseAsync] operator[SEP] identifier[teamName] , identifier[reviewId] , identifier[contentType] , identifier[videoFrameBody] , identifier[timescale] operator[SEP] operator[SEP] }
final public Selector NullPredicate() throws ParseException { boolean not=false; Selector ans; ans = FieldRef(); jj_consume_token(IS); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case NOT: jj_consume_token(NOT); not = true; break; default: jj_la1[11] = jj_gen; ; } jj_consume_token(NULL); ans = new OperatorImpl(Operator.ISNULL, ans); if (not) {if (true) return new OperatorImpl(Operator.NOT, ans);} else {if (true) return ans;} throw new Error("Missing return statement in function"); }
class class_name[name] begin[{] method[NullPredicate, return_type[type[Selector]], modifier[final public], parameter[]] begin[{] local_variable[type[boolean], not] local_variable[type[Selector], ans] assign[member[.ans], call[.FieldRef, parameter[]]] call[.jj_consume_token, parameter[member[.IS]]] SwitchStatement(cases=[SwitchStatementCase(case=['NOT'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=NOT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=jj_consume_token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=not, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=jj_la1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=11))]), type==, value=MemberReference(member=jj_gen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), Statement(label=None)])], expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=jj_ntk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), if_false=MemberReference(member=jj_ntk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=jj_ntk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None) call[.jj_consume_token, parameter[member[.NULL]]] assign[member[.ans], ClassCreator(arguments=[MemberReference(member=ISNULL, postfix_operators=[], prefix_operators=[], qualifier=Operator, selectors=[]), MemberReference(member=ans, 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=OperatorImpl, sub_type=None))] if[member[.not]] begin[{] if[literal[true]] begin[{] return[ClassCreator(arguments=[MemberReference(member=NOT, postfix_operators=[], prefix_operators=[], qualifier=Operator, selectors=[]), MemberReference(member=ans, 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=OperatorImpl, sub_type=None))] else begin[{] None end[}] else begin[{] if[literal[true]] begin[{] return[member[.ans]] else begin[{] None end[}] end[}] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing return statement in function")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Error, sub_type=None)), label=None) end[}] END[}]
Keyword[final] Keyword[public] identifier[Selector] identifier[NullPredicate] operator[SEP] operator[SEP] Keyword[throws] identifier[ParseException] { Keyword[boolean] identifier[not] operator[=] literal[boolean] operator[SEP] identifier[Selector] identifier[ans] operator[SEP] identifier[ans] operator[=] identifier[FieldRef] operator[SEP] operator[SEP] operator[SEP] identifier[jj_consume_token] operator[SEP] identifier[IS] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] operator[SEP] identifier[jj_ntk] operator[==] operator[-] Other[1] operator[SEP] operator[?] identifier[jj_ntk] operator[SEP] operator[SEP] operator[:] identifier[jj_ntk] operator[SEP] { Keyword[case] identifier[NOT] operator[:] identifier[jj_consume_token] operator[SEP] identifier[NOT] operator[SEP] operator[SEP] identifier[not] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[jj_la1] operator[SEP] Other[11] operator[SEP] operator[=] identifier[jj_gen] operator[SEP] operator[SEP] } identifier[jj_consume_token] operator[SEP] identifier[NULL] operator[SEP] operator[SEP] identifier[ans] operator[=] Keyword[new] identifier[OperatorImpl] operator[SEP] identifier[Operator] operator[SEP] identifier[ISNULL] , identifier[ans] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[not] operator[SEP] { Keyword[if] operator[SEP] literal[boolean] operator[SEP] Keyword[return] Keyword[new] identifier[OperatorImpl] operator[SEP] identifier[Operator] operator[SEP] identifier[NOT] , identifier[ans] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] literal[boolean] operator[SEP] Keyword[return] identifier[ans] operator[SEP] } Keyword[throw] Keyword[new] identifier[Error] operator[SEP] literal[String] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") @Override public <T extends MonetaryAmount> MonetaryAmountFactory<T> getAmountFactory(Class<T> amountType) { if (Geldbetrag.class.equals(amountType)) { return (MonetaryAmountFactory<T>) new GeldbetragFactory(); } MonetaryAmountFactoryProviderSpi<T> f = MonetaryAmountFactoryProviderSpi.class.cast(factories.get(amountType)); if (Objects.nonNull(f)) { return f.createMonetaryAmountFactory(); } throw new MonetaryException("no MonetaryAmountFactory found for " + amountType); }
class class_name[name] begin[{] method[getAmountFactory, return_type[type[MonetaryAmountFactory]], modifier[public], parameter[amountType]] begin[{] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=amountType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Geldbetrag, sub_type=None))] begin[{] return[Cast(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GeldbetragFactory, sub_type=None)), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=MonetaryAmountFactory, sub_type=None))] else begin[{] None end[}] local_variable[type[MonetaryAmountFactoryProviderSpi], f] if[call[Objects.nonNull, parameter[member[.f]]]] begin[{] return[call[f.createMonetaryAmountFactory, parameter[]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no MonetaryAmountFactory found for "), operandr=MemberReference(member=amountType, 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=MonetaryException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[MonetaryAmount] operator[>] identifier[MonetaryAmountFactory] operator[<] identifier[T] operator[>] identifier[getAmountFactory] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[amountType] operator[SEP] { Keyword[if] operator[SEP] identifier[Geldbetrag] operator[SEP] Keyword[class] operator[SEP] identifier[equals] operator[SEP] identifier[amountType] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[MonetaryAmountFactory] operator[<] identifier[T] operator[>] operator[SEP] Keyword[new] identifier[GeldbetragFactory] operator[SEP] operator[SEP] operator[SEP] } identifier[MonetaryAmountFactoryProviderSpi] operator[<] identifier[T] operator[>] identifier[f] operator[=] identifier[MonetaryAmountFactoryProviderSpi] operator[SEP] Keyword[class] operator[SEP] identifier[cast] operator[SEP] identifier[factories] operator[SEP] identifier[get] operator[SEP] identifier[amountType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Objects] operator[SEP] identifier[nonNull] operator[SEP] identifier[f] operator[SEP] operator[SEP] { Keyword[return] identifier[f] operator[SEP] identifier[createMonetaryAmountFactory] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[MonetaryException] operator[SEP] literal[String] operator[+] identifier[amountType] operator[SEP] operator[SEP] }
public Observable<SpatialAnchorsAccountKeysInner> regenerateKeysAsync(String resourceGroupName, String spatialAnchorsAccountName, Integer serial) { return regenerateKeysWithServiceResponseAsync(resourceGroupName, spatialAnchorsAccountName, serial).map(new Func1<ServiceResponse<SpatialAnchorsAccountKeysInner>, SpatialAnchorsAccountKeysInner>() { @Override public SpatialAnchorsAccountKeysInner call(ServiceResponse<SpatialAnchorsAccountKeysInner> response) { return response.body(); } }); }
class class_name[name] begin[{] method[regenerateKeysAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, spatialAnchorsAccountName, serial]] begin[{] return[call[.regenerateKeysWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.spatialAnchorsAccountName], member[.serial]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[SpatialAnchorsAccountKeysInner] operator[>] identifier[regenerateKeysAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[spatialAnchorsAccountName] , identifier[Integer] identifier[serial] operator[SEP] { Keyword[return] identifier[regenerateKeysWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[spatialAnchorsAccountName] , identifier[serial] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[SpatialAnchorsAccountKeysInner] operator[>] , identifier[SpatialAnchorsAccountKeysInner] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[SpatialAnchorsAccountKeysInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[SpatialAnchorsAccountKeysInner] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public QuorumConfig getQuorumConfig(String name) { return ConfigUtils.getConfig(configPatternMatcher, quorumConfigs, name, QuorumConfig.class); }
class class_name[name] begin[{] method[getQuorumConfig, return_type[type[QuorumConfig]], modifier[public], parameter[name]] begin[{] return[call[ConfigUtils.getConfig, parameter[member[.configPatternMatcher], member[.quorumConfigs], member[.name], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QuorumConfig, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[QuorumConfig] identifier[getQuorumConfig] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[return] identifier[ConfigUtils] operator[SEP] identifier[getConfig] operator[SEP] identifier[configPatternMatcher] , identifier[quorumConfigs] , identifier[name] , identifier[QuorumConfig] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public PaymillList<Refund> list( Refund.Filter filter, Refund.Order order ) { return this.list( filter, order, null, null ); }
class class_name[name] begin[{] method[list, return_type[type[PaymillList]], modifier[public], parameter[filter, order]] begin[{] return[THIS[call[None.list, parameter[member[.filter], member[.order], literal[null], literal[null]]]]] end[}] END[}]
Keyword[public] identifier[PaymillList] operator[<] identifier[Refund] operator[>] identifier[list] operator[SEP] identifier[Refund] operator[SEP] identifier[Filter] identifier[filter] , identifier[Refund] operator[SEP] identifier[Order] identifier[order] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[list] operator[SEP] identifier[filter] , identifier[order] , Other[null] , Other[null] operator[SEP] operator[SEP] }
public DeleteLaunchTemplateVersionsResult withUnsuccessfullyDeletedLaunchTemplateVersions( DeleteLaunchTemplateVersionsResponseErrorItem... unsuccessfullyDeletedLaunchTemplateVersions) { if (this.unsuccessfullyDeletedLaunchTemplateVersions == null) { setUnsuccessfullyDeletedLaunchTemplateVersions(new com.amazonaws.internal.SdkInternalList<DeleteLaunchTemplateVersionsResponseErrorItem>( unsuccessfullyDeletedLaunchTemplateVersions.length)); } for (DeleteLaunchTemplateVersionsResponseErrorItem ele : unsuccessfullyDeletedLaunchTemplateVersions) { this.unsuccessfullyDeletedLaunchTemplateVersions.add(ele); } return this; }
class class_name[name] begin[{] method[withUnsuccessfullyDeletedLaunchTemplateVersions, return_type[type[DeleteLaunchTemplateVersionsResult]], modifier[public], parameter[unsuccessfullyDeletedLaunchTemplateVersions]] begin[{] if[binary_operation[THIS[member[None.unsuccessfullyDeletedLaunchTemplateVersions]], ==, literal[null]]] begin[{] call[.setUnsuccessfullyDeletedLaunchTemplateVersions, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=unsuccessfullyDeletedLaunchTemplateVersions, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DeleteLaunchTemplateVersionsResponseErrorItem, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=unsuccessfullyDeletedLaunchTemplateVersions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=unsuccessfullyDeletedLaunchTemplateVersions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DeleteLaunchTemplateVersionsResponseErrorItem, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[DeleteLaunchTemplateVersionsResult] identifier[withUnsuccessfullyDeletedLaunchTemplateVersions] operator[SEP] identifier[DeleteLaunchTemplateVersionsResponseErrorItem] operator[...] identifier[unsuccessfullyDeletedLaunchTemplateVersions] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[unsuccessfullyDeletedLaunchTemplateVersions] operator[==] Other[null] operator[SEP] { identifier[setUnsuccessfullyDeletedLaunchTemplateVersions] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[DeleteLaunchTemplateVersionsResponseErrorItem] operator[>] operator[SEP] identifier[unsuccessfullyDeletedLaunchTemplateVersions] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[DeleteLaunchTemplateVersionsResponseErrorItem] identifier[ele] operator[:] identifier[unsuccessfullyDeletedLaunchTemplateVersions] operator[SEP] { Keyword[this] operator[SEP] identifier[unsuccessfullyDeletedLaunchTemplateVersions] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public void compareFilter(String ElementName, String value, int oper) throws DBException { // Delete the old search filter m_filter = null; // If this is not a binary operator, throw an exception if ((oper & BINARY_OPER_MASK) == 0) { throw new DBException(); // Create a SearchBaseLeafComparison node and store it as the filter } m_filter = new SearchBaseLeafComparison(ElementName, oper, value); }
class class_name[name] begin[{] method[compareFilter, return_type[void], modifier[public], parameter[ElementName, value, oper]] begin[{] assign[member[.m_filter], literal[null]] if[binary_operation[binary_operation[member[.oper], &, member[.BINARY_OPER_MASK]], ==, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DBException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.m_filter], ClassCreator(arguments=[MemberReference(member=ElementName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SearchBaseLeafComparison, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[void] identifier[compareFilter] operator[SEP] identifier[String] identifier[ElementName] , identifier[String] identifier[value] , Keyword[int] identifier[oper] operator[SEP] Keyword[throws] identifier[DBException] { identifier[m_filter] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[oper] operator[&] identifier[BINARY_OPER_MASK] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[DBException] operator[SEP] operator[SEP] operator[SEP] } identifier[m_filter] operator[=] Keyword[new] identifier[SearchBaseLeafComparison] operator[SEP] identifier[ElementName] , identifier[oper] , identifier[value] operator[SEP] operator[SEP] }
public static <A extends Comparable<A>, B extends Comparable<B>> Comparator<CmsPair<A, B>> getLexicalComparator() { return new Comparator<CmsPair<A, B>>() { /** * @see java.util.Comparator#compare(Object,Object) */ public int compare(CmsPair<A, B> pair1, CmsPair<A, B> pair2) { int c = pair1.getFirst().compareTo(pair2.getFirst()); if (c != 0) { return c; } return pair1.getSecond().compareTo(pair2.getSecond()); } }; }
class class_name[name] begin[{] method[getLexicalComparator, return_type[type[Comparator]], modifier[public static], parameter[]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFirst, postfix_operators=[], prefix_operators=[], qualifier=pair1, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFirst, postfix_operators=[], prefix_operators=[], qualifier=pair2, selectors=[], type_arguments=None)], member=compareTo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[], member=getSecond, postfix_operators=[], prefix_operators=[], qualifier=pair1, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSecond, postfix_operators=[], prefix_operators=[], qualifier=pair2, selectors=[], type_arguments=None)], member=compareTo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=/** * @see java.util.Comparator#compare(Object,Object) */, modifiers={'public'}, name=compare, parameters=[FormalParameter(annotations=[], modifiers=set(), name=pair1, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=A, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=B, sub_type=None))], dimensions=[], name=CmsPair, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=pair2, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=A, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=B, sub_type=None))], dimensions=[], name=CmsPair, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=int), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=A, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=B, sub_type=None))], dimensions=[], name=CmsPair, sub_type=None))], dimensions=None, name=Comparator, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[A] Keyword[extends] identifier[Comparable] operator[<] identifier[A] operator[>] , identifier[B] Keyword[extends] identifier[Comparable] operator[<] identifier[B] operator[>] operator[>] identifier[Comparator] operator[<] identifier[CmsPair] operator[<] identifier[A] , identifier[B] operator[>] operator[>] identifier[getLexicalComparator] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[Comparator] operator[<] identifier[CmsPair] operator[<] identifier[A] , identifier[B] operator[>] operator[>] operator[SEP] operator[SEP] { Keyword[public] Keyword[int] identifier[compare] operator[SEP] identifier[CmsPair] operator[<] identifier[A] , identifier[B] operator[>] identifier[pair1] , identifier[CmsPair] operator[<] identifier[A] , identifier[B] operator[>] identifier[pair2] operator[SEP] { Keyword[int] identifier[c] operator[=] identifier[pair1] operator[SEP] identifier[getFirst] operator[SEP] operator[SEP] operator[SEP] identifier[compareTo] operator[SEP] identifier[pair2] operator[SEP] identifier[getFirst] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[!=] Other[0] operator[SEP] { Keyword[return] identifier[c] operator[SEP] } Keyword[return] identifier[pair1] operator[SEP] identifier[getSecond] operator[SEP] operator[SEP] operator[SEP] identifier[compareTo] operator[SEP] identifier[pair2] operator[SEP] identifier[getSecond] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
public DescribeScalingPlanResourcesResult withScalingPlanResources(ScalingPlanResource... scalingPlanResources) { if (this.scalingPlanResources == null) { setScalingPlanResources(new java.util.ArrayList<ScalingPlanResource>(scalingPlanResources.length)); } for (ScalingPlanResource ele : scalingPlanResources) { this.scalingPlanResources.add(ele); } return this; }
class class_name[name] begin[{] method[withScalingPlanResources, return_type[type[DescribeScalingPlanResourcesResult]], modifier[public], parameter[scalingPlanResources]] begin[{] if[binary_operation[THIS[member[None.scalingPlanResources]], ==, literal[null]]] begin[{] call[.setScalingPlanResources, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=scalingPlanResources, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ScalingPlanResource, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=scalingPlanResources, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=scalingPlanResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ScalingPlanResource, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[DescribeScalingPlanResourcesResult] identifier[withScalingPlanResources] operator[SEP] identifier[ScalingPlanResource] operator[...] identifier[scalingPlanResources] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[scalingPlanResources] operator[==] Other[null] operator[SEP] { identifier[setScalingPlanResources] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[ScalingPlanResource] operator[>] operator[SEP] identifier[scalingPlanResources] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[ScalingPlanResource] identifier[ele] operator[:] identifier[scalingPlanResources] operator[SEP] { Keyword[this] operator[SEP] identifier[scalingPlanResources] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
@Override protected Cooccurrence filterCooccurence(JCas jCas, Annotation enclosingAnnot, Annotation annot1, Annotation annot2, String[] ids1, String[] ids2) { if (distance(annot1, annot2) < maximumDistance) { return super.filterCooccurence(jCas, enclosingAnnot, annot1, annot2, ids1, ids2); } else { return null; } }
class class_name[name] begin[{] method[filterCooccurence, return_type[type[Cooccurrence]], modifier[protected], parameter[jCas, enclosingAnnot, annot1, annot2, ids1, ids2]] begin[{] if[binary_operation[call[.distance, parameter[member[.annot1], member[.annot2]]], <, member[.maximumDistance]]] begin[{] return[SuperMethodInvocation(arguments=[MemberReference(member=jCas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enclosingAnnot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=annot1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=annot2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ids1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ids2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=filterCooccurence, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] else begin[{] return[literal[null]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[Cooccurrence] identifier[filterCooccurence] operator[SEP] identifier[JCas] identifier[jCas] , identifier[Annotation] identifier[enclosingAnnot] , identifier[Annotation] identifier[annot1] , identifier[Annotation] identifier[annot2] , identifier[String] operator[SEP] operator[SEP] identifier[ids1] , identifier[String] operator[SEP] operator[SEP] identifier[ids2] operator[SEP] { Keyword[if] operator[SEP] identifier[distance] operator[SEP] identifier[annot1] , identifier[annot2] operator[SEP] operator[<] identifier[maximumDistance] operator[SEP] { Keyword[return] Keyword[super] operator[SEP] identifier[filterCooccurence] operator[SEP] identifier[jCas] , identifier[enclosingAnnot] , identifier[annot1] , identifier[annot2] , identifier[ids1] , identifier[ids2] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
private static Field.TermVector getTermVectorParameter(int flags) { if (((flags & STORE_POSITION_WITH_TERM_VECTOR_FLAG) > 0) && ((flags & STORE_OFFSET_WITH_TERM_VECTOR_FLAG) > 0)) { return Field.TermVector.WITH_POSITIONS_OFFSETS; } else if ((flags & STORE_POSITION_WITH_TERM_VECTOR_FLAG) > 0) { return Field.TermVector.WITH_POSITIONS; } else if ((flags & STORE_OFFSET_WITH_TERM_VECTOR_FLAG) > 0) { return Field.TermVector.WITH_OFFSETS; } else if ((flags & STORE_TERM_VECTOR_FLAG) > 0) { return Field.TermVector.YES; } else { return Field.TermVector.NO; } }
class class_name[name] begin[{] method[getTermVectorParameter, return_type[type[Field]], modifier[private static], parameter[flags]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.flags], &, member[.STORE_POSITION_WITH_TERM_VECTOR_FLAG]], >, literal[0]], &&, binary_operation[binary_operation[member[.flags], &, member[.STORE_OFFSET_WITH_TERM_VECTOR_FLAG]], >, literal[0]]]] begin[{] return[member[Field.TermVector.WITH_POSITIONS_OFFSETS]] else begin[{] if[binary_operation[binary_operation[member[.flags], &, member[.STORE_POSITION_WITH_TERM_VECTOR_FLAG]], >, literal[0]]] begin[{] return[member[Field.TermVector.WITH_POSITIONS]] else begin[{] if[binary_operation[binary_operation[member[.flags], &, member[.STORE_OFFSET_WITH_TERM_VECTOR_FLAG]], >, literal[0]]] begin[{] return[member[Field.TermVector.WITH_OFFSETS]] else begin[{] if[binary_operation[binary_operation[member[.flags], &, member[.STORE_TERM_VECTOR_FLAG]], >, literal[0]]] begin[{] return[member[Field.TermVector.YES]] else begin[{] return[member[Field.TermVector.NO]] end[}] end[}] end[}] end[}] end[}] END[}]
Keyword[private] Keyword[static] identifier[Field] operator[SEP] identifier[TermVector] identifier[getTermVectorParameter] operator[SEP] Keyword[int] identifier[flags] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[flags] operator[&] identifier[STORE_POSITION_WITH_TERM_VECTOR_FLAG] operator[SEP] operator[>] Other[0] operator[SEP] operator[&&] operator[SEP] operator[SEP] identifier[flags] operator[&] identifier[STORE_OFFSET_WITH_TERM_VECTOR_FLAG] operator[SEP] operator[>] Other[0] operator[SEP] operator[SEP] { Keyword[return] identifier[Field] operator[SEP] identifier[TermVector] operator[SEP] identifier[WITH_POSITIONS_OFFSETS] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[flags] operator[&] identifier[STORE_POSITION_WITH_TERM_VECTOR_FLAG] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[return] identifier[Field] operator[SEP] identifier[TermVector] operator[SEP] identifier[WITH_POSITIONS] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[flags] operator[&] identifier[STORE_OFFSET_WITH_TERM_VECTOR_FLAG] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[return] identifier[Field] operator[SEP] identifier[TermVector] operator[SEP] identifier[WITH_OFFSETS] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[flags] operator[&] identifier[STORE_TERM_VECTOR_FLAG] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[return] identifier[Field] operator[SEP] identifier[TermVector] operator[SEP] identifier[YES] operator[SEP] } Keyword[else] { Keyword[return] identifier[Field] operator[SEP] identifier[TermVector] operator[SEP] identifier[NO] operator[SEP] } }
public X509Certificate generateSelfSignedCertificate(String subjectDN, KeyPair pair, int days, String algorithm) throws CertificateException { return generateCertificate(subjectDN, null, pair, null, days, algorithm); }
class class_name[name] begin[{] method[generateSelfSignedCertificate, return_type[type[X509Certificate]], modifier[public], parameter[subjectDN, pair, days, algorithm]] begin[{] return[call[.generateCertificate, parameter[member[.subjectDN], literal[null], member[.pair], literal[null], member[.days], member[.algorithm]]]] end[}] END[}]
Keyword[public] identifier[X509Certificate] identifier[generateSelfSignedCertificate] operator[SEP] identifier[String] identifier[subjectDN] , identifier[KeyPair] identifier[pair] , Keyword[int] identifier[days] , identifier[String] identifier[algorithm] operator[SEP] Keyword[throws] identifier[CertificateException] { Keyword[return] identifier[generateCertificate] operator[SEP] identifier[subjectDN] , Other[null] , identifier[pair] , Other[null] , identifier[days] , identifier[algorithm] operator[SEP] operator[SEP] }
@SuppressWarnings("OptionalGetWithoutIsPresent") // Previous validation ensures this is fine. private ImmutableList<FieldSpec> adapterDependenciesInternal( Collection<AdapterDescriptor> adapters, Set<TypeName> scoped) { ImmutableList.Builder<FieldSpec> adapterFields = new ImmutableList.Builder<>(); for (AdapterDescriptor adapter : adapters) { // Don't define the same adapter twice if (scoped.contains(adapter.typeName())) { continue; } scoped.add(adapter.typeName()); if (!adapter.singletonInstance().isPresent()) { ConstructorInfo constructorInfo = adapter.constructorInfo().get(); // Add dependencies, then create and add the current adapter List<AdapterDescriptor> adapterDependencies = new ArrayList<>(); for (ConstructorInfo.Param param : constructorInfo.constructorParameters()) { if (param instanceof ConstructorInfo.AdapterParam) { adapterDependencies.add(((ConstructorInfo.AdapterParam) param).adapter); } } if (adapterDependencies.size() > 0) { adapterFields.addAll(adapterDependenciesInternal(adapterDependencies, scoped)); } // Construct the single instance of this type adapter String adapterName = adapterNames.getName(adapter.typeName()); CodeBlock parameters = getAdapterParameterList(constructorInfo); ParameterizedTypeName adapterInterfaceType = ParameterizedTypeName.get(TYPE_ADAPTER, adapter.adaptedTypeName()); adapterFields.add( FieldSpec.builder(adapterInterfaceType, adapterName, STATIC, FINAL) .initializer(CodeBlock.of("new $T($L)", adapter.typeName(), parameters)) .build()); } } return adapterFields.build(); }
class class_name[name] begin[{] method[adapterDependenciesInternal, return_type[type[ImmutableList]], modifier[private], parameter[adapters, scoped]] begin[{] local_variable[type[ImmutableList], adapterFields] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=typeName, postfix_operators=[], prefix_operators=[], qualifier=adapter, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=scoped, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=typeName, postfix_operators=[], prefix_operators=[], qualifier=adapter, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=scoped, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=singletonInstance, postfix_operators=[], prefix_operators=['!'], qualifier=adapter, selectors=[MethodInvocation(arguments=[], member=isPresent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=constructorInfo, postfix_operators=[], prefix_operators=[], qualifier=adapter, selectors=[MethodInvocation(arguments=[], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=constructorInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConstructorInfo, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=adapterDependencies)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AdapterDescriptor, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=param, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ConstructorInfo, sub_type=ReferenceType(arguments=None, dimensions=None, name=AdapterParam, sub_type=None)), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=param, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ConstructorInfo, sub_type=ReferenceType(arguments=None, dimensions=None, name=AdapterParam, sub_type=None)))], member=add, postfix_operators=[], prefix_operators=[], qualifier=adapterDependencies, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=constructorParameters, postfix_operators=[], prefix_operators=[], qualifier=constructorInfo, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=param)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConstructorInfo, sub_type=ReferenceType(arguments=None, dimensions=None, name=Param, sub_type=None)))), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=adapterDependencies, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=adapterDependencies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scoped, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=adapterDependenciesInternal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=adapterFields, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=typeName, postfix_operators=[], prefix_operators=[], qualifier=adapter, selectors=[], type_arguments=None)], member=getName, postfix_operators=[], prefix_operators=[], qualifier=adapterNames, selectors=[], type_arguments=None), name=adapterName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=constructorInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAdapterParameterList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=parameters)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CodeBlock, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=TYPE_ADAPTER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=adaptedTypeName, postfix_operators=[], prefix_operators=[], qualifier=adapter, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=ParameterizedTypeName, selectors=[], type_arguments=None), name=adapterInterfaceType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ParameterizedTypeName, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=adapterInterfaceType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=adapterName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=STATIC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FINAL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=builder, postfix_operators=[], prefix_operators=[], qualifier=FieldSpec, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="new $T($L)"), MethodInvocation(arguments=[], member=typeName, postfix_operators=[], prefix_operators=[], qualifier=adapter, selectors=[], type_arguments=None), MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=CodeBlock, selectors=[], type_arguments=None)], member=initializer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=adapterFields, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=adapters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=adapter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AdapterDescriptor, sub_type=None))), label=None) return[call[adapterFields.build, parameter[]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] identifier[ImmutableList] operator[<] identifier[FieldSpec] operator[>] identifier[adapterDependenciesInternal] operator[SEP] identifier[Collection] operator[<] identifier[AdapterDescriptor] operator[>] identifier[adapters] , identifier[Set] operator[<] identifier[TypeName] operator[>] identifier[scoped] operator[SEP] { identifier[ImmutableList] operator[SEP] identifier[Builder] operator[<] identifier[FieldSpec] operator[>] identifier[adapterFields] operator[=] Keyword[new] identifier[ImmutableList] operator[SEP] identifier[Builder] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[AdapterDescriptor] identifier[adapter] operator[:] identifier[adapters] operator[SEP] { Keyword[if] operator[SEP] identifier[scoped] operator[SEP] identifier[contains] operator[SEP] identifier[adapter] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[scoped] operator[SEP] identifier[add] operator[SEP] identifier[adapter] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[adapter] operator[SEP] identifier[singletonInstance] operator[SEP] operator[SEP] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { identifier[ConstructorInfo] identifier[constructorInfo] operator[=] identifier[adapter] operator[SEP] identifier[constructorInfo] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[AdapterDescriptor] operator[>] identifier[adapterDependencies] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ConstructorInfo] operator[SEP] identifier[Param] identifier[param] operator[:] identifier[constructorInfo] operator[SEP] identifier[constructorParameters] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[param] Keyword[instanceof] identifier[ConstructorInfo] operator[SEP] identifier[AdapterParam] operator[SEP] { identifier[adapterDependencies] operator[SEP] identifier[add] operator[SEP] operator[SEP] operator[SEP] identifier[ConstructorInfo] operator[SEP] identifier[AdapterParam] operator[SEP] identifier[param] operator[SEP] operator[SEP] identifier[adapter] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[adapterDependencies] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[adapterFields] operator[SEP] identifier[addAll] operator[SEP] identifier[adapterDependenciesInternal] operator[SEP] identifier[adapterDependencies] , identifier[scoped] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[adapterName] operator[=] identifier[adapterNames] operator[SEP] identifier[getName] operator[SEP] identifier[adapter] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[CodeBlock] identifier[parameters] operator[=] identifier[getAdapterParameterList] operator[SEP] identifier[constructorInfo] operator[SEP] operator[SEP] identifier[ParameterizedTypeName] identifier[adapterInterfaceType] operator[=] identifier[ParameterizedTypeName] operator[SEP] identifier[get] operator[SEP] identifier[TYPE_ADAPTER] , identifier[adapter] operator[SEP] identifier[adaptedTypeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[adapterFields] operator[SEP] identifier[add] operator[SEP] identifier[FieldSpec] operator[SEP] identifier[builder] operator[SEP] identifier[adapterInterfaceType] , identifier[adapterName] , identifier[STATIC] , identifier[FINAL] operator[SEP] operator[SEP] identifier[initializer] operator[SEP] identifier[CodeBlock] operator[SEP] identifier[of] operator[SEP] literal[String] , identifier[adapter] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] , identifier[parameters] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[adapterFields] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
protected ISFSObject parseObject(GetterMethodCover method, Object object) { return object2params(method.getReturnClass(), object); }
class class_name[name] begin[{] method[parseObject, return_type[type[ISFSObject]], modifier[protected], parameter[method, object]] begin[{] return[call[.object2params, parameter[call[method.getReturnClass, parameter[]], member[.object]]]] end[}] END[}]
Keyword[protected] identifier[ISFSObject] identifier[parseObject] operator[SEP] identifier[GetterMethodCover] identifier[method] , identifier[Object] identifier[object] operator[SEP] { Keyword[return] identifier[object2params] operator[SEP] identifier[method] operator[SEP] identifier[getReturnClass] operator[SEP] operator[SEP] , identifier[object] operator[SEP] operator[SEP] }
final void setProducerType(ProducerType value) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setProducerType", value); /* Get the int value of the ProducerType and set that into the field */ getHdr2().setField(JsHdr2Access.PRODUCERTYPE, value.toByte()); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setProducerType"); }
class class_name[name] begin[{] method[setProducerType, return_type[void], modifier[final], parameter[value]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["setProducerType"], member[.value]]] else begin[{] None end[}] call[.getHdr2, parameter[]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["setProducerType"]]] else begin[{] None end[}] end[}] END[}]
Keyword[final] Keyword[void] identifier[setProducerType] operator[SEP] identifier[ProducerType] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[value] operator[SEP] operator[SEP] identifier[getHdr2] operator[SEP] operator[SEP] operator[SEP] identifier[setField] operator[SEP] identifier[JsHdr2Access] operator[SEP] identifier[PRODUCERTYPE] , identifier[value] operator[SEP] identifier[toByte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] }
public String getDisplayName( NameStyle style, Locale locale ) { return getDisplayName(this.getID(), style, locale); }
class class_name[name] begin[{] method[getDisplayName, return_type[type[String]], modifier[public], parameter[style, locale]] begin[{] return[call[.getDisplayName, parameter[THIS[call[None.getID, parameter[]]], member[.style], member[.locale]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getDisplayName] operator[SEP] identifier[NameStyle] identifier[style] , identifier[Locale] identifier[locale] operator[SEP] { Keyword[return] identifier[getDisplayName] operator[SEP] Keyword[this] operator[SEP] identifier[getID] operator[SEP] operator[SEP] , identifier[style] , identifier[locale] operator[SEP] operator[SEP] }
public boolean deleteIndex(Collection<FeatureIndexType> types) { boolean deleted = false; for (FeatureIndexType type : types) { if (deleteIndex(type)) { deleted = true; } } return deleted; }
class class_name[name] begin[{] method[deleteIndex, return_type[type[boolean]], modifier[public], parameter[types]] begin[{] local_variable[type[boolean], deleted] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=deleted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=types, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FeatureIndexType, sub_type=None))), label=None) return[member[.deleted]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[deleteIndex] operator[SEP] identifier[Collection] operator[<] identifier[FeatureIndexType] operator[>] identifier[types] operator[SEP] { Keyword[boolean] identifier[deleted] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[FeatureIndexType] identifier[type] operator[:] identifier[types] operator[SEP] { Keyword[if] operator[SEP] identifier[deleteIndex] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[deleted] operator[=] literal[boolean] operator[SEP] } } Keyword[return] identifier[deleted] operator[SEP] }
@Implementation(minSdk = P) protected static long nativeCreate() { // AssetManager2 needs to be protected by a lock. To avoid cache misses, we allocate the lock and // AssetManager2 in a contiguous block (GuardedAssetManager). // return reinterpret_cast<long>(new GuardedAssetManager()); long cppAssetManagerRef; // we want to share a single instance of the system CppAssetManager2 if (inNonSystemConstructor) { CppAssetManager2 appAssetManager = new CppAssetManager2(); cppAssetManagerRef = Registries.NATIVE_ASSET_MANAGER_REGISTRY.register(appAssetManager); } else { if (systemCppAssetManager2 == null) { systemCppAssetManager2 = new CppAssetManager2(); systemCppAssetManager2Ref = Registries.NATIVE_ASSET_MANAGER_REGISTRY.register(systemCppAssetManager2); } cppAssetManagerRef = systemCppAssetManager2Ref; } return cppAssetManagerRef; }
class class_name[name] begin[{] method[nativeCreate, return_type[type[long]], modifier[static protected], parameter[]] begin[{] local_variable[type[long], cppAssetManagerRef] if[member[.inNonSystemConstructor]] begin[{] local_variable[type[CppAssetManager2], appAssetManager] assign[member[.cppAssetManagerRef], call[Registries.NATIVE_ASSET_MANAGER_REGISTRY.register, parameter[member[.appAssetManager]]]] else begin[{] if[binary_operation[member[.systemCppAssetManager2], ==, literal[null]]] begin[{] assign[member[.systemCppAssetManager2], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CppAssetManager2, sub_type=None))] assign[member[.systemCppAssetManager2Ref], call[Registries.NATIVE_ASSET_MANAGER_REGISTRY.register, parameter[member[.systemCppAssetManager2]]]] else begin[{] None end[}] assign[member[.cppAssetManagerRef], member[.systemCppAssetManager2Ref]] end[}] return[member[.cppAssetManagerRef]] end[}] END[}]
annotation[@] identifier[Implementation] operator[SEP] identifier[minSdk] operator[=] identifier[P] operator[SEP] Keyword[protected] Keyword[static] Keyword[long] identifier[nativeCreate] operator[SEP] operator[SEP] { Keyword[long] identifier[cppAssetManagerRef] operator[SEP] Keyword[if] operator[SEP] identifier[inNonSystemConstructor] operator[SEP] { identifier[CppAssetManager2] identifier[appAssetManager] operator[=] Keyword[new] identifier[CppAssetManager2] operator[SEP] operator[SEP] operator[SEP] identifier[cppAssetManagerRef] operator[=] identifier[Registries] operator[SEP] identifier[NATIVE_ASSET_MANAGER_REGISTRY] operator[SEP] identifier[register] operator[SEP] identifier[appAssetManager] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[systemCppAssetManager2] operator[==] Other[null] operator[SEP] { identifier[systemCppAssetManager2] operator[=] Keyword[new] identifier[CppAssetManager2] operator[SEP] operator[SEP] operator[SEP] identifier[systemCppAssetManager2Ref] operator[=] identifier[Registries] operator[SEP] identifier[NATIVE_ASSET_MANAGER_REGISTRY] operator[SEP] identifier[register] operator[SEP] identifier[systemCppAssetManager2] operator[SEP] operator[SEP] } identifier[cppAssetManagerRef] operator[=] identifier[systemCppAssetManager2Ref] operator[SEP] } Keyword[return] identifier[cppAssetManagerRef] operator[SEP] }
@Override public Collection<Node> check(final Collection<Node> nodes) { Assert.notNull(nodes, "nodes is null!"); this.nodes = nodes; result = new LinkedHashSet<Node>(); switch (selector.getCombinator()) { case DESCENDANT: addDescendantElements(); break; case CHILD: addChildElements(); break; case ADJACENT_SIBLING: addAdjacentSiblingElements(); break; case GENERAL_SIBLING: addGeneralSiblingElements(); break; } return result; }
class class_name[name] begin[{] method[check, return_type[type[Collection]], modifier[public], parameter[nodes]] begin[{] call[Assert.notNull, parameter[member[.nodes], literal["nodes is null!"]]] assign[THIS[member[None.nodes]], member[.nodes]] assign[member[.result], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))], dimensions=None, name=LinkedHashSet, sub_type=None))] SwitchStatement(cases=[SwitchStatementCase(case=['DESCENDANT'], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=addDescendantElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CHILD'], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=addChildElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ADJACENT_SIBLING'], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=addAdjacentSiblingElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['GENERAL_SIBLING'], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=addGeneralSiblingElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[], member=getCombinator, postfix_operators=[], prefix_operators=[], qualifier=selector, selectors=[], type_arguments=None), label=None) return[member[.result]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Collection] operator[<] identifier[Node] operator[>] identifier[check] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[Node] operator[>] identifier[nodes] operator[SEP] { identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[nodes] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[nodes] operator[=] identifier[nodes] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] identifier[Node] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[selector] operator[SEP] identifier[getCombinator] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[DESCENDANT] operator[:] identifier[addDescendantElements] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CHILD] operator[:] identifier[addChildElements] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ADJACENT_SIBLING] operator[:] identifier[addAdjacentSiblingElements] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[GENERAL_SIBLING] operator[:] identifier[addGeneralSiblingElements] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public static int cublasGetVector (int n, Pointer x, int incx, cuDoubleComplex y[], int offsety, int incy) { ByteBuffer byteBuffery = ByteBuffer.allocateDirect(y.length * 8 * 2); byteBuffery.order(ByteOrder.nativeOrder()); DoubleBuffer doubleBuffery = byteBuffery.asDoubleBuffer(); int status = cublasGetVectorNative(n, 16, x, incx, Pointer.to(doubleBuffery).withByteOffset(offsety * 8 * 2), incy); if (status == cublasStatus.CUBLAS_STATUS_SUCCESS) { doubleBuffery.rewind(); int indexy = offsety; for (int i=0; i<n; i++, indexy+=incy) { y[indexy].x = doubleBuffery.get(indexy*2+0); y[indexy].y = doubleBuffery.get(indexy*2+1); } } return checkResult(status); }
class class_name[name] begin[{] method[cublasGetVector, return_type[type[int]], modifier[public static], parameter[n, x, incx, y, offsety, incy]] begin[{] local_variable[type[ByteBuffer], byteBuffery] call[byteBuffery.order, parameter[call[ByteOrder.nativeOrder, parameter[]]]] local_variable[type[DoubleBuffer], doubleBuffery] local_variable[type[int], status] if[binary_operation[member[.status], ==, member[cublasStatus.CUBLAS_STATUS_SUCCESS]]] begin[{] call[doubleBuffery.rewind, parameter[]] local_variable[type[int], indexy] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=indexy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=x, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=indexy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=doubleBuffery, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=indexy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=y, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=indexy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=doubleBuffery, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), Assignment(expressionl=MemberReference(member=indexy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=incy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None) else begin[{] None end[}] return[call[.checkResult, parameter[member[.status]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[cublasGetVector] operator[SEP] Keyword[int] identifier[n] , identifier[Pointer] identifier[x] , Keyword[int] identifier[incx] , identifier[cuDoubleComplex] identifier[y] operator[SEP] operator[SEP] , Keyword[int] identifier[offsety] , Keyword[int] identifier[incy] operator[SEP] { identifier[ByteBuffer] identifier[byteBuffery] operator[=] identifier[ByteBuffer] operator[SEP] identifier[allocateDirect] operator[SEP] identifier[y] operator[SEP] identifier[length] operator[*] Other[8] operator[*] Other[2] operator[SEP] operator[SEP] identifier[byteBuffery] operator[SEP] identifier[order] operator[SEP] identifier[ByteOrder] operator[SEP] identifier[nativeOrder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[DoubleBuffer] identifier[doubleBuffery] operator[=] identifier[byteBuffery] operator[SEP] identifier[asDoubleBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[status] operator[=] identifier[cublasGetVectorNative] operator[SEP] identifier[n] , Other[16] , identifier[x] , identifier[incx] , identifier[Pointer] operator[SEP] identifier[to] operator[SEP] identifier[doubleBuffery] operator[SEP] operator[SEP] identifier[withByteOffset] operator[SEP] identifier[offsety] operator[*] Other[8] operator[*] Other[2] operator[SEP] , identifier[incy] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[status] operator[==] identifier[cublasStatus] operator[SEP] identifier[CUBLAS_STATUS_SUCCESS] operator[SEP] { identifier[doubleBuffery] operator[SEP] identifier[rewind] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[indexy] operator[=] identifier[offsety] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] , identifier[indexy] operator[+=] identifier[incy] operator[SEP] { identifier[y] operator[SEP] identifier[indexy] operator[SEP] operator[SEP] identifier[x] operator[=] identifier[doubleBuffery] operator[SEP] identifier[get] operator[SEP] identifier[indexy] operator[*] Other[2] operator[+] Other[0] operator[SEP] operator[SEP] identifier[y] operator[SEP] identifier[indexy] operator[SEP] operator[SEP] identifier[y] operator[=] identifier[doubleBuffery] operator[SEP] identifier[get] operator[SEP] identifier[indexy] operator[*] Other[2] operator[+] Other[1] operator[SEP] operator[SEP] } } Keyword[return] identifier[checkResult] operator[SEP] identifier[status] operator[SEP] operator[SEP] }
public void setRule(com.google.api.ads.admanager.axis.v201808.FirstPartyAudienceSegmentRule rule) { this.rule = rule; }
class class_name[name] begin[{] method[setRule, return_type[void], modifier[public], parameter[rule]] begin[{] assign[THIS[member[None.rule]], member[.rule]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setRule] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[admanager] operator[SEP] identifier[axis] operator[SEP] identifier[v201808] operator[SEP] identifier[FirstPartyAudienceSegmentRule] identifier[rule] operator[SEP] { Keyword[this] operator[SEP] identifier[rule] operator[=] identifier[rule] operator[SEP] }
@Override public String getReverseRouteFor(Controller controller, String method) { return getReverseRouteFor(controller.getClass(), method, null); }
class class_name[name] begin[{] method[getReverseRouteFor, return_type[type[String]], modifier[public], parameter[controller, method]] begin[{] return[call[.getReverseRouteFor, parameter[call[controller.getClass, parameter[]], member[.method], literal[null]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getReverseRouteFor] operator[SEP] identifier[Controller] identifier[controller] , identifier[String] identifier[method] operator[SEP] { Keyword[return] identifier[getReverseRouteFor] operator[SEP] identifier[controller] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[method] , Other[null] operator[SEP] operator[SEP] }
public static double negativeBinomialCdf(int n, int r, double p) { if(n<0 || r<0 || p<0) { throw new IllegalArgumentException("All the parameters must be positive."); } n = Math.max(n,r); double probabilitySum = 0.0; for(int i=0;i<=r;++i) { probabilitySum += negativeBinomial(n, i, p); } return probabilitySum; }
class class_name[name] begin[{] method[negativeBinomialCdf, return_type[type[double]], modifier[public static], parameter[n, r, p]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.n], <, literal[0]], ||, binary_operation[member[.r], <, literal[0]]], ||, binary_operation[member[.p], <, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="All the parameters must be positive.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.n], call[Math.max, parameter[member[.n], member[.r]]]] local_variable[type[double], probabilitySum] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=probabilitySum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=negativeBinomial, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=r, 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[.probabilitySum]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[negativeBinomialCdf] operator[SEP] Keyword[int] identifier[n] , Keyword[int] identifier[r] , Keyword[double] identifier[p] operator[SEP] { Keyword[if] operator[SEP] identifier[n] operator[<] Other[0] operator[||] identifier[r] operator[<] Other[0] operator[||] identifier[p] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[n] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[n] , identifier[r] operator[SEP] operator[SEP] Keyword[double] identifier[probabilitySum] operator[=] literal[Float] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<=] identifier[r] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[probabilitySum] operator[+=] identifier[negativeBinomial] operator[SEP] identifier[n] , identifier[i] , identifier[p] operator[SEP] operator[SEP] } Keyword[return] identifier[probabilitySum] operator[SEP] }
@Override protected org.ironjacamar.core.connectionmanager.listener.ConnectionListener getConnectionListener(Credential credential) throws ResourceException { org.ironjacamar.core.connectionmanager.listener.ConnectionListener cl = super.getConnectionListener(credential); try { if (!cl.isEnlisted() && TxUtils.isUncommitted(ti.getTransactionManager().getTransaction()) && shouldEnlist(cl)) cl.enlist(); return cl; } catch (ResourceException re) { throw re; } catch (Exception e) { throw new ResourceException(e); } }
class class_name[name] begin[{] method[getConnectionListener, return_type[type[org]], modifier[protected], parameter[credential]] begin[{] local_variable[type[org], cl] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isEnlisted, postfix_operators=[], prefix_operators=['!'], qualifier=cl, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTransactionManager, postfix_operators=[], prefix_operators=[], qualifier=ti, selectors=[MethodInvocation(arguments=[], member=getTransaction, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=isUncommitted, postfix_operators=[], prefix_operators=[], qualifier=TxUtils, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=cl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=shouldEnlist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=enlist, postfix_operators=[], prefix_operators=[], qualifier=cl, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=MemberReference(member=cl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['ResourceException'])), 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=ResourceException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[org] operator[SEP] identifier[ironjacamar] operator[SEP] identifier[core] operator[SEP] identifier[connectionmanager] operator[SEP] identifier[listener] operator[SEP] identifier[ConnectionListener] identifier[getConnectionListener] operator[SEP] identifier[Credential] identifier[credential] operator[SEP] Keyword[throws] identifier[ResourceException] { identifier[org] operator[SEP] identifier[ironjacamar] operator[SEP] identifier[core] operator[SEP] identifier[connectionmanager] operator[SEP] identifier[listener] operator[SEP] identifier[ConnectionListener] identifier[cl] operator[=] Keyword[super] operator[SEP] identifier[getConnectionListener] operator[SEP] identifier[credential] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] operator[!] identifier[cl] operator[SEP] identifier[isEnlisted] operator[SEP] operator[SEP] operator[&&] identifier[TxUtils] operator[SEP] identifier[isUncommitted] operator[SEP] identifier[ti] operator[SEP] identifier[getTransactionManager] operator[SEP] operator[SEP] operator[SEP] identifier[getTransaction] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[shouldEnlist] operator[SEP] identifier[cl] operator[SEP] operator[SEP] identifier[cl] operator[SEP] identifier[enlist] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[cl] operator[SEP] } Keyword[catch] operator[SEP] identifier[ResourceException] identifier[re] operator[SEP] { Keyword[throw] identifier[re] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ResourceException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public <S> S getServiceValue(ObjectName name) { PlatformService<S> service = getService(name); if(service != null) { return service.getValue(); } else { return null; } }
class class_name[name] begin[{] method[getServiceValue, return_type[type[S]], modifier[public], parameter[name]] begin[{] local_variable[type[PlatformService], service] if[binary_operation[member[.service], !=, literal[null]]] begin[{] return[call[service.getValue, parameter[]]] else begin[{] return[literal[null]] end[}] end[}] END[}]
Keyword[public] operator[<] identifier[S] operator[>] identifier[S] identifier[getServiceValue] operator[SEP] identifier[ObjectName] identifier[name] operator[SEP] { identifier[PlatformService] operator[<] identifier[S] operator[>] identifier[service] operator[=] identifier[getService] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[service] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[service] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
@Override public DisableDirectoryResult disableDirectory(DisableDirectoryRequest request) { request = beforeClientExecution(request); return executeDisableDirectory(request); }
class class_name[name] begin[{] method[disableDirectory, return_type[type[DisableDirectoryResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDisableDirectory, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DisableDirectoryResult] identifier[disableDirectory] operator[SEP] identifier[DisableDirectoryRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDisableDirectory] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static <T> Iterator<T> getRandomIterator (Iterator<T> itr) { ArrayList<T> list = new ArrayList<T>(); CollectionUtil.addAll(list, itr); java.util.Collections.shuffle(list); return getUnmodifiableIterator(list); }
class class_name[name] begin[{] method[getRandomIterator, return_type[type[Iterator]], modifier[public static], parameter[itr]] begin[{] local_variable[type[ArrayList], list] call[CollectionUtil.addAll, parameter[member[.list], member[.itr]]] call[java.util.Collections.shuffle, parameter[member[.list]]] return[call[.getUnmodifiableIterator, parameter[member[.list]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Iterator] operator[<] identifier[T] operator[>] identifier[getRandomIterator] operator[SEP] identifier[Iterator] operator[<] identifier[T] operator[>] identifier[itr] operator[SEP] { identifier[ArrayList] operator[<] identifier[T] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[CollectionUtil] operator[SEP] identifier[addAll] operator[SEP] identifier[list] , identifier[itr] operator[SEP] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collections] operator[SEP] identifier[shuffle] operator[SEP] identifier[list] operator[SEP] operator[SEP] Keyword[return] identifier[getUnmodifiableIterator] operator[SEP] identifier[list] operator[SEP] operator[SEP] }
private List<CmsResource> internalReadSiblings(CmsDbContext dbc, CmsResource resource) throws CmsException { // reading siblings using the DriverManager methods while the lock state is checked would // result in an infinite loop, therefore we must access the VFS driver directly List<CmsResource> siblings = m_driverManager.getVfsDriver(dbc).readSiblings( dbc, dbc.currentProject().getUuid(), resource, true); siblings.remove(resource); return siblings; }
class class_name[name] begin[{] method[internalReadSiblings, return_type[type[List]], modifier[private], parameter[dbc, resource]] begin[{] local_variable[type[List], siblings] call[siblings.remove, parameter[member[.resource]]] return[member[.siblings]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[internalReadSiblings] operator[SEP] identifier[CmsDbContext] identifier[dbc] , identifier[CmsResource] identifier[resource] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[siblings] operator[=] identifier[m_driverManager] operator[SEP] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[readSiblings] operator[SEP] identifier[dbc] , identifier[dbc] operator[SEP] identifier[currentProject] operator[SEP] operator[SEP] operator[SEP] identifier[getUuid] operator[SEP] operator[SEP] , identifier[resource] , literal[boolean] operator[SEP] operator[SEP] identifier[siblings] operator[SEP] identifier[remove] operator[SEP] identifier[resource] operator[SEP] operator[SEP] Keyword[return] identifier[siblings] operator[SEP] }
public Integer addNode(final int termIndex, final String label) { if (label == null) { throw new InvalidArgument("label", label); } // if we have already seen this term index, return Integer visitedIndex = termNodeIndex.get(termIndex); if (visitedIndex != null) { return visitedIndex; } // add this new proto node int pnIndex = protoNodes.size(); protoNodes.add(label); // bi-directionally map term index to node index termNodeIndex.put(termIndex, pnIndex); nodeTermIndex.put(pnIndex, termIndex); getEquivalences().put(pnIndex, getEquivalences().size()); return pnIndex; }
class class_name[name] begin[{] method[addNode, return_type[type[Integer]], modifier[public], parameter[termIndex, label]] begin[{] if[binary_operation[member[.label], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="label"), MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidArgument, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Integer], visitedIndex] if[binary_operation[member[.visitedIndex], !=, literal[null]]] begin[{] return[member[.visitedIndex]] else begin[{] None end[}] local_variable[type[int], pnIndex] call[protoNodes.add, parameter[member[.label]]] call[termNodeIndex.put, parameter[member[.termIndex], member[.pnIndex]]] call[nodeTermIndex.put, parameter[member[.pnIndex], member[.termIndex]]] call[.getEquivalences, parameter[]] return[member[.pnIndex]] end[}] END[}]
Keyword[public] identifier[Integer] identifier[addNode] operator[SEP] Keyword[final] Keyword[int] identifier[termIndex] , Keyword[final] identifier[String] identifier[label] operator[SEP] { Keyword[if] operator[SEP] identifier[label] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidArgument] operator[SEP] literal[String] , identifier[label] operator[SEP] operator[SEP] } identifier[Integer] identifier[visitedIndex] operator[=] identifier[termNodeIndex] operator[SEP] identifier[get] operator[SEP] identifier[termIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[visitedIndex] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[visitedIndex] operator[SEP] } Keyword[int] identifier[pnIndex] operator[=] identifier[protoNodes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[protoNodes] operator[SEP] identifier[add] operator[SEP] identifier[label] operator[SEP] operator[SEP] identifier[termNodeIndex] operator[SEP] identifier[put] operator[SEP] identifier[termIndex] , identifier[pnIndex] operator[SEP] operator[SEP] identifier[nodeTermIndex] operator[SEP] identifier[put] operator[SEP] identifier[pnIndex] , identifier[termIndex] operator[SEP] operator[SEP] identifier[getEquivalences] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[pnIndex] , identifier[getEquivalences] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[pnIndex] operator[SEP] }
@SuppressWarnings("WeakerAccess") public int findBeatAtTime(long milliseconds) { int found = Arrays.binarySearch(timeWithinTrackValues, milliseconds); if (found >= 0) { // An exact match, just change 0-based array index to 1-based beat number return found + 1; } else if (found == -1) { // We are before the first beat return found; } else { // We are after some beat, report its beat number return -(found + 1); } }
class class_name[name] begin[{] method[findBeatAtTime, return_type[type[int]], modifier[public], parameter[milliseconds]] begin[{] local_variable[type[int], found] if[binary_operation[member[.found], >=, literal[0]]] begin[{] return[binary_operation[member[.found], +, literal[1]]] else begin[{] if[binary_operation[member[.found], ==, literal[1]]] begin[{] return[member[.found]] else begin[{] return[binary_operation[member[.found], +, literal[1]]] end[}] end[}] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[int] identifier[findBeatAtTime] operator[SEP] Keyword[long] identifier[milliseconds] operator[SEP] { Keyword[int] identifier[found] operator[=] identifier[Arrays] operator[SEP] identifier[binarySearch] operator[SEP] identifier[timeWithinTrackValues] , identifier[milliseconds] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[found] operator[>=] Other[0] operator[SEP] { Keyword[return] identifier[found] operator[+] Other[1] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[found] operator[==] operator[-] Other[1] operator[SEP] { Keyword[return] identifier[found] operator[SEP] } Keyword[else] { Keyword[return] operator[-] operator[SEP] identifier[found] operator[+] Other[1] operator[SEP] operator[SEP] } }
@Override public SenderNumber[] getSenderNumberList(String corpNum, String userID) throws PopbillException { return httpget("/FAX/SenderNumber", corpNum, userID, SenderNumber[].class); }
class class_name[name] begin[{] method[getSenderNumberList, return_type[type[SenderNumber]], modifier[public], parameter[corpNum, userID]] begin[{] return[call[.httpget, parameter[literal["/FAX/SenderNumber"], member[.corpNum], member[.userID], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SenderNumber, sub_type=None))]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[SenderNumber] operator[SEP] operator[SEP] identifier[getSenderNumberList] operator[SEP] identifier[String] identifier[corpNum] , identifier[String] identifier[userID] operator[SEP] Keyword[throws] identifier[PopbillException] { Keyword[return] identifier[httpget] operator[SEP] literal[String] , identifier[corpNum] , identifier[userID] , identifier[SenderNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public Instant getNextExecutionTimeAfter(Instant now) { OffsetTime timeOfDay = OffsetTime.from(TIME_OF_DAY_FORMAT.parse(getTimeOfDay())); // The time of the next run is based on the time past midnight UTC relative to the current time Instant nextExecTime = now.atOffset(ZoneOffset.UTC).with(timeOfDay).toInstant(); // If the first execution would have been for earlier today move to the next execution. while (nextExecTime.isBefore(now)) { nextExecTime = nextExecTime.plus(Duration.ofDays(1)); } return nextExecTime; }
class class_name[name] begin[{] method[getNextExecutionTimeAfter, return_type[type[Instant]], modifier[public], parameter[now]] begin[{] local_variable[type[OffsetTime], timeOfDay] local_variable[type[Instant], nextExecTime] while[call[nextExecTime.isBefore, parameter[member[.now]]]] begin[{] assign[member[.nextExecTime], call[nextExecTime.plus, parameter[call[Duration.ofDays, parameter[literal[1]]]]]] end[}] return[member[.nextExecTime]] end[}] END[}]
Keyword[public] identifier[Instant] identifier[getNextExecutionTimeAfter] operator[SEP] identifier[Instant] identifier[now] operator[SEP] { identifier[OffsetTime] identifier[timeOfDay] operator[=] identifier[OffsetTime] operator[SEP] identifier[from] operator[SEP] identifier[TIME_OF_DAY_FORMAT] operator[SEP] identifier[parse] operator[SEP] identifier[getTimeOfDay] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Instant] identifier[nextExecTime] operator[=] identifier[now] operator[SEP] identifier[atOffset] operator[SEP] identifier[ZoneOffset] operator[SEP] identifier[UTC] operator[SEP] operator[SEP] identifier[with] operator[SEP] identifier[timeOfDay] operator[SEP] operator[SEP] identifier[toInstant] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[nextExecTime] operator[SEP] identifier[isBefore] operator[SEP] identifier[now] operator[SEP] operator[SEP] { identifier[nextExecTime] operator[=] identifier[nextExecTime] operator[SEP] identifier[plus] operator[SEP] identifier[Duration] operator[SEP] identifier[ofDays] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[nextExecTime] operator[SEP] }
public static XMLGregorianCalendar createCalendar(String isoDate) throws Exception { if (isoDate == null) { SimpleDateFormat format = new SimpleDateFormat(DATETIME_FORMAT); isoDate = format.format(new Date()); } DatatypeFactory df = DatatypeFactory.newInstance(); return df.newXMLGregorianCalendar(isoDate); }
class class_name[name] begin[{] method[createCalendar, return_type[type[XMLGregorianCalendar]], modifier[public static], parameter[isoDate]] begin[{] if[binary_operation[member[.isoDate], ==, literal[null]]] begin[{] local_variable[type[SimpleDateFormat], format] assign[member[.isoDate], call[format.format, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]]] else begin[{] None end[}] local_variable[type[DatatypeFactory], df] return[call[df.newXMLGregorianCalendar, parameter[member[.isoDate]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[XMLGregorianCalendar] identifier[createCalendar] operator[SEP] identifier[String] identifier[isoDate] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[isoDate] operator[==] Other[null] operator[SEP] { identifier[SimpleDateFormat] identifier[format] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] identifier[DATETIME_FORMAT] operator[SEP] operator[SEP] identifier[isoDate] operator[=] identifier[format] operator[SEP] identifier[format] operator[SEP] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[DatatypeFactory] identifier[df] operator[=] identifier[DatatypeFactory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[df] operator[SEP] identifier[newXMLGregorianCalendar] operator[SEP] identifier[isoDate] operator[SEP] operator[SEP] }
public Iterator<Long> getNeighborhoodIterator(final long id) { return new Iterator<Long>() { Iterator<Edge> iter = structure.getExistingOutEdgesIterator(id); @Override public boolean hasNext() { return iter.hasNext(); } @Override public Long next() { Edge e = iter.next(); return e.getFromNodeId() == id ? e.getToNodeId() : e.getFromNodeId(); } }; }
class class_name[name] begin[{] method[getNeighborhoodIterator, return_type[type[Iterator]], modifier[public], parameter[id]] begin[{] return[ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getExistingOutEdgesIterator, postfix_operators=[], prefix_operators=[], qualifier=structure, selectors=[], type_arguments=None), name=iter)], documentation=None, modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Edge, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=hasNext, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Edge, sub_type=None)), ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getFromNodeId, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=MethodInvocation(arguments=[], member=getFromNodeId, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=getToNodeId, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)), label=None)], documentation=None, modifiers={'public'}, name=next, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], dimensions=None, name=Iterator, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Iterator] operator[<] identifier[Long] operator[>] identifier[getNeighborhoodIterator] operator[SEP] Keyword[final] Keyword[long] identifier[id] operator[SEP] { Keyword[return] Keyword[new] identifier[Iterator] operator[<] identifier[Long] operator[>] operator[SEP] operator[SEP] { identifier[Iterator] operator[<] identifier[Edge] operator[>] identifier[iter] operator[=] identifier[structure] operator[SEP] identifier[getExistingOutEdgesIterator] operator[SEP] identifier[id] operator[SEP] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] { Keyword[return] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Long] identifier[next] operator[SEP] operator[SEP] { identifier[Edge] identifier[e] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[e] operator[SEP] identifier[getFromNodeId] operator[SEP] operator[SEP] operator[==] identifier[id] operator[?] identifier[e] operator[SEP] identifier[getToNodeId] operator[SEP] operator[SEP] operator[:] identifier[e] operator[SEP] identifier[getFromNodeId] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
public void marshall(PutLifecyclePolicyRequest putLifecyclePolicyRequest, ProtocolMarshaller protocolMarshaller) { if (putLifecyclePolicyRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(putLifecyclePolicyRequest.getRegistryId(), REGISTRYID_BINDING); protocolMarshaller.marshall(putLifecyclePolicyRequest.getRepositoryName(), REPOSITORYNAME_BINDING); protocolMarshaller.marshall(putLifecyclePolicyRequest.getLifecyclePolicyText(), LIFECYCLEPOLICYTEXT_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[putLifecyclePolicyRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.putLifecyclePolicyRequest], ==, 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=getRegistryId, postfix_operators=[], prefix_operators=[], qualifier=putLifecyclePolicyRequest, selectors=[], type_arguments=None), MemberReference(member=REGISTRYID_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=getRepositoryName, postfix_operators=[], prefix_operators=[], qualifier=putLifecyclePolicyRequest, selectors=[], type_arguments=None), MemberReference(member=REPOSITORYNAME_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=getLifecyclePolicyText, postfix_operators=[], prefix_operators=[], qualifier=putLifecyclePolicyRequest, selectors=[], type_arguments=None), MemberReference(member=LIFECYCLEPOLICYTEXT_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[PutLifecyclePolicyRequest] identifier[putLifecyclePolicyRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[putLifecyclePolicyRequest] 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[putLifecyclePolicyRequest] operator[SEP] identifier[getRegistryId] operator[SEP] operator[SEP] , identifier[REGISTRYID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[putLifecyclePolicyRequest] operator[SEP] identifier[getRepositoryName] operator[SEP] operator[SEP] , identifier[REPOSITORYNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[putLifecyclePolicyRequest] operator[SEP] identifier[getLifecyclePolicyText] operator[SEP] operator[SEP] , identifier[LIFECYCLEPOLICYTEXT_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public DeterministicKey get(List<ChildNumber> path, boolean relativePath, boolean create) { ImmutableList<ChildNumber> absolutePath = relativePath ? ImmutableList.<ChildNumber>builder().addAll(rootPath).addAll(path).build() : ImmutableList.copyOf(path); if (!keys.containsKey(absolutePath)) { if (!create) throw new IllegalArgumentException(String.format(Locale.US, "No key found for %s path %s.", relativePath ? "relative" : "absolute", HDUtils.formatPath(path))); checkArgument(absolutePath.size() > 0, "Can't derive the master key: nothing to derive from."); DeterministicKey parent = get(absolutePath.subList(0, absolutePath.size() - 1), false, true); putKey(HDKeyDerivation.deriveChildKey(parent, absolutePath.get(absolutePath.size() - 1))); } return keys.get(absolutePath); }
class class_name[name] begin[{] method[get, return_type[type[DeterministicKey]], modifier[public], parameter[path, relativePath, create]] begin[{] local_variable[type[ImmutableList], absolutePath] if[call[keys.containsKey, parameter[member[.absolutePath]]]] begin[{] if[member[.create]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=US, postfix_operators=[], prefix_operators=[], qualifier=Locale, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No key found for %s path %s."), TernaryExpression(condition=MemberReference(member=relativePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="absolute"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="relative")), MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=formatPath, postfix_operators=[], prefix_operators=[], qualifier=HDUtils, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[.checkArgument, parameter[binary_operation[call[absolutePath.size, parameter[]], >, literal[0]], literal["Can't derive the master key: nothing to derive from."]]] local_variable[type[DeterministicKey], parent] call[.putKey, parameter[call[HDKeyDerivation.deriveChildKey, parameter[member[.parent], call[absolutePath.get, parameter[binary_operation[call[absolutePath.size, parameter[]], -, literal[1]]]]]]]] else begin[{] None end[}] return[call[keys.get, parameter[member[.absolutePath]]]] end[}] END[}]
Keyword[public] identifier[DeterministicKey] identifier[get] operator[SEP] identifier[List] operator[<] identifier[ChildNumber] operator[>] identifier[path] , Keyword[boolean] identifier[relativePath] , Keyword[boolean] identifier[create] operator[SEP] { identifier[ImmutableList] operator[<] identifier[ChildNumber] operator[>] identifier[absolutePath] operator[=] identifier[relativePath] operator[?] identifier[ImmutableList] operator[SEP] operator[<] identifier[ChildNumber] operator[>] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[rootPath] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[:] identifier[ImmutableList] operator[SEP] identifier[copyOf] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[keys] operator[SEP] identifier[containsKey] operator[SEP] identifier[absolutePath] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[create] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[Locale] operator[SEP] identifier[US] , literal[String] , identifier[relativePath] operator[?] literal[String] operator[:] literal[String] , identifier[HDUtils] operator[SEP] identifier[formatPath] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] identifier[absolutePath] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] , literal[String] operator[SEP] operator[SEP] identifier[DeterministicKey] identifier[parent] operator[=] identifier[get] operator[SEP] identifier[absolutePath] operator[SEP] identifier[subList] operator[SEP] Other[0] , identifier[absolutePath] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[putKey] operator[SEP] identifier[HDKeyDerivation] operator[SEP] identifier[deriveChildKey] operator[SEP] identifier[parent] , identifier[absolutePath] operator[SEP] identifier[get] operator[SEP] identifier[absolutePath] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[keys] operator[SEP] identifier[get] operator[SEP] identifier[absolutePath] operator[SEP] operator[SEP] }
private String[] getAltIds(FedoraClient fedora, String vitalPid, String dsPid) { Datastream ds = getDatastream(fedora, vitalPid, dsPid); if (ds != null) { return ds.getAltIDs(); } return new String[]{}; }
class class_name[name] begin[{] method[getAltIds, return_type[type[String]], modifier[private], parameter[fedora, vitalPid, dsPid]] begin[{] local_variable[type[Datastream], ds] if[binary_operation[member[.ds], !=, literal[null]]] begin[{] return[call[ds.getAltIDs, parameter[]]] else begin[{] None end[}] return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] end[}] END[}]
Keyword[private] identifier[String] operator[SEP] operator[SEP] identifier[getAltIds] operator[SEP] identifier[FedoraClient] identifier[fedora] , identifier[String] identifier[vitalPid] , identifier[String] identifier[dsPid] operator[SEP] { identifier[Datastream] identifier[ds] operator[=] identifier[getDatastream] operator[SEP] identifier[fedora] , identifier[vitalPid] , identifier[dsPid] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ds] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[ds] operator[SEP] identifier[getAltIDs] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[String] operator[SEP] operator[SEP] { } operator[SEP] }
public List<Dataset> getDatasetsLocal() { List<Dataset> datasets = (List<Dataset>) flds.get(Dataset.Datasets); return datasets == null ? new ArrayList<>(0) : datasets; }
class class_name[name] begin[{] method[getDatasetsLocal, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], datasets] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=datasets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=datasets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=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=ArrayList, sub_type=None)))] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Dataset] operator[>] identifier[getDatasetsLocal] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[Dataset] operator[>] identifier[datasets] operator[=] operator[SEP] identifier[List] operator[<] identifier[Dataset] operator[>] operator[SEP] identifier[flds] operator[SEP] identifier[get] operator[SEP] identifier[Dataset] operator[SEP] identifier[Datasets] operator[SEP] operator[SEP] Keyword[return] identifier[datasets] operator[==] Other[null] operator[?] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Other[0] operator[SEP] operator[:] identifier[datasets] operator[SEP] }
@Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); if (onClickedDrawable != null) { onClickedDrawable.setBounds(0, 0, w, h); } }
class class_name[name] begin[{] method[onSizeChanged, return_type[void], modifier[protected], parameter[w, h, oldw, oldh]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=h, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oldw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oldh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onSizeChanged, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) if[binary_operation[member[.onClickedDrawable], !=, literal[null]]] begin[{] call[onClickedDrawable.setBounds, parameter[literal[0], literal[0], member[.w], member[.h]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[onSizeChanged] operator[SEP] Keyword[int] identifier[w] , Keyword[int] identifier[h] , Keyword[int] identifier[oldw] , Keyword[int] identifier[oldh] operator[SEP] { Keyword[super] operator[SEP] identifier[onSizeChanged] operator[SEP] identifier[w] , identifier[h] , identifier[oldw] , identifier[oldh] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[onClickedDrawable] operator[!=] Other[null] operator[SEP] { identifier[onClickedDrawable] operator[SEP] identifier[setBounds] operator[SEP] Other[0] , Other[0] , identifier[w] , identifier[h] operator[SEP] operator[SEP] } }
public OvhIpxe ipxeScript_POST(String description, String name, String script) throws IOException { String qPath = "/me/ipxeScript"; StringBuilder sb = path(qPath); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "description", description); addBody(o, "name", name); addBody(o, "script", script); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhIpxe.class); }
class class_name[name] begin[{] method[ipxeScript_POST, return_type[type[OvhIpxe]], modifier[public], parameter[description, name, script]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[HashMap], o] call[.addBody, parameter[member[.o], literal["description"], member[.description]]] call[.addBody, parameter[member[.o], literal["name"], member[.name]]] call[.addBody, parameter[member[.o], literal["script"], member[.script]]] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhIpxe, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhIpxe] identifier[ipxeScript_POST] operator[SEP] identifier[String] identifier[description] , identifier[String] identifier[name] , identifier[String] identifier[script] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[o] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[description] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[name] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[script] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[o] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhIpxe] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
private SipURI getNextHop(final SipRequest request) { if (request.isInitial() || request.isAck()) { return lookupLocation(request); } // normally you also need to check whether this route is // pointing to you and it it is you have to "consume" it // and look at the next one. As it stands now, if this // route is pointing to us and we will use it as the next // hop we will of course create a loop. For now, we will // ignore this. final RouteHeader route = request.getRouteHeader(); if (route != null) { return (SipURI) route.getAddress().getURI(); } return (SipURI) request.getRequestUri(); }
class class_name[name] begin[{] method[getNextHop, return_type[type[SipURI]], modifier[private], parameter[request]] begin[{] if[binary_operation[call[request.isInitial, parameter[]], ||, call[request.isAck, parameter[]]]] begin[{] return[call[.lookupLocation, parameter[member[.request]]]] else begin[{] None end[}] local_variable[type[RouteHeader], route] if[binary_operation[member[.route], !=, literal[null]]] begin[{] return[Cast(expression=MethodInvocation(arguments=[], member=getAddress, postfix_operators=[], prefix_operators=[], qualifier=route, selectors=[MethodInvocation(arguments=[], member=getURI, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SipURI, sub_type=None))] else begin[{] None end[}] return[Cast(expression=MethodInvocation(arguments=[], member=getRequestUri, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SipURI, sub_type=None))] end[}] END[}]
Keyword[private] identifier[SipURI] identifier[getNextHop] operator[SEP] Keyword[final] identifier[SipRequest] identifier[request] operator[SEP] { Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[isInitial] operator[SEP] operator[SEP] operator[||] identifier[request] operator[SEP] identifier[isAck] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[lookupLocation] operator[SEP] identifier[request] operator[SEP] operator[SEP] } Keyword[final] identifier[RouteHeader] identifier[route] operator[=] identifier[request] operator[SEP] identifier[getRouteHeader] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[route] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] identifier[SipURI] operator[SEP] identifier[route] operator[SEP] identifier[getAddress] operator[SEP] operator[SEP] operator[SEP] identifier[getURI] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[SipURI] operator[SEP] identifier[request] operator[SEP] identifier[getRequestUri] operator[SEP] operator[SEP] operator[SEP] }
private String formatMessage(String message, String language, Object... args) { if (args != null && args.length > 0) { // only format a message if we have arguments Locale locale = languages.getLocaleOrDefault(language); MessageFormat messageFormat = new MessageFormat(message, locale); return messageFormat.format(args); } return message; }
class class_name[name] begin[{] method[formatMessage, return_type[type[String]], modifier[private], parameter[message, language, args]] begin[{] if[binary_operation[binary_operation[member[.args], !=, literal[null]], &&, binary_operation[member[args.length], >, literal[0]]]] begin[{] local_variable[type[Locale], locale] local_variable[type[MessageFormat], messageFormat] return[call[messageFormat.format, parameter[member[.args]]]] else begin[{] None end[}] return[member[.message]] end[}] END[}]
Keyword[private] identifier[String] identifier[formatMessage] operator[SEP] identifier[String] identifier[message] , identifier[String] identifier[language] , identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[if] operator[SEP] identifier[args] operator[!=] Other[null] operator[&&] identifier[args] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { identifier[Locale] identifier[locale] operator[=] identifier[languages] operator[SEP] identifier[getLocaleOrDefault] operator[SEP] identifier[language] operator[SEP] operator[SEP] identifier[MessageFormat] identifier[messageFormat] operator[=] Keyword[new] identifier[MessageFormat] operator[SEP] identifier[message] , identifier[locale] operator[SEP] operator[SEP] Keyword[return] identifier[messageFormat] operator[SEP] identifier[format] operator[SEP] identifier[args] operator[SEP] operator[SEP] } Keyword[return] identifier[message] operator[SEP] }
public void clearParameters() { synchronized (m_reentryGuard) { VariableStack varstack = new VariableStack(); m_xcontext.setVarStack(varstack); m_userParams = null; } }
class class_name[name] begin[{] method[clearParameters, return_type[void], modifier[public], parameter[]] begin[{] SYNCHRONIZED[member[.m_reentryGuard]] BEGIN[{] local_variable[type[VariableStack], varstack] call[m_xcontext.setVarStack, parameter[member[.varstack]]] assign[member[.m_userParams], literal[null]] END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[clearParameters] operator[SEP] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[m_reentryGuard] operator[SEP] { identifier[VariableStack] identifier[varstack] operator[=] Keyword[new] identifier[VariableStack] operator[SEP] operator[SEP] operator[SEP] identifier[m_xcontext] operator[SEP] identifier[setVarStack] operator[SEP] identifier[varstack] operator[SEP] operator[SEP] identifier[m_userParams] operator[=] Other[null] operator[SEP] } }
public void setPassword(String password) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBasicAuth) { ((HttpBasicAuth) auth).setPassword(password); return; } } throw new RuntimeException("No HTTP basic authentication configured!"); }
class class_name[name] begin[{] method[setPassword, return_type[void], modifier[public], parameter[password]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=auth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=HttpBasicAuth, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=auth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=HttpBasicAuth, sub_type=None)), label=None), ReturnStatement(expression=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=authentications, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=auth)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Authentication, sub_type=None))), label=None) ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No HTTP basic authentication configured!")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setPassword] operator[SEP] identifier[String] identifier[password] operator[SEP] { Keyword[for] operator[SEP] identifier[Authentication] identifier[auth] operator[:] identifier[authentications] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[auth] Keyword[instanceof] identifier[HttpBasicAuth] operator[SEP] { operator[SEP] operator[SEP] identifier[HttpBasicAuth] operator[SEP] identifier[auth] operator[SEP] operator[SEP] identifier[setPassword] operator[SEP] identifier[password] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] }
private void respondWithFile(ChannelHandlerContext ctx, HttpRequest request, String requestPath) throws IOException, ParseException { // make sure we request the "index.html" in case there is a directory request if (requestPath.endsWith("/")) { requestPath = requestPath + "index.html"; } if (!requestPath.contains(".")) { // we assume that the path ends in either .html or .js requestPath = requestPath + ".json"; } // convert to absolute path final File file = new File(rootPath, requestPath); if (!file.exists()) { // file does not exist. Try to load it with the classloader ClassLoader cl = HistoryServerStaticFileServerHandler.class.getClassLoader(); try (InputStream resourceStream = cl.getResourceAsStream("web" + requestPath)) { boolean success = false; try { if (resourceStream != null) { URL root = cl.getResource("web"); URL requested = cl.getResource("web" + requestPath); if (root != null && requested != null) { URI rootURI = new URI(root.getPath()).normalize(); URI requestedURI = new URI(requested.getPath()).normalize(); // Check that we don't load anything from outside of the // expected scope. if (!rootURI.relativize(requestedURI).equals(requestedURI)) { LOG.debug("Loading missing file from classloader: {}", requestPath); // ensure that directory to file exists. file.getParentFile().mkdirs(); Files.copy(resourceStream, file.toPath()); success = true; } } } } catch (Throwable t) { LOG.error("error while responding", t); } finally { if (!success) { LOG.debug("Unable to load requested file {} from classloader", requestPath); HandlerUtils.sendErrorResponse( ctx, request, new ErrorResponseBody("File not found."), NOT_FOUND, Collections.emptyMap()); return; } } } } if (!file.exists() || file.isHidden() || file.isDirectory() || !file.isFile()) { HandlerUtils.sendErrorResponse( ctx, request, new ErrorResponseBody("File not found."), NOT_FOUND, Collections.emptyMap()); return; } if (!file.getCanonicalFile().toPath().startsWith(rootPath.toPath())) { HandlerUtils.sendErrorResponse( ctx, request, new ErrorResponseBody("File not found."), NOT_FOUND, Collections.emptyMap()); return; } // cache validation final String ifModifiedSince = request.headers().get(IF_MODIFIED_SINCE); if (ifModifiedSince != null && !ifModifiedSince.isEmpty()) { SimpleDateFormat dateFormatter = new SimpleDateFormat(StaticFileServerHandler.HTTP_DATE_FORMAT, Locale.US); Date ifModifiedSinceDate = dateFormatter.parse(ifModifiedSince); // Only compare up to the second because the datetime format we send to the client // does not have milliseconds long ifModifiedSinceDateSeconds = ifModifiedSinceDate.getTime() / 1000; long fileLastModifiedSeconds = file.lastModified() / 1000; if (ifModifiedSinceDateSeconds == fileLastModifiedSeconds) { if (LOG.isDebugEnabled()) { LOG.debug("Responding 'NOT MODIFIED' for file '" + file.getAbsolutePath() + '\''); } StaticFileServerHandler.sendNotModified(ctx); return; } } if (LOG.isDebugEnabled()) { LOG.debug("Responding with file '" + file.getAbsolutePath() + '\''); } // Don't need to close this manually. Netty's DefaultFileRegion will take care of it. final RandomAccessFile raf; try { raf = new RandomAccessFile(file, "r"); } catch (FileNotFoundException e) { HandlerUtils.sendErrorResponse( ctx, request, new ErrorResponseBody("File not found."), NOT_FOUND, Collections.emptyMap()); return; } try { long fileLength = raf.length(); HttpResponse response = new DefaultHttpResponse(HTTP_1_1, OK); StaticFileServerHandler.setContentTypeHeader(response, file); // the job overview should be updated as soon as possible if (!requestPath.equals("/joboverview.json")) { StaticFileServerHandler.setDateAndCacheHeaders(response, file); } if (HttpHeaders.isKeepAlive(request)) { response.headers().set(CONNECTION, HttpHeaders.Values.KEEP_ALIVE); } HttpHeaders.setContentLength(response, fileLength); // write the initial line and the header. ctx.write(response); // write the content. ChannelFuture lastContentFuture; if (ctx.pipeline().get(SslHandler.class) == null) { ctx.write(new DefaultFileRegion(raf.getChannel(), 0, fileLength), ctx.newProgressivePromise()); lastContentFuture = ctx.writeAndFlush(LastHttpContent.EMPTY_LAST_CONTENT); } else { lastContentFuture = ctx.writeAndFlush(new HttpChunkedInput(new ChunkedFile(raf, 0, fileLength, 8192)), ctx.newProgressivePromise()); // HttpChunkedInput will write the end marker (LastHttpContent) for us. } // close the connection, if no keep-alive is needed if (!HttpHeaders.isKeepAlive(request)) { lastContentFuture.addListener(ChannelFutureListener.CLOSE); } } catch (Exception e) { raf.close(); LOG.error("Failed to serve file.", e); HandlerUtils.sendErrorResponse( ctx, request, new ErrorResponseBody("Internal server error."), INTERNAL_SERVER_ERROR, Collections.emptyMap()); } }
class class_name[name] begin[{] method[respondWithFile, return_type[void], modifier[private], parameter[ctx, request, requestPath]] begin[{] if[call[requestPath.endsWith, parameter[literal["/"]]]] begin[{] assign[member[.requestPath], binary_operation[member[.requestPath], +, literal["index.html"]]] else begin[{] None end[}] if[call[requestPath.contains, parameter[literal["."]]]] begin[{] assign[member[.requestPath], binary_operation[member[.requestPath], +, literal[".json"]]] else begin[{] None end[}] local_variable[type[File], file] if[call[file.exists, parameter[]]] begin[{] local_variable[type[ClassLoader], cl] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=success)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=resourceStream, 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="web")], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=cl, selectors=[], type_arguments=None), name=root)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="web"), operandr=MemberReference(member=requestPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=cl, selectors=[], type_arguments=None), name=requested)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=requested, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=normalize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=URI, sub_type=None)), name=rootURI)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=requested, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=normalize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=URI, sub_type=None)), name=requestedURI)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=requestedURI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=relativize, postfix_operators=[], prefix_operators=['!'], qualifier=rootURI, selectors=[MethodInvocation(arguments=[MemberReference(member=requestedURI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Loading missing file from classloader: {}"), MemberReference(member=requestPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getParentFile, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[MethodInvocation(arguments=[], member=mkdirs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resourceStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toPath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None)], member=copy, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=success, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]))]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="error while responding"), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=[IfStatement(condition=MemberReference(member=success, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to load requested file {} from classloader"), MemberReference(member=requestPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="File not found.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ErrorResponseBody, sub_type=None)), MemberReference(member=NOT_FOUND, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=emptyMap, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)], member=sendErrorResponse, postfix_operators=[], prefix_operators=[], qualifier=HandlerUtils, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]))], label=None, resources=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=resourceStream, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), value=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="web"), operandr=MemberReference(member=requestPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=getResourceAsStream, postfix_operators=[], prefix_operators=[], qualifier=cl, selectors=[], type_arguments=None))]) else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[call[file.exists, parameter[]], ||, call[file.isHidden, parameter[]]], ||, call[file.isDirectory, parameter[]]], ||, call[file.isFile, parameter[]]]] begin[{] call[HandlerUtils.sendErrorResponse, parameter[member[.ctx], member[.request], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="File not found.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ErrorResponseBody, sub_type=None)), member[.NOT_FOUND], call[Collections.emptyMap, parameter[]]]] return[None] else begin[{] None end[}] if[call[file.getCanonicalFile, parameter[]]] begin[{] call[HandlerUtils.sendErrorResponse, parameter[member[.ctx], member[.request], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="File not found.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ErrorResponseBody, sub_type=None)), member[.NOT_FOUND], call[Collections.emptyMap, parameter[]]]] return[None] else begin[{] None end[}] local_variable[type[String], ifModifiedSince] if[binary_operation[binary_operation[member[.ifModifiedSince], !=, literal[null]], &&, call[ifModifiedSince.isEmpty, parameter[]]]] begin[{] local_variable[type[SimpleDateFormat], dateFormatter] local_variable[type[Date], ifModifiedSinceDate] local_variable[type[long], ifModifiedSinceDateSeconds] local_variable[type[long], fileLastModifiedSeconds] if[binary_operation[member[.ifModifiedSinceDateSeconds], ==, member[.fileLastModifiedSeconds]]] begin[{] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[binary_operation[binary_operation[literal["Responding 'NOT MODIFIED' for file '"], +, call[file.getAbsolutePath, parameter[]]], +, literal['\'']]]] else begin[{] None end[}] call[StaticFileServerHandler.sendNotModified, parameter[member[.ctx]]] return[None] else begin[{] None end[}] else begin[{] None end[}] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[binary_operation[binary_operation[literal["Responding with file '"], +, call[file.getAbsolutePath, parameter[]]], +, literal['\'']]]] else begin[{] None end[}] local_variable[type[RandomAccessFile], raf] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=raf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="r")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RandomAccessFile, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="File not found.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ErrorResponseBody, sub_type=None)), MemberReference(member=NOT_FOUND, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=emptyMap, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)], member=sendErrorResponse, postfix_operators=[], prefix_operators=[], qualifier=HandlerUtils, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException']))], finally_block=None, label=None, resources=None) TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=raf, selectors=[], type_arguments=None), name=fileLength)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=HTTP_1_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=OK, 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=DefaultHttpResponse, sub_type=None)), name=response)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HttpResponse, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setContentTypeHeader, postfix_operators=[], prefix_operators=[], qualifier=StaticFileServerHandler, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/joboverview.json")], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=requestPath, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDateAndCacheHeaders, postfix_operators=[], prefix_operators=[], qualifier=StaticFileServerHandler, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isKeepAlive, postfix_operators=[], prefix_operators=[], qualifier=HttpHeaders, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=headers, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[MethodInvocation(arguments=[MemberReference(member=CONNECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=KEEP_ALIVE, postfix_operators=[], prefix_operators=[], qualifier=HttpHeaders.Values, selectors=[])], member=set, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fileLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setContentLength, postfix_operators=[], prefix_operators=[], qualifier=HttpHeaders, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=lastContentFuture)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ChannelFuture, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=pipeline, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SslHandler, sub_type=None))], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastContentFuture, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=raf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=fileLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8192)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ChunkedFile, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpChunkedInput, sub_type=None)), MethodInvocation(arguments=[], member=newProgressivePromise, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None)], member=writeAndFlush, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getChannel, postfix_operators=[], prefix_operators=[], qualifier=raf, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=fileLength, 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=DefaultFileRegion, sub_type=None)), MethodInvocation(arguments=[], member=newProgressivePromise, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastContentFuture, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=EMPTY_LAST_CONTENT, postfix_operators=[], prefix_operators=[], qualifier=LastHttpContent, selectors=[])], member=writeAndFlush, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isKeepAlive, postfix_operators=[], prefix_operators=['!'], qualifier=HttpHeaders, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CLOSE, postfix_operators=[], prefix_operators=[], qualifier=ChannelFutureListener, selectors=[])], member=addListener, postfix_operators=[], prefix_operators=[], qualifier=lastContentFuture, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=raf, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to serve file."), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Internal server error.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ErrorResponseBody, sub_type=None)), MemberReference(member=INTERNAL_SERVER_ERROR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=emptyMap, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)], member=sendErrorResponse, postfix_operators=[], prefix_operators=[], qualifier=HandlerUtils, 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[}]
Keyword[private] Keyword[void] identifier[respondWithFile] operator[SEP] identifier[ChannelHandlerContext] identifier[ctx] , identifier[HttpRequest] identifier[request] , identifier[String] identifier[requestPath] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ParseException] { Keyword[if] operator[SEP] identifier[requestPath] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[requestPath] operator[=] identifier[requestPath] operator[+] literal[String] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[requestPath] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[requestPath] operator[=] identifier[requestPath] operator[+] literal[String] operator[SEP] } Keyword[final] identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[rootPath] , identifier[requestPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[file] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[ClassLoader] identifier[cl] operator[=] identifier[HistoryServerStaticFileServerHandler] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[InputStream] identifier[resourceStream] operator[=] identifier[cl] operator[SEP] identifier[getResourceAsStream] operator[SEP] literal[String] operator[+] identifier[requestPath] operator[SEP] operator[SEP] { Keyword[boolean] identifier[success] operator[=] literal[boolean] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[resourceStream] operator[!=] Other[null] operator[SEP] { identifier[URL] identifier[root] operator[=] identifier[cl] operator[SEP] identifier[getResource] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[URL] identifier[requested] operator[=] identifier[cl] operator[SEP] identifier[getResource] operator[SEP] literal[String] operator[+] identifier[requestPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[root] operator[!=] Other[null] operator[&&] identifier[requested] operator[!=] Other[null] operator[SEP] { identifier[URI] identifier[rootURI] operator[=] Keyword[new] identifier[URI] operator[SEP] identifier[root] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[normalize] operator[SEP] operator[SEP] operator[SEP] identifier[URI] identifier[requestedURI] operator[=] Keyword[new] identifier[URI] operator[SEP] identifier[requested] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[normalize] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[rootURI] operator[SEP] identifier[relativize] operator[SEP] identifier[requestedURI] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[requestedURI] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[requestPath] operator[SEP] operator[SEP] identifier[file] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] identifier[Files] operator[SEP] identifier[copy] operator[SEP] identifier[resourceStream] , identifier[file] operator[SEP] identifier[toPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[success] operator[=] literal[boolean] operator[SEP] } } } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] operator[!] identifier[success] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[requestPath] operator[SEP] operator[SEP] identifier[HandlerUtils] operator[SEP] identifier[sendErrorResponse] operator[SEP] identifier[ctx] , identifier[request] , Keyword[new] identifier[ErrorResponseBody] operator[SEP] literal[String] operator[SEP] , identifier[NOT_FOUND] , identifier[Collections] operator[SEP] identifier[emptyMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } } } Keyword[if] operator[SEP] operator[!] identifier[file] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[||] identifier[file] operator[SEP] identifier[isHidden] operator[SEP] operator[SEP] operator[||] identifier[file] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[||] operator[!] identifier[file] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP] { identifier[HandlerUtils] operator[SEP] identifier[sendErrorResponse] operator[SEP] identifier[ctx] , identifier[request] , Keyword[new] identifier[ErrorResponseBody] operator[SEP] literal[String] operator[SEP] , identifier[NOT_FOUND] , identifier[Collections] operator[SEP] identifier[emptyMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[file] operator[SEP] identifier[getCanonicalFile] operator[SEP] operator[SEP] operator[SEP] identifier[toPath] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[rootPath] operator[SEP] identifier[toPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[HandlerUtils] operator[SEP] identifier[sendErrorResponse] operator[SEP] identifier[ctx] , identifier[request] , Keyword[new] identifier[ErrorResponseBody] operator[SEP] literal[String] operator[SEP] , identifier[NOT_FOUND] , identifier[Collections] operator[SEP] identifier[emptyMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[final] identifier[String] identifier[ifModifiedSince] operator[=] identifier[request] operator[SEP] identifier[headers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[IF_MODIFIED_SINCE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ifModifiedSince] operator[!=] Other[null] operator[&&] operator[!] identifier[ifModifiedSince] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[SimpleDateFormat] identifier[dateFormatter] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] identifier[StaticFileServerHandler] operator[SEP] identifier[HTTP_DATE_FORMAT] , identifier[Locale] operator[SEP] identifier[US] operator[SEP] operator[SEP] identifier[Date] identifier[ifModifiedSinceDate] operator[=] identifier[dateFormatter] operator[SEP] identifier[parse] operator[SEP] identifier[ifModifiedSince] operator[SEP] operator[SEP] Keyword[long] identifier[ifModifiedSinceDateSeconds] operator[=] identifier[ifModifiedSinceDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[/] Other[1000] operator[SEP] Keyword[long] identifier[fileLastModifiedSeconds] operator[=] identifier[file] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[/] Other[1000] operator[SEP] Keyword[if] operator[SEP] identifier[ifModifiedSinceDateSeconds] operator[==] identifier[fileLastModifiedSeconds] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[StaticFileServerHandler] operator[SEP] identifier[sendNotModified] operator[SEP] identifier[ctx] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[RandomAccessFile] identifier[raf] operator[SEP] Keyword[try] { identifier[raf] operator[=] Keyword[new] identifier[RandomAccessFile] operator[SEP] identifier[file] , literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] { identifier[HandlerUtils] operator[SEP] identifier[sendErrorResponse] operator[SEP] identifier[ctx] , identifier[request] , Keyword[new] identifier[ErrorResponseBody] operator[SEP] literal[String] operator[SEP] , identifier[NOT_FOUND] , identifier[Collections] operator[SEP] identifier[emptyMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[try] { Keyword[long] identifier[fileLength] operator[=] identifier[raf] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[HttpResponse] identifier[response] operator[=] Keyword[new] identifier[DefaultHttpResponse] operator[SEP] identifier[HTTP_1_1] , identifier[OK] operator[SEP] operator[SEP] identifier[StaticFileServerHandler] operator[SEP] identifier[setContentTypeHeader] operator[SEP] identifier[response] , identifier[file] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[requestPath] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[StaticFileServerHandler] operator[SEP] identifier[setDateAndCacheHeaders] operator[SEP] identifier[response] , identifier[file] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[HttpHeaders] operator[SEP] identifier[isKeepAlive] operator[SEP] identifier[request] operator[SEP] operator[SEP] { identifier[response] operator[SEP] identifier[headers] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[CONNECTION] , identifier[HttpHeaders] operator[SEP] identifier[Values] operator[SEP] identifier[KEEP_ALIVE] operator[SEP] operator[SEP] } identifier[HttpHeaders] operator[SEP] identifier[setContentLength] operator[SEP] identifier[response] , identifier[fileLength] operator[SEP] operator[SEP] identifier[ctx] operator[SEP] identifier[write] operator[SEP] identifier[response] operator[SEP] operator[SEP] identifier[ChannelFuture] identifier[lastContentFuture] operator[SEP] Keyword[if] operator[SEP] identifier[ctx] operator[SEP] identifier[pipeline] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[SslHandler] operator[SEP] Keyword[class] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[ctx] operator[SEP] identifier[write] operator[SEP] Keyword[new] identifier[DefaultFileRegion] operator[SEP] identifier[raf] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] , Other[0] , identifier[fileLength] operator[SEP] , identifier[ctx] operator[SEP] identifier[newProgressivePromise] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[lastContentFuture] operator[=] identifier[ctx] operator[SEP] identifier[writeAndFlush] operator[SEP] identifier[LastHttpContent] operator[SEP] identifier[EMPTY_LAST_CONTENT] operator[SEP] operator[SEP] } Keyword[else] { identifier[lastContentFuture] operator[=] identifier[ctx] operator[SEP] identifier[writeAndFlush] operator[SEP] Keyword[new] identifier[HttpChunkedInput] operator[SEP] Keyword[new] identifier[ChunkedFile] operator[SEP] identifier[raf] , Other[0] , identifier[fileLength] , Other[8192] operator[SEP] operator[SEP] , identifier[ctx] operator[SEP] identifier[newProgressivePromise] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[HttpHeaders] operator[SEP] identifier[isKeepAlive] operator[SEP] identifier[request] operator[SEP] operator[SEP] { identifier[lastContentFuture] operator[SEP] identifier[addListener] operator[SEP] identifier[ChannelFutureListener] operator[SEP] identifier[CLOSE] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[raf] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[HandlerUtils] operator[SEP] identifier[sendErrorResponse] operator[SEP] identifier[ctx] , identifier[request] , Keyword[new] identifier[ErrorResponseBody] operator[SEP] literal[String] operator[SEP] , identifier[INTERNAL_SERVER_ERROR] , identifier[Collections] operator[SEP] identifier[emptyMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public static void parkNanos(Object blocker, long nanos) { try { Strand.parkNanos(blocker, nanos); } catch (SuspendExecution e) { throw RuntimeSuspendExecution.of(e); } }
class class_name[name] begin[{] method[parkNanos, return_type[void], modifier[public static], parameter[blocker, nanos]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=blocker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nanos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parkNanos, postfix_operators=[], prefix_operators=[], qualifier=Strand, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=RuntimeSuspendExecution, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SuspendExecution']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[parkNanos] operator[SEP] identifier[Object] identifier[blocker] , Keyword[long] identifier[nanos] operator[SEP] { Keyword[try] { identifier[Strand] operator[SEP] identifier[parkNanos] operator[SEP] identifier[blocker] , identifier[nanos] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SuspendExecution] identifier[e] operator[SEP] { Keyword[throw] identifier[RuntimeSuspendExecution] operator[SEP] identifier[of] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
@Override public void write_attributes(final AttributeValue[] values) throws DevFailed { MDC.setContextMap(contextMap); xlogger.entry(); checkInitialization(); deviceMonitoring.startRequest("write_attributes"); clientIdentity.set(null); final String[] names = new String[values.length]; for (int i = 0; i < names.length; i++) { names[i] = values[i].name; logger.debug("writing {}", names[i]); } final Object lock = deviceLock.getAttributeLock(); try { synchronized (lock != null ? lock : new Object()) { AttributeGetterSetter.setAttributeValue(values, attributeList, stateImpl, aroundInvokeImpl, null); } } catch (final Exception e) { deviceMonitoring.addError(); if (e instanceof DevFailed) { throw (DevFailed) e; } else { // with CORBA, the stack trace is not visible by the client if // not inserted in DevFailed. throw DevFailedUtils.newDevFailed(e); } } xlogger.exit(); }
class class_name[name] begin[{] method[write_attributes, return_type[void], modifier[public], parameter[values]] begin[{] call[MDC.setContextMap, parameter[member[.contextMap]]] call[xlogger.entry, parameter[]] call[.checkInitialization, parameter[]] call[deviceMonitoring.startRequest, parameter[literal["write_attributes"]]] call[clientIdentity.set, parameter[literal[null]]] local_variable[type[String], names] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="writing {}"), MemberReference(member=names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=names, 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[Object], lock] TryStatement(block=[SynchronizedStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attributeList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stateImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aroundInvokeImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setAttributeValue, postfix_operators=[], prefix_operators=[], qualifier=AttributeGetterSetter, selectors=[], type_arguments=None), label=None)], label=None, lock=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=lock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), if_true=MemberReference(member=lock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=addError, postfix_operators=[], prefix_operators=[], qualifier=deviceMonitoring, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=DevFailed, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newDevFailed, postfix_operators=[], prefix_operators=[], qualifier=DevFailedUtils, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=Cast(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DevFailed, sub_type=None)), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) call[xlogger.exit, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[write_attributes] operator[SEP] Keyword[final] identifier[AttributeValue] operator[SEP] operator[SEP] identifier[values] operator[SEP] Keyword[throws] identifier[DevFailed] { identifier[MDC] operator[SEP] identifier[setContextMap] operator[SEP] identifier[contextMap] operator[SEP] operator[SEP] identifier[xlogger] operator[SEP] identifier[entry] operator[SEP] operator[SEP] operator[SEP] identifier[checkInitialization] operator[SEP] operator[SEP] operator[SEP] identifier[deviceMonitoring] operator[SEP] identifier[startRequest] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[clientIdentity] operator[SEP] identifier[set] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[names] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[values] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[names] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[names] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[values] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[name] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[names] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[Object] identifier[lock] operator[=] identifier[deviceLock] operator[SEP] identifier[getAttributeLock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[synchronized] operator[SEP] identifier[lock] operator[!=] Other[null] operator[?] identifier[lock] operator[:] Keyword[new] identifier[Object] operator[SEP] operator[SEP] operator[SEP] { identifier[AttributeGetterSetter] operator[SEP] identifier[setAttributeValue] operator[SEP] identifier[values] , identifier[attributeList] , identifier[stateImpl] , identifier[aroundInvokeImpl] , Other[null] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { identifier[deviceMonitoring] operator[SEP] identifier[addError] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[DevFailed] operator[SEP] { Keyword[throw] operator[SEP] identifier[DevFailed] operator[SEP] identifier[e] operator[SEP] } Keyword[else] { Keyword[throw] identifier[DevFailedUtils] operator[SEP] identifier[newDevFailed] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } identifier[xlogger] operator[SEP] identifier[exit] operator[SEP] operator[SEP] operator[SEP] }
public static void writeToMemory(byte[] src, Object target, long targetOffset) { Platform.copyMemory(src, Platform.BYTE_ARRAY_OFFSET, target, targetOffset, src.length); }
class class_name[name] begin[{] method[writeToMemory, return_type[void], modifier[public static], parameter[src, target, targetOffset]] begin[{] call[Platform.copyMemory, parameter[member[.src], member[Platform.BYTE_ARRAY_OFFSET], member[.target], member[.targetOffset], member[src.length]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[writeToMemory] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[src] , identifier[Object] identifier[target] , Keyword[long] identifier[targetOffset] operator[SEP] { identifier[Platform] operator[SEP] identifier[copyMemory] operator[SEP] identifier[src] , identifier[Platform] operator[SEP] identifier[BYTE_ARRAY_OFFSET] , identifier[target] , identifier[targetOffset] , identifier[src] operator[SEP] identifier[length] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") public <V, T extends Enum & Option> V get(final T option) { return (V) optionsSupport.get(option); }
class class_name[name] begin[{] method[get, return_type[type[V]], modifier[public], parameter[option]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=option, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=optionsSupport, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[V] , identifier[T] Keyword[extends] identifier[Enum] operator[&] identifier[Option] operator[>] identifier[V] identifier[get] operator[SEP] Keyword[final] identifier[T] identifier[option] operator[SEP] { Keyword[return] operator[SEP] identifier[V] operator[SEP] identifier[optionsSupport] operator[SEP] identifier[get] operator[SEP] identifier[option] operator[SEP] operator[SEP] }
public List<ZoneOffsetTransition> getTransitions() { List<ZoneOffsetTransition> list = new ArrayList<>(); for (int i = 0; i < savingsInstantTransitions.length; i++) { list.add(new ZoneOffsetTransition(savingsInstantTransitions[i], wallOffsets[i], wallOffsets[i + 1])); } return Collections.unmodifiableList(list); }
class class_name[name] begin[{] method[getTransitions, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], list] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=savingsInstantTransitions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=wallOffsets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=wallOffsets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ZoneOffsetTransition, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=savingsInstantTransitions, 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[call[Collections.unmodifiableList, parameter[member[.list]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[ZoneOffsetTransition] operator[>] identifier[getTransitions] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[ZoneOffsetTransition] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[savingsInstantTransitions] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ZoneOffsetTransition] operator[SEP] identifier[savingsInstantTransitions] operator[SEP] identifier[i] operator[SEP] , identifier[wallOffsets] operator[SEP] identifier[i] operator[SEP] , identifier[wallOffsets] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableList] operator[SEP] identifier[list] operator[SEP] operator[SEP] }
WrappedByteBuffer expandAt(int i, int expectedRemaining) { if ((i + expectedRemaining) <= _buf.limit()) { return this; } else { if ((i + expectedRemaining) <= _buf.capacity()) { _buf.limit(i + expectedRemaining); } else { // reallocate the underlying byte buffer and keep the original buffer // intact. The resetting of the position is required because, one // could be in the middle of a read of an existing buffer, when they // decide to over write only few bytes but still keep the remaining // part of the buffer unchanged. int newCapacity = _buf.capacity() + ((expectedRemaining > INITIAL_CAPACITY) ? expectedRemaining : INITIAL_CAPACITY); java.nio.ByteBuffer newBuffer = java.nio.ByteBuffer.allocate(newCapacity); _buf.flip(); newBuffer.put(_buf); _buf = newBuffer; } } return this; }
class class_name[name] begin[{] method[expandAt, return_type[type[WrappedByteBuffer]], modifier[default], parameter[i, expectedRemaining]] begin[{] if[binary_operation[binary_operation[member[.i], +, member[.expectedRemaining]], <=, call[_buf.limit, parameter[]]]] begin[{] return[THIS[]] else begin[{] if[binary_operation[binary_operation[member[.i], +, member[.expectedRemaining]], <=, call[_buf.capacity, parameter[]]]] begin[{] call[_buf.limit, parameter[binary_operation[member[.i], +, member[.expectedRemaining]]]] else begin[{] local_variable[type[int], newCapacity] local_variable[type[java], newBuffer] call[_buf.flip, parameter[]] call[newBuffer.put, parameter[member[._buf]]] assign[member[._buf], member[.newBuffer]] end[}] end[}] return[THIS[]] end[}] END[}]
identifier[WrappedByteBuffer] identifier[expandAt] operator[SEP] Keyword[int] identifier[i] , Keyword[int] identifier[expectedRemaining] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[i] operator[+] identifier[expectedRemaining] operator[SEP] operator[<=] identifier[_buf] operator[SEP] identifier[limit] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] operator[SEP] identifier[i] operator[+] identifier[expectedRemaining] operator[SEP] operator[<=] identifier[_buf] operator[SEP] identifier[capacity] operator[SEP] operator[SEP] operator[SEP] { identifier[_buf] operator[SEP] identifier[limit] operator[SEP] identifier[i] operator[+] identifier[expectedRemaining] operator[SEP] operator[SEP] } Keyword[else] { Keyword[int] identifier[newCapacity] operator[=] identifier[_buf] operator[SEP] identifier[capacity] operator[SEP] operator[SEP] operator[+] operator[SEP] operator[SEP] identifier[expectedRemaining] operator[>] identifier[INITIAL_CAPACITY] operator[SEP] operator[?] identifier[expectedRemaining] operator[:] identifier[INITIAL_CAPACITY] operator[SEP] operator[SEP] identifier[java] operator[SEP] identifier[nio] operator[SEP] identifier[ByteBuffer] identifier[newBuffer] operator[=] identifier[java] operator[SEP] identifier[nio] operator[SEP] identifier[ByteBuffer] operator[SEP] identifier[allocate] operator[SEP] identifier[newCapacity] operator[SEP] operator[SEP] identifier[_buf] operator[SEP] identifier[flip] operator[SEP] operator[SEP] operator[SEP] identifier[newBuffer] operator[SEP] identifier[put] operator[SEP] identifier[_buf] operator[SEP] operator[SEP] identifier[_buf] operator[=] identifier[newBuffer] operator[SEP] } } Keyword[return] Keyword[this] operator[SEP] }
public String soundex(String s) { String sound = "01230120022455012623010202"; // Letters' categories // ABCDEFGHIJKLMNOPQRSTUVWXYZ char code[] = {'0', '0', '0', '0'}; if ((s == null) || (s.length() == 0)) return null; code[0] = Character.toUpperCase(s.charAt(0)); if (!Character.isLetter(code[0])) return null; // Must start with a letter int iSrc = 0; // Start at second char int iDest = 1; char ch; while (iSrc < s.length()) { if (iDest >= 4) break; iSrc++; if (!Character.isLetter(s.charAt(iSrc))) continue; // skip all nonalphabetics ch = sound.charAt(Character.toUpperCase(s.charAt(iSrc))-'A'); // Determine the category if ((ch == '0') || (ch == code[iDest - 1]) ) continue; code[iDest++] = ch; } return new String(code); }
class class_name[name] begin[{] method[soundex, return_type[type[String]], modifier[public], parameter[s]] begin[{] local_variable[type[String], sound] local_variable[type[char], code] if[binary_operation[binary_operation[member[.s], ==, literal[null]], ||, binary_operation[call[s.length, parameter[]], ==, literal[0]]]] begin[{] return[literal[null]] else begin[{] None end[}] assign[member[.code], call[Character.toUpperCase, parameter[call[s.charAt, parameter[literal[0]]]]]] if[call[Character.isLetter, parameter[member[.code]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[int], iSrc] local_variable[type[int], iDest] local_variable[type[char], ch] while[binary_operation[member[.iSrc], <, call[s.length, parameter[]]]] begin[{] if[binary_operation[member[.iDest], >=, literal[4]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] member[.iSrc] if[call[Character.isLetter, parameter[call[s.charAt, parameter[member[.iSrc]]]]]] begin[{] ContinueStatement(goto=None, label=None) else begin[{] None end[}] assign[member[.ch], call[sound.charAt, parameter[binary_operation[call[Character.toUpperCase, parameter[call[s.charAt, parameter[member[.iSrc]]]]], -, literal['A']]]]] if[binary_operation[binary_operation[member[.ch], ==, literal['0']], ||, binary_operation[member[.ch], ==, member[.code]]]] begin[{] ContinueStatement(goto=None, label=None) else begin[{] None end[}] assign[member[.code], member[.ch]] end[}] return[ClassCreator(arguments=[MemberReference(member=code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] end[}] END[}]
Keyword[public] identifier[String] identifier[soundex] operator[SEP] identifier[String] identifier[s] operator[SEP] { identifier[String] identifier[sound] operator[=] literal[String] operator[SEP] Keyword[char] identifier[code] operator[SEP] operator[SEP] operator[=] { literal[String] , literal[String] , literal[String] , literal[String] } operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[s] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[code] operator[SEP] Other[0] operator[SEP] operator[=] identifier[Character] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Character] operator[SEP] identifier[isLetter] operator[SEP] identifier[code] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[int] identifier[iSrc] operator[=] Other[0] operator[SEP] Keyword[int] identifier[iDest] operator[=] Other[1] operator[SEP] Keyword[char] identifier[ch] operator[SEP] Keyword[while] operator[SEP] identifier[iSrc] operator[<] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[iDest] operator[>=] Other[4] operator[SEP] Keyword[break] operator[SEP] identifier[iSrc] operator[++] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Character] operator[SEP] identifier[isLetter] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[iSrc] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[ch] operator[=] identifier[sound] operator[SEP] identifier[charAt] operator[SEP] identifier[Character] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[iSrc] operator[SEP] operator[SEP] operator[-] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[ch] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[ch] operator[==] identifier[code] operator[SEP] identifier[iDest] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[code] operator[SEP] identifier[iDest] operator[++] operator[SEP] operator[=] identifier[ch] operator[SEP] } Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[code] operator[SEP] operator[SEP] }
public Hit withHighlights(java.util.Map<String, String> highlights) { setHighlights(highlights); return this; }
class class_name[name] begin[{] method[withHighlights, return_type[type[Hit]], modifier[public], parameter[highlights]] begin[{] call[.setHighlights, parameter[member[.highlights]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Hit] identifier[withHighlights] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[highlights] operator[SEP] { identifier[setHighlights] operator[SEP] identifier[highlights] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public Object extFunction(FuncExtFunction extFunction, Vector argVec, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { Object result = null; String ns = extFunction.getNamespace(); if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (null != extNS) { try { result = extNS.callFunction(extFunction, argVec, exprContext); } catch (javax.xml.transform.TransformerException e) { throw e; } catch (Exception e) { throw new javax.xml.transform.TransformerException(e); } } else { throw new XPathProcessorException(XSLMessages.createMessage(XSLTErrorResources.ER_EXTENSION_FUNC_UNKNOWN, new Object[]{ns, extFunction.getFunctionName()})); } } return result; }
class class_name[name] begin[{] method[extFunction, return_type[type[Object]], modifier[public], parameter[extFunction, argVec, exprContext]] begin[{] local_variable[type[Object], result] local_variable[type[String], ns] if[binary_operation[literal[null], !=, member[.ns]]] begin[{] local_variable[type[ExtensionHandler], extNS] if[binary_operation[literal[null], !=, member[.extNS]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=extFunction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argVec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=exprContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=callFunction, postfix_operators=[], prefix_operators=[], qualifier=extNS, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['javax.xml.transform.TransformerException'])), 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=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=xml, sub_type=ReferenceType(arguments=None, dimensions=None, name=transform, sub_type=ReferenceType(arguments=None, dimensions=None, name=TransformerException, sub_type=None))))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=ER_EXTENSION_FUNC_UNKNOWN, postfix_operators=[], prefix_operators=[], qualifier=XSLTErrorResources, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=ns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getFunctionName, postfix_operators=[], prefix_operators=[], qualifier=extFunction, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=createMessage, postfix_operators=[], prefix_operators=[], qualifier=XSLMessages, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XPathProcessorException, sub_type=None)), label=None) end[}] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[Object] identifier[extFunction] operator[SEP] identifier[FuncExtFunction] identifier[extFunction] , identifier[Vector] identifier[argVec] , identifier[ExpressionContext] identifier[exprContext] operator[SEP] Keyword[throws] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[transform] operator[SEP] identifier[TransformerException] { identifier[Object] identifier[result] operator[=] Other[null] operator[SEP] identifier[String] identifier[ns] operator[=] identifier[extFunction] operator[SEP] identifier[getNamespace] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[ns] operator[SEP] { identifier[ExtensionHandler] identifier[extNS] operator[=] operator[SEP] identifier[ExtensionHandler] operator[SEP] identifier[m_extensionFunctionNamespaces] operator[SEP] identifier[get] operator[SEP] identifier[ns] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[extNS] operator[SEP] { Keyword[try] { identifier[result] operator[=] identifier[extNS] operator[SEP] identifier[callFunction] operator[SEP] identifier[extFunction] , identifier[argVec] , identifier[exprContext] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[transform] operator[SEP] identifier[TransformerException] identifier[e] operator[SEP] { Keyword[throw] identifier[e] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[transform] operator[SEP] identifier[TransformerException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[throw] Keyword[new] identifier[XPathProcessorException] operator[SEP] identifier[XSLMessages] operator[SEP] identifier[createMessage] operator[SEP] identifier[XSLTErrorResources] operator[SEP] identifier[ER_EXTENSION_FUNC_UNKNOWN] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[ns] , identifier[extFunction] operator[SEP] identifier[getFunctionName] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
protected static void setDirectEditProvider(PageContext context, I_CmsDirectEditProvider provider) { // set the direct edit provider as attribute to the request context.getRequest().setAttribute(I_CmsDirectEditProvider.ATTRIBUTE_DIRECT_EDIT_PROVIDER, provider); }
class class_name[name] begin[{] method[setDirectEditProvider, return_type[void], modifier[static protected], parameter[context, provider]] begin[{] call[context.getRequest, parameter[]] end[}] END[}]
Keyword[protected] Keyword[static] Keyword[void] identifier[setDirectEditProvider] operator[SEP] identifier[PageContext] identifier[context] , identifier[I_CmsDirectEditProvider] identifier[provider] operator[SEP] { identifier[context] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] identifier[I_CmsDirectEditProvider] operator[SEP] identifier[ATTRIBUTE_DIRECT_EDIT_PROVIDER] , identifier[provider] operator[SEP] operator[SEP] }
static DateTime determineRotationPeriodAnchor(@Nullable DateTime lastAnchor, Period period) { final Period normalized = period.normalizedStandard(); int years = normalized.getYears(); int months = normalized.getMonths(); int weeks = normalized.getWeeks(); int days = normalized.getDays(); int hours = normalized.getHours(); int minutes = normalized.getMinutes(); int seconds = normalized.getSeconds(); if (years == 0 && months == 0 && weeks == 0 && days == 0 && hours == 0 && minutes == 0 && seconds == 0) { throw new IllegalArgumentException("Invalid rotation period specified"); } // find the largest non-zero stride in the period. that's our anchor type. statement order matters here! DateTimeFieldType largestStrideType = null; if (seconds > 0) largestStrideType = secondOfMinute(); if (minutes > 0) largestStrideType = minuteOfHour(); if (hours > 0) largestStrideType = hourOfDay(); if (days > 0) largestStrideType = dayOfMonth(); if (weeks > 0) largestStrideType = weekOfWeekyear(); if (months > 0) largestStrideType = monthOfYear(); if (years > 0) largestStrideType = year(); if (largestStrideType == null) { throw new IllegalArgumentException("Could not determine rotation stride length."); } final DateTime anchorTime = MoreObjects.firstNonNull(lastAnchor, Tools.nowUTC()); final DateTimeField field = largestStrideType.getField(anchorTime.getChronology()); // use normalized here to make sure we actually have the largestStride type available! see https://github.com/Graylog2/graylog2-server/issues/836 int periodValue = normalized.get(largestStrideType.getDurationType()); final long fieldValue = field.roundFloor(anchorTime.getMillis()); final int fieldValueInUnit = field.get(fieldValue); if (periodValue == 0) { // https://github.com/Graylog2/graylog2-server/issues/836 log.warn("Determining stride length failed because of a 0 period. Defaulting back to 1 period to avoid crashing, but this is a bug!"); periodValue = 1; } final long difference = fieldValueInUnit % periodValue; final long newValue = field.add(fieldValue, -1 * difference); return new DateTime(newValue, DateTimeZone.UTC); }
class class_name[name] begin[{] method[determineRotationPeriodAnchor, return_type[type[DateTime]], modifier[static], parameter[lastAnchor, period]] begin[{] local_variable[type[Period], normalized] local_variable[type[int], years] local_variable[type[int], months] local_variable[type[int], weeks] local_variable[type[int], days] local_variable[type[int], hours] local_variable[type[int], minutes] local_variable[type[int], seconds] if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.years], ==, literal[0]], &&, binary_operation[member[.months], ==, literal[0]]], &&, binary_operation[member[.weeks], ==, literal[0]]], &&, binary_operation[member[.days], ==, literal[0]]], &&, binary_operation[member[.hours], ==, literal[0]]], &&, binary_operation[member[.minutes], ==, literal[0]]], &&, binary_operation[member[.seconds], ==, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid rotation period specified")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[DateTimeFieldType], largestStrideType] if[binary_operation[member[.seconds], >, literal[0]]] begin[{] assign[member[.largestStrideType], call[.secondOfMinute, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.minutes], >, literal[0]]] begin[{] assign[member[.largestStrideType], call[.minuteOfHour, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.hours], >, literal[0]]] begin[{] assign[member[.largestStrideType], call[.hourOfDay, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.days], >, literal[0]]] begin[{] assign[member[.largestStrideType], call[.dayOfMonth, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.weeks], >, literal[0]]] begin[{] assign[member[.largestStrideType], call[.weekOfWeekyear, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.months], >, literal[0]]] begin[{] assign[member[.largestStrideType], call[.monthOfYear, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.years], >, literal[0]]] begin[{] assign[member[.largestStrideType], call[.year, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.largestStrideType], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not determine rotation stride length.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[DateTime], anchorTime] local_variable[type[DateTimeField], field] local_variable[type[int], periodValue] local_variable[type[long], fieldValue] local_variable[type[int], fieldValueInUnit] if[binary_operation[member[.periodValue], ==, literal[0]]] begin[{] call[log.warn, parameter[literal["Determining stride length failed because of a 0 period. Defaulting back to 1 period to avoid crashing, but this is a bug!"]]] assign[member[.periodValue], literal[1]] else begin[{] None end[}] local_variable[type[long], difference] local_variable[type[long], newValue] return[ClassCreator(arguments=[MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UTC, postfix_operators=[], prefix_operators=[], qualifier=DateTimeZone, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateTime, sub_type=None))] end[}] END[}]
Keyword[static] identifier[DateTime] identifier[determineRotationPeriodAnchor] operator[SEP] annotation[@] identifier[Nullable] identifier[DateTime] identifier[lastAnchor] , identifier[Period] identifier[period] operator[SEP] { Keyword[final] identifier[Period] identifier[normalized] operator[=] identifier[period] operator[SEP] identifier[normalizedStandard] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[years] operator[=] identifier[normalized] operator[SEP] identifier[getYears] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[months] operator[=] identifier[normalized] operator[SEP] identifier[getMonths] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[weeks] operator[=] identifier[normalized] operator[SEP] identifier[getWeeks] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[days] operator[=] identifier[normalized] operator[SEP] identifier[getDays] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[hours] operator[=] identifier[normalized] operator[SEP] identifier[getHours] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[minutes] operator[=] identifier[normalized] operator[SEP] identifier[getMinutes] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[seconds] operator[=] identifier[normalized] operator[SEP] identifier[getSeconds] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[years] operator[==] Other[0] operator[&&] identifier[months] operator[==] Other[0] operator[&&] identifier[weeks] operator[==] Other[0] operator[&&] identifier[days] operator[==] Other[0] operator[&&] identifier[hours] operator[==] Other[0] operator[&&] identifier[minutes] operator[==] Other[0] operator[&&] identifier[seconds] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[DateTimeFieldType] identifier[largestStrideType] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[seconds] operator[>] Other[0] operator[SEP] identifier[largestStrideType] operator[=] identifier[secondOfMinute] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[minutes] operator[>] Other[0] operator[SEP] identifier[largestStrideType] operator[=] identifier[minuteOfHour] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hours] operator[>] Other[0] operator[SEP] identifier[largestStrideType] operator[=] identifier[hourOfDay] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[days] operator[>] Other[0] operator[SEP] identifier[largestStrideType] operator[=] identifier[dayOfMonth] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[weeks] operator[>] Other[0] operator[SEP] identifier[largestStrideType] operator[=] identifier[weekOfWeekyear] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[months] operator[>] Other[0] operator[SEP] identifier[largestStrideType] operator[=] identifier[monthOfYear] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[years] operator[>] Other[0] operator[SEP] identifier[largestStrideType] operator[=] identifier[year] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[largestStrideType] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[DateTime] identifier[anchorTime] operator[=] identifier[MoreObjects] operator[SEP] identifier[firstNonNull] operator[SEP] identifier[lastAnchor] , identifier[Tools] operator[SEP] identifier[nowUTC] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[DateTimeField] identifier[field] operator[=] identifier[largestStrideType] operator[SEP] identifier[getField] operator[SEP] identifier[anchorTime] operator[SEP] identifier[getChronology] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[periodValue] operator[=] identifier[normalized] operator[SEP] identifier[get] operator[SEP] identifier[largestStrideType] operator[SEP] identifier[getDurationType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[fieldValue] operator[=] identifier[field] operator[SEP] identifier[roundFloor] operator[SEP] identifier[anchorTime] operator[SEP] identifier[getMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[fieldValueInUnit] operator[=] identifier[field] operator[SEP] identifier[get] operator[SEP] identifier[fieldValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[periodValue] operator[==] Other[0] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[periodValue] operator[=] Other[1] operator[SEP] } Keyword[final] Keyword[long] identifier[difference] operator[=] identifier[fieldValueInUnit] operator[%] identifier[periodValue] operator[SEP] Keyword[final] Keyword[long] identifier[newValue] operator[=] identifier[field] operator[SEP] identifier[add] operator[SEP] identifier[fieldValue] , operator[-] Other[1] operator[*] identifier[difference] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[DateTime] operator[SEP] identifier[newValue] , identifier[DateTimeZone] operator[SEP] identifier[UTC] operator[SEP] operator[SEP] }
private static Package getPackage(Long processInstanceId) { try { EventServices eventManager = ServiceLocator.getEventServices(); Process process = eventManager.findProcessByProcessInstanceId(processInstanceId); Package packageVO = PackageCache.getProcessPackage(process.getId()); return packageVO; } catch (Exception ex) { return null; } }
class class_name[name] begin[{] method[getPackage, return_type[type[Package]], modifier[private static], parameter[processInstanceId]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEventServices, postfix_operators=[], prefix_operators=[], qualifier=ServiceLocator, selectors=[], type_arguments=None), name=eventManager)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EventServices, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=processInstanceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findProcessByProcessInstanceId, postfix_operators=[], prefix_operators=[], qualifier=eventManager, selectors=[], type_arguments=None), name=process)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Process, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=process, selectors=[], type_arguments=None)], member=getProcessPackage, postfix_operators=[], prefix_operators=[], qualifier=PackageCache, selectors=[], type_arguments=None), name=packageVO)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Package, sub_type=None)), ReturnStatement(expression=MemberReference(member=packageVO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] identifier[Package] identifier[getPackage] operator[SEP] identifier[Long] identifier[processInstanceId] operator[SEP] { Keyword[try] { identifier[EventServices] identifier[eventManager] operator[=] identifier[ServiceLocator] operator[SEP] identifier[getEventServices] operator[SEP] operator[SEP] operator[SEP] identifier[Process] identifier[process] operator[=] identifier[eventManager] operator[SEP] identifier[findProcessByProcessInstanceId] operator[SEP] identifier[processInstanceId] operator[SEP] operator[SEP] identifier[Package] identifier[packageVO] operator[=] identifier[PackageCache] operator[SEP] identifier[getProcessPackage] operator[SEP] identifier[process] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[packageVO] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { Keyword[return] Other[null] operator[SEP] } }
public Iterator<JsonValue> iterator() { final Iterator<JsonValue> iterator = values.iterator(); return new Iterator<JsonValue>() { public boolean hasNext() { return iterator.hasNext(); } public JsonValue next() { return iterator.next(); } public void remove() { throw new UnsupportedOperationException(); } }; }
class class_name[name] begin[{] method[iterator, return_type[type[Iterator]], modifier[public], parameter[]] begin[{] local_variable[type[Iterator], iterator] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=hasNext, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=next, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=JsonValue, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=remove, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JsonValue, sub_type=None))], dimensions=None, name=Iterator, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Iterator] operator[<] identifier[JsonValue] operator[>] identifier[iterator] operator[SEP] operator[SEP] { Keyword[final] identifier[Iterator] operator[<] identifier[JsonValue] operator[>] identifier[iterator] operator[=] identifier[values] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Iterator] operator[<] identifier[JsonValue] operator[>] operator[SEP] operator[SEP] { Keyword[public] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] { Keyword[return] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] } Keyword[public] identifier[JsonValue] identifier[next] operator[SEP] operator[SEP] { Keyword[return] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] } Keyword[public] Keyword[void] identifier[remove] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
public void free() { m_converter = null; for (int i = this.getComponentCount() - 1; i >= 0; i--) { JComponent component = (JComponent)this.getComponent(i); if (component instanceof Freeable) ((Freeable)component).free(); } }
class class_name[name] begin[{] method[free, return_type[void], modifier[public], parameter[]] begin[{] assign[member[.m_converter], literal[null]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getComponent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=JComponent, sub_type=None)), name=component)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JComponent, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Freeable, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=StatementExpression(expression=Cast(expression=MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Freeable, sub_type=None)), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getComponentCount, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[free] operator[SEP] operator[SEP] { identifier[m_converter] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Keyword[this] operator[SEP] identifier[getComponentCount] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] identifier[i] operator[--] operator[SEP] { identifier[JComponent] identifier[component] operator[=] operator[SEP] identifier[JComponent] operator[SEP] Keyword[this] operator[SEP] identifier[getComponent] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[component] Keyword[instanceof] identifier[Freeable] operator[SEP] operator[SEP] operator[SEP] identifier[Freeable] operator[SEP] identifier[component] operator[SEP] operator[SEP] identifier[free] operator[SEP] operator[SEP] operator[SEP] } }
public final Position ensureContinuous(Position lastPosition) { double lon = this.lon; if (abs(lon - lastPosition.lon) > 180) { if (lastPosition.lon < 0) lon -= 360; else lon += 360; return new Position(lat, lon); } else return this; }
class class_name[name] begin[{] method[ensureContinuous, return_type[type[Position]], modifier[final public], parameter[lastPosition]] begin[{] local_variable[type[double], lon] if[binary_operation[call[.abs, parameter[binary_operation[member[.lon], -, member[lastPosition.lon]]]], >, literal[180]]] begin[{] if[binary_operation[member[lastPosition.lon], <, literal[0]]] begin[{] assign[member[.lon], literal[360]] else begin[{] assign[member[.lon], literal[360]] end[}] return[ClassCreator(arguments=[MemberReference(member=lat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lon, 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=Position, sub_type=None))] else begin[{] return[THIS[]] end[}] end[}] END[}]
Keyword[public] Keyword[final] identifier[Position] identifier[ensureContinuous] operator[SEP] identifier[Position] identifier[lastPosition] operator[SEP] { Keyword[double] identifier[lon] operator[=] Keyword[this] operator[SEP] identifier[lon] operator[SEP] Keyword[if] operator[SEP] identifier[abs] operator[SEP] identifier[lon] operator[-] identifier[lastPosition] operator[SEP] identifier[lon] operator[SEP] operator[>] Other[180] operator[SEP] { Keyword[if] operator[SEP] identifier[lastPosition] operator[SEP] identifier[lon] operator[<] Other[0] operator[SEP] identifier[lon] operator[-=] Other[360] operator[SEP] Keyword[else] identifier[lon] operator[+=] Other[360] operator[SEP] Keyword[return] Keyword[new] identifier[Position] operator[SEP] identifier[lat] , identifier[lon] operator[SEP] operator[SEP] } Keyword[else] Keyword[return] Keyword[this] operator[SEP] }
private void managePlan(int agentIndex, Stack255 agentExecutionStack, Plan node, Set<Integer> toRemove) { // If done then pop this plan/goal if (node.hasfinished()) { logger.debug(Log.logPrefix(agentIndex) + " finished executing plan " + node.getClass().getSimpleName()); synchronized (agentExecutionStack) { // Pop the plan off the stack agentExecutionStack.pop(); // Pop the goal off the stack agentExecutionStack.pop(); if (agentExecutionStack.isEmpty()) { // remove empty intention stacks Agent agent = (Agent) GlobalState.agents.get(agentIndex); int size = agent.cleanupStacks(); // If we are left with only one stack and that is empty, then agent is idle if (size == 1 && agent.getExecutionStack().isEmpty()) { // Mark this agent as idle // Main.setAgentIdle(i, true); toRemove.add(agentIndex); } } } } else { logger.debug(Log.logPrefix(agentIndex) + " is executing a step of plan " + node.getClass().getSimpleName()); node.step(); } }
class class_name[name] begin[{] method[managePlan, return_type[void], modifier[private], parameter[agentIndex, agentExecutionStack, node, toRemove]] begin[{] if[call[node.hasfinished, parameter[]]] begin[{] call[logger.debug, parameter[binary_operation[binary_operation[call[Log.logPrefix, parameter[member[.agentIndex]]], +, literal[" finished executing plan "]], +, call[node.getClass, parameter[]]]]] SYNCHRONIZED[member[.agentExecutionStack]] BEGIN[{] call[agentExecutionStack.pop, parameter[]] call[agentExecutionStack.pop, parameter[]] if[call[agentExecutionStack.isEmpty, parameter[]]] begin[{] local_variable[type[Agent], agent] local_variable[type[int], size] if[binary_operation[binary_operation[member[.size], ==, literal[1]], &&, call[agent.getExecutionStack, parameter[]]]] begin[{] call[toRemove.add, parameter[member[.agentIndex]]] else begin[{] None end[}] else begin[{] None end[}] END[}] else begin[{] call[logger.debug, parameter[binary_operation[binary_operation[call[Log.logPrefix, parameter[member[.agentIndex]]], +, literal[" is executing a step of plan "]], +, call[node.getClass, parameter[]]]]] call[node.step, parameter[]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[managePlan] operator[SEP] Keyword[int] identifier[agentIndex] , identifier[Stack255] identifier[agentExecutionStack] , identifier[Plan] identifier[node] , identifier[Set] operator[<] identifier[Integer] operator[>] identifier[toRemove] operator[SEP] { Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[hasfinished] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[Log] operator[SEP] identifier[logPrefix] operator[SEP] identifier[agentIndex] operator[SEP] operator[+] literal[String] operator[+] identifier[node] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[agentExecutionStack] operator[SEP] { identifier[agentExecutionStack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] identifier[agentExecutionStack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[agentExecutionStack] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[Agent] identifier[agent] operator[=] operator[SEP] identifier[Agent] operator[SEP] identifier[GlobalState] operator[SEP] identifier[agents] operator[SEP] identifier[get] operator[SEP] identifier[agentIndex] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[agent] operator[SEP] identifier[cleanupStacks] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[==] Other[1] operator[&&] identifier[agent] operator[SEP] identifier[getExecutionStack] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[toRemove] operator[SEP] identifier[add] operator[SEP] identifier[agentIndex] operator[SEP] operator[SEP] } } } } Keyword[else] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[Log] operator[SEP] identifier[logPrefix] operator[SEP] identifier[agentIndex] operator[SEP] operator[+] literal[String] operator[+] identifier[node] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[step] operator[SEP] operator[SEP] operator[SEP] } }
public void bindToFileSystem(GoogleHadoopFileSystemBase fs, Text service) { this.fileSystem = requireNonNull(fs); this.service = requireNonNull(service); }
class class_name[name] begin[{] method[bindToFileSystem, return_type[void], modifier[public], parameter[fs, service]] begin[{] assign[THIS[member[None.fileSystem]], call[.requireNonNull, parameter[member[.fs]]]] assign[THIS[member[None.service]], call[.requireNonNull, parameter[member[.service]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[bindToFileSystem] operator[SEP] identifier[GoogleHadoopFileSystemBase] identifier[fs] , identifier[Text] identifier[service] operator[SEP] { Keyword[this] operator[SEP] identifier[fileSystem] operator[=] identifier[requireNonNull] operator[SEP] identifier[fs] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[service] operator[=] identifier[requireNonNull] operator[SEP] identifier[service] operator[SEP] operator[SEP] }
public boolean completeResponse(int surveyId, int responseId, LocalDateTime date) throws LimesurveyRCException { Map<String, String> responseData = new HashMap<>(); responseData.put("submitdate", date.format(DateTimeFormatter.ISO_LOCAL_DATE) + " " + date.format(DateTimeFormatter.ISO_LOCAL_TIME)); JsonElement result = updateResponse(surveyId, responseId, responseData); if (!result.getAsBoolean()) { throw new LimesurveyRCException(result.getAsString()); } return true; }
class class_name[name] begin[{] method[completeResponse, return_type[type[boolean]], modifier[public], parameter[surveyId, responseId, date]] begin[{] local_variable[type[Map], responseData] call[responseData.put, parameter[literal["submitdate"], binary_operation[binary_operation[call[date.format, parameter[member[DateTimeFormatter.ISO_LOCAL_DATE]]], +, literal[" "]], +, call[date.format, parameter[member[DateTimeFormatter.ISO_LOCAL_TIME]]]]]] local_variable[type[JsonElement], result] if[call[result.getAsBoolean, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getAsString, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LimesurveyRCException, sub_type=None)), label=None) else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[completeResponse] operator[SEP] Keyword[int] identifier[surveyId] , Keyword[int] identifier[responseId] , identifier[LocalDateTime] identifier[date] operator[SEP] Keyword[throws] identifier[LimesurveyRCException] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[responseData] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[responseData] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[date] operator[SEP] identifier[format] operator[SEP] identifier[DateTimeFormatter] operator[SEP] identifier[ISO_LOCAL_DATE] operator[SEP] operator[+] literal[String] operator[+] identifier[date] operator[SEP] identifier[format] operator[SEP] identifier[DateTimeFormatter] operator[SEP] identifier[ISO_LOCAL_TIME] operator[SEP] operator[SEP] operator[SEP] identifier[JsonElement] identifier[result] operator[=] identifier[updateResponse] operator[SEP] identifier[surveyId] , identifier[responseId] , identifier[responseData] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[result] operator[SEP] identifier[getAsBoolean] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[LimesurveyRCException] operator[SEP] identifier[result] operator[SEP] identifier[getAsString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static URI toURI(String location) throws UtilException { try { return new URI(location.replace(" ", "%20")); } catch (URISyntaxException e) { throw new UtilException(e); } }
class class_name[name] begin[{] method[toURI, return_type[type[URI]], modifier[public static], parameter[location]] begin[{] TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%20")], member=replace, postfix_operators=[], prefix_operators=[], qualifier=location, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URI, sub_type=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=UtilException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['URISyntaxException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[URI] identifier[toURI] operator[SEP] identifier[String] identifier[location] operator[SEP] Keyword[throws] identifier[UtilException] { Keyword[try] { Keyword[return] Keyword[new] identifier[URI] operator[SEP] identifier[location] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[UtilException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public static VectorByteBufferedIntegral3s64 createWithBase( final ByteBuffer b, final MutableLongType base, final int offset) { return new VectorByteBufferedIntegral3s64(b, base, offset); }
class class_name[name] begin[{] method[createWithBase, return_type[type[VectorByteBufferedIntegral3s64]], modifier[public static], parameter[b, base, offset]] begin[{] return[ClassCreator(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=base, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offset, 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=VectorByteBufferedIntegral3s64, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[VectorByteBufferedIntegral3s64] identifier[createWithBase] operator[SEP] Keyword[final] identifier[ByteBuffer] identifier[b] , Keyword[final] identifier[MutableLongType] identifier[base] , Keyword[final] Keyword[int] identifier[offset] operator[SEP] { Keyword[return] Keyword[new] identifier[VectorByteBufferedIntegral3s64] operator[SEP] identifier[b] , identifier[base] , identifier[offset] operator[SEP] operator[SEP] }
public static SecurityConstraintMetaData newSecurityConstraint(final List<SecurityConstraintMetaData> securityConstraintsMD) { final SecurityConstraintMetaData securityConstraintMD = new SecurityConstraintMetaData(); securityConstraintsMD.add(securityConstraintMD); return securityConstraintMD; }
class class_name[name] begin[{] method[newSecurityConstraint, return_type[type[SecurityConstraintMetaData]], modifier[public static], parameter[securityConstraintsMD]] begin[{] local_variable[type[SecurityConstraintMetaData], securityConstraintMD] call[securityConstraintsMD.add, parameter[member[.securityConstraintMD]]] return[member[.securityConstraintMD]] end[}] END[}]
Keyword[public] Keyword[static] identifier[SecurityConstraintMetaData] identifier[newSecurityConstraint] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[SecurityConstraintMetaData] operator[>] identifier[securityConstraintsMD] operator[SEP] { Keyword[final] identifier[SecurityConstraintMetaData] identifier[securityConstraintMD] operator[=] Keyword[new] identifier[SecurityConstraintMetaData] operator[SEP] operator[SEP] operator[SEP] identifier[securityConstraintsMD] operator[SEP] identifier[add] operator[SEP] identifier[securityConstraintMD] operator[SEP] operator[SEP] Keyword[return] identifier[securityConstraintMD] operator[SEP] }
private List<String> initLabels() { Normalizer2 nfkdNormalizer = Normalizer2.getNFKDInstance(); List<String> indexCharacters = new ArrayList<String>(); String firstScriptBoundary = firstCharsInScripts.get(0); String overflowBoundary = firstCharsInScripts.get(firstCharsInScripts.size() - 1); // We make a sorted array of elements. // Some of the input may be redundant. // That is, we might have c, ch, d, where "ch" sorts just like "c", "h". // We filter out those cases. for (String item : initialLabels) { boolean checkDistinct; if (!UTF16.hasMoreCodePointsThan(item, 1)) { checkDistinct = false; } else if(item.charAt(item.length() - 1) == '*' && item.charAt(item.length() - 2) != '*') { // Use a label if it is marked with one trailing star, // even if the label string sorts the same when all contractions are suppressed. item = item.substring(0, item.length() - 1); checkDistinct = false; } else { checkDistinct = true; } if (collatorPrimaryOnly.compare(item, firstScriptBoundary) < 0) { // Ignore a primary-ignorable or non-alphabetic index character. } else if (collatorPrimaryOnly.compare(item, overflowBoundary) >= 0) { // Ignore an index character that will land in the overflow bucket. } else if (checkDistinct && collatorPrimaryOnly.compare(item, separated(item)) == 0) { // Ignore a multi-code point index character that does not sort distinctly // from the sequence of its separate characters. } else { int insertionPoint = Collections.binarySearch(indexCharacters, item, collatorPrimaryOnly); if (insertionPoint < 0) { indexCharacters.add(~insertionPoint, item); } else { String itemAlreadyIn = indexCharacters.get(insertionPoint); if (isOneLabelBetterThanOther(nfkdNormalizer, item, itemAlreadyIn)) { indexCharacters.set(insertionPoint, item); } } } } // if the result is still too large, cut down to maxLabelCount elements, by removing every nth element final int size = indexCharacters.size() - 1; if (size > maxLabelCount) { int count = 0; int old = -1; for (Iterator<String> it = indexCharacters.iterator(); it.hasNext();) { ++count; it.next(); final int bump = count * maxLabelCount / size; if (bump == old) { it.remove(); } else { old = bump; } } } return indexCharacters; }
class class_name[name] begin[{] method[initLabels, return_type[type[List]], modifier[private], parameter[]] begin[{] local_variable[type[Normalizer2], nfkdNormalizer] local_variable[type[List], indexCharacters] local_variable[type[String], firstScriptBoundary] local_variable[type[String], overflowBoundary] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=checkDistinct)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=hasMoreCodePointsThan, postfix_operators=[], prefix_operators=['!'], qualifier=UTF16, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='*'), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=-)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='*'), operator=!=), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=checkDistinct, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=checkDistinct, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=checkDistinct, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=firstScriptBoundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compare, postfix_operators=[], prefix_operators=[], qualifier=collatorPrimaryOnly, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=overflowBoundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compare, postfix_operators=[], prefix_operators=[], qualifier=collatorPrimaryOnly, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=checkDistinct, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=separated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=compare, postfix_operators=[], prefix_operators=[], qualifier=collatorPrimaryOnly, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=&&), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=indexCharacters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=collatorPrimaryOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=binarySearch, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), name=insertionPoint)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=insertionPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=insertionPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=indexCharacters, selectors=[], type_arguments=None), name=itemAlreadyIn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=nfkdNormalizer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=itemAlreadyIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isOneLabelBetterThanOther, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=insertionPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=indexCharacters, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=insertionPoint, postfix_operators=[], prefix_operators=['~'], qualifier=, selectors=[]), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=indexCharacters, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[])), label=None, then_statement=BlockStatement(label=None, statements=[])), label=None, then_statement=BlockStatement(label=None, statements=[]))]), control=EnhancedForControl(iterable=MemberReference(member=initialLabels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) local_variable[type[int], size] if[binary_operation[member[.size], >, member[.maxLabelCount]]] begin[{] local_variable[type[int], count] local_variable[type[int], old] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=count, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxLabelCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), name=bump)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bump, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=old, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=old, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=bump, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=indexCharacters, selectors=[], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) else begin[{] None end[}] return[member[.indexCharacters]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[String] operator[>] identifier[initLabels] operator[SEP] operator[SEP] { identifier[Normalizer2] identifier[nfkdNormalizer] operator[=] identifier[Normalizer2] operator[SEP] identifier[getNFKDInstance] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[indexCharacters] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[firstScriptBoundary] operator[=] identifier[firstCharsInScripts] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[String] identifier[overflowBoundary] operator[=] identifier[firstCharsInScripts] operator[SEP] identifier[get] operator[SEP] identifier[firstCharsInScripts] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[item] operator[:] identifier[initialLabels] operator[SEP] { Keyword[boolean] identifier[checkDistinct] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[UTF16] operator[SEP] identifier[hasMoreCodePointsThan] operator[SEP] identifier[item] , Other[1] operator[SEP] operator[SEP] { identifier[checkDistinct] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[item] operator[SEP] identifier[charAt] operator[SEP] identifier[item] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[==] literal[String] operator[&&] identifier[item] operator[SEP] identifier[charAt] operator[SEP] identifier[item] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[2] operator[SEP] operator[!=] literal[String] operator[SEP] { identifier[item] operator[=] identifier[item] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[item] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[checkDistinct] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[checkDistinct] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[collatorPrimaryOnly] operator[SEP] identifier[compare] operator[SEP] identifier[item] , identifier[firstScriptBoundary] operator[SEP] operator[<] Other[0] operator[SEP] { } Keyword[else] Keyword[if] operator[SEP] identifier[collatorPrimaryOnly] operator[SEP] identifier[compare] operator[SEP] identifier[item] , identifier[overflowBoundary] operator[SEP] operator[>=] Other[0] operator[SEP] { } Keyword[else] Keyword[if] operator[SEP] identifier[checkDistinct] operator[&&] identifier[collatorPrimaryOnly] operator[SEP] identifier[compare] operator[SEP] identifier[item] , identifier[separated] operator[SEP] identifier[item] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { } Keyword[else] { Keyword[int] identifier[insertionPoint] operator[=] identifier[Collections] operator[SEP] identifier[binarySearch] operator[SEP] identifier[indexCharacters] , identifier[item] , identifier[collatorPrimaryOnly] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[insertionPoint] operator[<] Other[0] operator[SEP] { identifier[indexCharacters] operator[SEP] identifier[add] operator[SEP] operator[~] identifier[insertionPoint] , identifier[item] operator[SEP] operator[SEP] } Keyword[else] { identifier[String] identifier[itemAlreadyIn] operator[=] identifier[indexCharacters] operator[SEP] identifier[get] operator[SEP] identifier[insertionPoint] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isOneLabelBetterThanOther] operator[SEP] identifier[nfkdNormalizer] , identifier[item] , identifier[itemAlreadyIn] operator[SEP] operator[SEP] { identifier[indexCharacters] operator[SEP] identifier[set] operator[SEP] identifier[insertionPoint] , identifier[item] operator[SEP] operator[SEP] } } } } Keyword[final] Keyword[int] identifier[size] operator[=] identifier[indexCharacters] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[>] identifier[maxLabelCount] operator[SEP] { Keyword[int] identifier[count] operator[=] Other[0] operator[SEP] Keyword[int] identifier[old] operator[=] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[String] operator[>] identifier[it] operator[=] identifier[indexCharacters] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { operator[++] identifier[count] operator[SEP] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[bump] operator[=] identifier[count] operator[*] identifier[maxLabelCount] operator[/] identifier[size] operator[SEP] Keyword[if] operator[SEP] identifier[bump] operator[==] identifier[old] operator[SEP] { identifier[it] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[old] operator[=] identifier[bump] operator[SEP] } } } Keyword[return] identifier[indexCharacters] operator[SEP] }
public void marshall(BlobMetadata blobMetadata, ProtocolMarshaller protocolMarshaller) { if (blobMetadata == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(blobMetadata.getBlobId(), BLOBID_BINDING); protocolMarshaller.marshall(blobMetadata.getPath(), PATH_BINDING); protocolMarshaller.marshall(blobMetadata.getMode(), MODE_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[blobMetadata, protocolMarshaller]] begin[{] if[binary_operation[member[.blobMetadata], ==, 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=getBlobId, postfix_operators=[], prefix_operators=[], qualifier=blobMetadata, selectors=[], type_arguments=None), MemberReference(member=BLOBID_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=getPath, postfix_operators=[], prefix_operators=[], qualifier=blobMetadata, selectors=[], type_arguments=None), MemberReference(member=PATH_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=getMode, postfix_operators=[], prefix_operators=[], qualifier=blobMetadata, selectors=[], type_arguments=None), MemberReference(member=MODE_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[BlobMetadata] identifier[blobMetadata] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[blobMetadata] 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[blobMetadata] operator[SEP] identifier[getBlobId] operator[SEP] operator[SEP] , identifier[BLOBID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[blobMetadata] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[PATH_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[blobMetadata] operator[SEP] identifier[getMode] operator[SEP] operator[SEP] , identifier[MODE_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public ServerUpdater setIcon(BufferedImage icon, String fileType) { delegate.setIcon(icon, fileType); return this; }
class class_name[name] begin[{] method[setIcon, return_type[type[ServerUpdater]], modifier[public], parameter[icon, fileType]] begin[{] call[delegate.setIcon, parameter[member[.icon], member[.fileType]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[ServerUpdater] identifier[setIcon] operator[SEP] identifier[BufferedImage] identifier[icon] , identifier[String] identifier[fileType] operator[SEP] { identifier[delegate] operator[SEP] identifier[setIcon] operator[SEP] identifier[icon] , identifier[fileType] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
static public int bytesToInt(byte[] buffer, int index) { int length = buffer.length - index; if (length > 4) length = 4; int integer = 0; for (int i = 0; i < length; i++) { integer |= ((buffer[index + length - i - 1] & 0xFF) << (i * 8)); } return integer; }
class class_name[name] begin[{] method[bytesToInt, return_type[type[int]], modifier[public static], parameter[buffer, index]] begin[{] local_variable[type[int], length] if[binary_operation[member[.length], >, literal[4]]] begin[{] assign[member[.length], literal[4]] else begin[{] None end[}] local_variable[type[int], integer] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=integer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=*), operator=<<)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, 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[.integer]] end[}] END[}]
Keyword[static] Keyword[public] Keyword[int] identifier[bytesToInt] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] , Keyword[int] identifier[index] operator[SEP] { Keyword[int] identifier[length] operator[=] identifier[buffer] operator[SEP] identifier[length] operator[-] identifier[index] operator[SEP] Keyword[if] operator[SEP] identifier[length] operator[>] Other[4] operator[SEP] identifier[length] operator[=] Other[4] operator[SEP] Keyword[int] identifier[integer] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[integer] operator[|=] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[index] operator[+] identifier[length] operator[-] identifier[i] operator[-] Other[1] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] operator[SEP] identifier[i] operator[*] Other[8] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[integer] operator[SEP] }
@View(name = "count_by_userId", map = "function(doc) { if(doc.token && doc.userId) { emit(doc.userId, doc) } }", reduce = "_count") public long countByUserId(final String userId) { val view = createQuery("count_by_userId").key(userId); val rows = db.queryView(view).getRows(); if (rows.isEmpty()) { return 0; } return rows.get(0).getValueAsInt(); }
class class_name[name] begin[{] method[countByUserId, return_type[type[long]], modifier[public], parameter[userId]] begin[{] local_variable[type[val], view] local_variable[type[val], rows] if[call[rows.isEmpty, parameter[]]] begin[{] return[literal[0]] else begin[{] None end[}] return[call[rows.get, parameter[literal[0]]]] end[}] END[}]
annotation[@] identifier[View] operator[SEP] identifier[name] operator[=] literal[String] , identifier[map] operator[=] literal[String] , identifier[reduce] operator[=] literal[String] operator[SEP] Keyword[public] Keyword[long] identifier[countByUserId] operator[SEP] Keyword[final] identifier[String] identifier[userId] operator[SEP] { identifier[val] identifier[view] operator[=] identifier[createQuery] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[userId] operator[SEP] operator[SEP] identifier[val] identifier[rows] operator[=] identifier[db] operator[SEP] identifier[queryView] operator[SEP] identifier[view] operator[SEP] operator[SEP] identifier[getRows] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rows] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[0] operator[SEP] } Keyword[return] identifier[rows] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getValueAsInt] operator[SEP] operator[SEP] operator[SEP] }
public static Validator validSSLContext() { return (s, o) -> { if (!(o instanceof String)) { throw new ConfigException(s, o, "Must be a string."); } String keyStoreType = o.toString(); try { SSLContext.getInstance(keyStoreType); } catch (NoSuchAlgorithmException e) { ConfigException exception = new ConfigException(s, o, "Invalid Algorithm"); exception.initCause(e); throw exception; } }; }
class class_name[name] begin[{] method[validSSLContext, return_type[type[Validator]], modifier[public static], parameter[]] begin[{] return[LambdaExpression(body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Must be a string.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=o, selectors=[], type_arguments=None), name=keyStoreType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=keyStoreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=SSLContext, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid Algorithm")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigException, sub_type=None)), name=exception)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConfigException, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initCause, postfix_operators=[], prefix_operators=[], qualifier=exception, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchAlgorithmException']))], finally_block=None, label=None, resources=None)], parameters=[InferredFormalParameter(name=s), InferredFormalParameter(name=o)])] end[}] END[}]
Keyword[public] Keyword[static] identifier[Validator] identifier[validSSLContext] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[s] , identifier[o] operator[SEP] operator[->] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[o] Keyword[instanceof] identifier[String] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[ConfigException] operator[SEP] identifier[s] , identifier[o] , literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[keyStoreType] operator[=] identifier[o] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[SSLContext] operator[SEP] identifier[getInstance] operator[SEP] identifier[keyStoreType] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] { identifier[ConfigException] identifier[exception] operator[=] Keyword[new] identifier[ConfigException] operator[SEP] identifier[s] , identifier[o] , literal[String] operator[SEP] operator[SEP] identifier[exception] operator[SEP] identifier[initCause] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[exception] operator[SEP] } } operator[SEP] }
@Beta public static <T> Comparator<Optional<T>> emptiesLast(Comparator<? super T> valueComparator) { checkNotNull(valueComparator); return Comparator.comparing(o -> o.orElse(null), Comparator.nullsLast(valueComparator)); }
class class_name[name] begin[{] method[emptiesLast, return_type[type[Comparator]], modifier[public static], parameter[valueComparator]] begin[{] call[.checkNotNull, parameter[member[.valueComparator]]] return[call[Comparator.comparing, parameter[LambdaExpression(body=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=orElse, postfix_operators=[], prefix_operators=[], qualifier=o, selectors=[], type_arguments=None), parameters=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), call[Comparator.nullsLast, parameter[member[.valueComparator]]]]]] end[}] END[}]
annotation[@] identifier[Beta] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Comparator] operator[<] identifier[Optional] operator[<] identifier[T] operator[>] operator[>] identifier[emptiesLast] operator[SEP] identifier[Comparator] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[valueComparator] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[valueComparator] operator[SEP] operator[SEP] Keyword[return] identifier[Comparator] operator[SEP] identifier[comparing] operator[SEP] identifier[o] operator[->] identifier[o] operator[SEP] identifier[orElse] operator[SEP] Other[null] operator[SEP] , identifier[Comparator] operator[SEP] identifier[nullsLast] operator[SEP] identifier[valueComparator] operator[SEP] operator[SEP] operator[SEP] }
public void checkRowValue(int iCurrentRow) { if (m_iLastRecord != RECORD_UNKNOWN) return; // No need to calc an eof if we have the real thing. m_iLargestValidRecord = Math.max(m_iLargestValidRecord, iCurrentRow); if (iCurrentRow < this.getRowCount(true) - 1) return; // No need to recalc if less than the estimated EOF int iRoot = (int)(Math.pow(iCurrentRow, 1.0 / POWER)) + 1; this.setRowCount((int)(Math.pow(iRoot, POWER)) + 1); // New estimated EOF }
class class_name[name] begin[{] method[checkRowValue, return_type[void], modifier[public], parameter[iCurrentRow]] begin[{] if[binary_operation[member[.m_iLastRecord], !=, member[.RECORD_UNKNOWN]]] begin[{] return[None] else begin[{] None end[}] assign[member[.m_iLargestValidRecord], call[Math.max, parameter[member[.m_iLargestValidRecord], member[.iCurrentRow]]]] if[binary_operation[member[.iCurrentRow], <, binary_operation[THIS[call[None.getRowCount, parameter[literal[true]]]], -, literal[1]]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[int], iRoot] THIS[call[None.setRowCount, parameter[binary_operation[Cast(expression=MethodInvocation(arguments=[MemberReference(member=iRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=POWER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pow, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), +, literal[1]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[checkRowValue] operator[SEP] Keyword[int] identifier[iCurrentRow] operator[SEP] { Keyword[if] operator[SEP] identifier[m_iLastRecord] operator[!=] identifier[RECORD_UNKNOWN] operator[SEP] Keyword[return] operator[SEP] identifier[m_iLargestValidRecord] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[m_iLargestValidRecord] , identifier[iCurrentRow] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iCurrentRow] operator[<] Keyword[this] operator[SEP] identifier[getRowCount] operator[SEP] literal[boolean] operator[SEP] operator[-] Other[1] operator[SEP] Keyword[return] operator[SEP] Keyword[int] identifier[iRoot] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[iCurrentRow] , literal[Float] operator[/] identifier[POWER] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[this] operator[SEP] identifier[setRowCount] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[iRoot] , identifier[POWER] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] }
public static <T> Constructor<T> bestConstructor(Constructor<T>[] constructors, Object[] args) throws AmbiguousConstructorMatchException { return bestConstructor(constructors, collectArgTypes(args)); }
class class_name[name] begin[{] method[bestConstructor, return_type[type[Constructor]], modifier[public static], parameter[constructors, args]] begin[{] return[call[.bestConstructor, parameter[member[.constructors], call[.collectArgTypes, parameter[member[.args]]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Constructor] operator[<] identifier[T] operator[>] identifier[bestConstructor] operator[SEP] identifier[Constructor] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] identifier[constructors] , identifier[Object] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[AmbiguousConstructorMatchException] { Keyword[return] identifier[bestConstructor] operator[SEP] identifier[constructors] , identifier[collectArgTypes] operator[SEP] identifier[args] operator[SEP] operator[SEP] operator[SEP] }
void handleRemove(SimpleTest test, Conjunction selector, MatchTarget object, InternTable subExpr, OrdinalPosition parentId) throws MatchingException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry(this,cclass, "handleRemove", new Object[]{test,selector,object,subExpr}); child = child.remove(selector, object, subExpr, ordinalPosition); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.exit(this,cclass, "handleRemove"); }
class class_name[name] begin[{] method[handleRemove, return_type[void], modifier[default], parameter[test, selector, object, subExpr, parentId]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[tc.entry, parameter[THIS[], member[.cclass], literal["handleRemove"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=test, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=selector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subExpr, 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[}] assign[member[.child], call[child.remove, parameter[member[.selector], member[.object], member[.subExpr], member[.ordinalPosition]]]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[tc.exit, parameter[THIS[], member[.cclass], literal["handleRemove"]]] else begin[{] None end[}] end[}] END[}]
Keyword[void] identifier[handleRemove] operator[SEP] identifier[SimpleTest] identifier[test] , identifier[Conjunction] identifier[selector] , identifier[MatchTarget] identifier[object] , identifier[InternTable] identifier[subExpr] , identifier[OrdinalPosition] identifier[parentId] operator[SEP] Keyword[throws] identifier[MatchingException] { 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[tc] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[test] , identifier[selector] , identifier[object] , identifier[subExpr] } operator[SEP] operator[SEP] identifier[child] operator[=] identifier[child] operator[SEP] identifier[remove] operator[SEP] identifier[selector] , identifier[object] , identifier[subExpr] , identifier[ordinalPosition] 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[tc] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] operator[SEP] operator[SEP] }
public void setWorkingDirectory(Path dir) { if (!dir.isAbsolute()) { FileSystem.LogForCollect .info("set job working directory to non absolute path: " + dir + " working directory: " + getWorkingDirectory()); } dir = new Path(getWorkingDirectory(), dir); set("mapred.working.dir", dir.toString()); }
class class_name[name] begin[{] method[setWorkingDirectory, return_type[void], modifier[public], parameter[dir]] begin[{] if[call[dir.isAbsolute, parameter[]]] begin[{] call[FileSystem.LogForCollect.info, parameter[binary_operation[binary_operation[binary_operation[literal["set job working directory to non absolute path: "], +, member[.dir]], +, literal[" working directory: "]], +, call[.getWorkingDirectory, parameter[]]]]] else begin[{] None end[}] assign[member[.dir], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getWorkingDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=dir, 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))] call[.set, parameter[literal["mapred.working.dir"], call[dir.toString, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setWorkingDirectory] operator[SEP] identifier[Path] identifier[dir] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[dir] operator[SEP] identifier[isAbsolute] operator[SEP] operator[SEP] operator[SEP] { identifier[FileSystem] operator[SEP] identifier[LogForCollect] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[dir] operator[+] literal[String] operator[+] identifier[getWorkingDirectory] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[dir] operator[=] Keyword[new] identifier[Path] operator[SEP] identifier[getWorkingDirectory] operator[SEP] operator[SEP] , identifier[dir] operator[SEP] operator[SEP] identifier[set] operator[SEP] literal[String] , identifier[dir] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static boolean isCompatibleClientDatanodeProtocol( long clientVersion, long serverVersion) { return clientVersion == serverVersion || ( ( clientVersion == ClientDatanodeProtocol.GET_BLOCKINFO_VERSION-1 || clientVersion == ClientDatanodeProtocol.GET_BLOCKINFO_VERSION || clientVersion == ClientDatanodeProtocol.COPY_BLOCK_VERSION ) && ( serverVersion == ClientDatanodeProtocol.GET_BLOCKINFO_VERSION-1 || serverVersion == ClientDatanodeProtocol.GET_BLOCKINFO_VERSION || serverVersion == ClientDatanodeProtocol.COPY_BLOCK_VERSION )); }
class class_name[name] begin[{] method[isCompatibleClientDatanodeProtocol, return_type[type[boolean]], modifier[public static], parameter[clientVersion, serverVersion]] begin[{] return[binary_operation[binary_operation[member[.clientVersion], ==, member[.serverVersion]], ||, binary_operation[binary_operation[binary_operation[binary_operation[member[.clientVersion], ==, binary_operation[member[ClientDatanodeProtocol.GET_BLOCKINFO_VERSION], -, literal[1]]], ||, binary_operation[member[.clientVersion], ==, member[ClientDatanodeProtocol.GET_BLOCKINFO_VERSION]]], ||, binary_operation[member[.clientVersion], ==, member[ClientDatanodeProtocol.COPY_BLOCK_VERSION]]], &&, binary_operation[binary_operation[binary_operation[member[.serverVersion], ==, binary_operation[member[ClientDatanodeProtocol.GET_BLOCKINFO_VERSION], -, literal[1]]], ||, binary_operation[member[.serverVersion], ==, member[ClientDatanodeProtocol.GET_BLOCKINFO_VERSION]]], ||, binary_operation[member[.serverVersion], ==, member[ClientDatanodeProtocol.COPY_BLOCK_VERSION]]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isCompatibleClientDatanodeProtocol] operator[SEP] Keyword[long] identifier[clientVersion] , Keyword[long] identifier[serverVersion] operator[SEP] { Keyword[return] identifier[clientVersion] operator[==] identifier[serverVersion] operator[||] operator[SEP] operator[SEP] identifier[clientVersion] operator[==] identifier[ClientDatanodeProtocol] operator[SEP] identifier[GET_BLOCKINFO_VERSION] operator[-] Other[1] operator[||] identifier[clientVersion] operator[==] identifier[ClientDatanodeProtocol] operator[SEP] identifier[GET_BLOCKINFO_VERSION] operator[||] identifier[clientVersion] operator[==] identifier[ClientDatanodeProtocol] operator[SEP] identifier[COPY_BLOCK_VERSION] operator[SEP] operator[&&] operator[SEP] identifier[serverVersion] operator[==] identifier[ClientDatanodeProtocol] operator[SEP] identifier[GET_BLOCKINFO_VERSION] operator[-] Other[1] operator[||] identifier[serverVersion] operator[==] identifier[ClientDatanodeProtocol] operator[SEP] identifier[GET_BLOCKINFO_VERSION] operator[||] identifier[serverVersion] operator[==] identifier[ClientDatanodeProtocol] operator[SEP] identifier[COPY_BLOCK_VERSION] operator[SEP] operator[SEP] operator[SEP] }