code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public static <T1, T2, T3, T4, T5, T6, R> Func6<T1, T2, T3, T4, T5, T6, Observable<R>> toAsync(Func6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> func) { return toAsync(func, Schedulers.computation()); }
class class_name[name] begin[{] method[toAsync, return_type[type[Func6]], modifier[public static], parameter[func]] begin[{] return[call[.toAsync, parameter[member[.func], call[Schedulers.computation, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T1] , identifier[T2] , identifier[T3] , identifier[T4] , identifier[T5] , identifier[T6] , identifier[R] operator[>] identifier[Func6] operator[<] identifier[T1] , identifier[T2] , identifier[T3] , identifier[T4] , identifier[T5] , identifier[T6] , identifier[Observable] operator[<] identifier[R] operator[>] operator[>] identifier[toAsync] operator[SEP] identifier[Func6] operator[<] operator[?] Keyword[super] identifier[T1] , operator[?] Keyword[super] identifier[T2] , operator[?] Keyword[super] identifier[T3] , operator[?] Keyword[super] identifier[T4] , operator[?] Keyword[super] identifier[T5] , operator[?] Keyword[super] identifier[T6] , operator[?] Keyword[extends] identifier[R] operator[>] identifier[func] operator[SEP] { Keyword[return] identifier[toAsync] operator[SEP] identifier[func] , identifier[Schedulers] operator[SEP] identifier[computation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static double toHeading(int fsuipcHeading) { double hdg = fsuipcHeading * 8.3819E-008; //8.1716E-008D; if (hdg < 0) { hdg += 360; } return (new BigDecimal(hdg)).setScale(2, RoundingMode.HALF_UP).doubleValue(); }
class class_name[name] begin[{] method[toHeading, return_type[type[double]], modifier[public static], parameter[fsuipcHeading]] begin[{] local_variable[type[double], hdg] if[binary_operation[member[.hdg], <, literal[0]]] begin[{] assign[member[.hdg], literal[360]] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=hdg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), MemberReference(member=HALF_UP, postfix_operators=[], prefix_operators=[], qualifier=RoundingMode, selectors=[])], member=setScale, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=doubleValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimal, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[toHeading] operator[SEP] Keyword[int] identifier[fsuipcHeading] operator[SEP] { Keyword[double] identifier[hdg] operator[=] identifier[fsuipcHeading] operator[*] literal[Float] operator[SEP] Keyword[if] operator[SEP] identifier[hdg] operator[<] Other[0] operator[SEP] { identifier[hdg] operator[+=] Other[360] operator[SEP] } Keyword[return] operator[SEP] Keyword[new] identifier[BigDecimal] operator[SEP] identifier[hdg] operator[SEP] operator[SEP] operator[SEP] identifier[setScale] operator[SEP] Other[2] , identifier[RoundingMode] operator[SEP] identifier[HALF_UP] operator[SEP] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] }
public static Map<String, Object> getParametersStartingWith(final HttpServletRequest request, String prefix) { if (prefix == null) { prefix = ""; } Enumeration paramNames = request.getParameterNames(); Map<String, Object> params = new TreeMap<>(); for (String paramName : new IterableEnumeration<String>(paramNames)) { if ("".equals(prefix) || paramName.startsWith(prefix)) { String unprefixed = paramName.substring(prefix.length()); String[] values = request.getParameterValues(paramName); if (values == null || values.length == 0) { // Do nothing, no values found at all. } else if (values.length > 1) { params.put(unprefixed, values); } else { params.put(unprefixed, values[0]); } } } return params; }
class class_name[name] begin[{] method[getParametersStartingWith, return_type[type[Map]], modifier[public static], parameter[request, prefix]] begin[{] if[binary_operation[member[.prefix], ==, literal[null]]] begin[{] assign[member[.prefix], literal[""]] else begin[{] None end[}] local_variable[type[Enumeration], paramNames] local_variable[type[Map], params] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=""), operandr=MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=paramName, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=prefix, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=paramName, selectors=[], type_arguments=None), name=unprefixed)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=paramName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParameterValues, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), name=values)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=unprefixed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=put, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=unprefixed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[]))]))]), control=EnhancedForControl(iterable=ClassCreator(arguments=[MemberReference(member=paramNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=IterableEnumeration, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=paramName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.params]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[getParametersStartingWith] operator[SEP] Keyword[final] identifier[HttpServletRequest] identifier[request] , identifier[String] identifier[prefix] operator[SEP] { Keyword[if] operator[SEP] identifier[prefix] operator[==] Other[null] operator[SEP] { identifier[prefix] operator[=] literal[String] operator[SEP] } identifier[Enumeration] identifier[paramNames] operator[=] identifier[request] operator[SEP] identifier[getParameterNames] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[params] operator[=] Keyword[new] identifier[TreeMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[paramName] operator[:] Keyword[new] identifier[IterableEnumeration] operator[<] identifier[String] operator[>] operator[SEP] identifier[paramNames] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[prefix] operator[SEP] operator[||] identifier[paramName] operator[SEP] identifier[startsWith] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] { identifier[String] identifier[unprefixed] operator[=] identifier[paramName] operator[SEP] identifier[substring] operator[SEP] identifier[prefix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[values] operator[=] identifier[request] operator[SEP] identifier[getParameterValues] operator[SEP] identifier[paramName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[values] operator[==] Other[null] operator[||] identifier[values] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { } Keyword[else] Keyword[if] operator[SEP] identifier[values] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] { identifier[params] operator[SEP] identifier[put] operator[SEP] identifier[unprefixed] , identifier[values] operator[SEP] operator[SEP] } Keyword[else] { identifier[params] operator[SEP] identifier[put] operator[SEP] identifier[unprefixed] , identifier[values] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] identifier[params] operator[SEP] }
public void selectByIndex(int index) { getDispatcher().beforeSelect(this, index); new Select(getElement()).selectByIndex(index); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.SELECTED, Integer.toString(index)); } getDispatcher().afterSelect(this, index); }
class class_name[name] begin[{] method[selectByIndex, return_type[void], modifier[public], parameter[index]] begin[{] call[.getDispatcher, parameter[]] ClassCreator(arguments=[MethodInvocation(arguments=[], member=getElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=selectByIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Select, sub_type=None)) if[call[Config.getBoolConfigProperty, parameter[member[ConfigProperty.ENABLE_GUI_LOGGING]]]] begin[{] call[.logUIActions, parameter[member[UIActions.SELECTED], call[Integer.toString, parameter[member[.index]]]]] else begin[{] None end[}] call[.getDispatcher, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[selectByIndex] operator[SEP] Keyword[int] identifier[index] operator[SEP] { identifier[getDispatcher] operator[SEP] operator[SEP] operator[SEP] identifier[beforeSelect] operator[SEP] Keyword[this] , identifier[index] operator[SEP] operator[SEP] Keyword[new] identifier[Select] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[selectByIndex] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Config] operator[SEP] identifier[getBoolConfigProperty] operator[SEP] identifier[ConfigProperty] operator[SEP] identifier[ENABLE_GUI_LOGGING] operator[SEP] operator[SEP] { identifier[logUIActions] operator[SEP] identifier[UIActions] operator[SEP] identifier[SELECTED] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] } identifier[getDispatcher] operator[SEP] operator[SEP] operator[SEP] identifier[afterSelect] operator[SEP] Keyword[this] , identifier[index] operator[SEP] operator[SEP] }
private DescribeAvailabilityZonesResponseType describeAvailabilityZones() { DescribeAvailabilityZonesResponseType ret = new DescribeAvailabilityZonesResponseType(); ret.setRequestId(UUID.randomUUID().toString()); AvailabilityZoneSetType info = new AvailabilityZoneSetType(); AvailabilityZoneItemType item = new AvailabilityZoneItemType(); item.setRegionName(currentRegion); item.setZoneName(currentRegion); info.getItem().add(item); ret.setAvailabilityZoneInfo(info); return ret; }
class class_name[name] begin[{] method[describeAvailabilityZones, return_type[type[DescribeAvailabilityZonesResponseType]], modifier[private], parameter[]] begin[{] local_variable[type[DescribeAvailabilityZonesResponseType], ret] call[ret.setRequestId, parameter[call[UUID.randomUUID, parameter[]]]] local_variable[type[AvailabilityZoneSetType], info] local_variable[type[AvailabilityZoneItemType], item] call[item.setRegionName, parameter[member[.currentRegion]]] call[item.setZoneName, parameter[member[.currentRegion]]] call[info.getItem, parameter[]] call[ret.setAvailabilityZoneInfo, parameter[member[.info]]] return[member[.ret]] end[}] END[}]
Keyword[private] identifier[DescribeAvailabilityZonesResponseType] identifier[describeAvailabilityZones] operator[SEP] operator[SEP] { identifier[DescribeAvailabilityZonesResponseType] identifier[ret] operator[=] Keyword[new] identifier[DescribeAvailabilityZonesResponseType] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[setRequestId] operator[SEP] identifier[UUID] operator[SEP] identifier[randomUUID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[AvailabilityZoneSetType] identifier[info] operator[=] Keyword[new] identifier[AvailabilityZoneSetType] operator[SEP] operator[SEP] operator[SEP] identifier[AvailabilityZoneItemType] identifier[item] operator[=] Keyword[new] identifier[AvailabilityZoneItemType] operator[SEP] operator[SEP] operator[SEP] identifier[item] operator[SEP] identifier[setRegionName] operator[SEP] identifier[currentRegion] operator[SEP] operator[SEP] identifier[item] operator[SEP] identifier[setZoneName] operator[SEP] identifier[currentRegion] operator[SEP] operator[SEP] identifier[info] operator[SEP] identifier[getItem] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[item] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[setAvailabilityZoneInfo] operator[SEP] identifier[info] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
protected void eventUnlocked(SIMPMessage msg) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "eventUnlocked", msg); AIMessageItem message = (AIMessageItem) msg; // dispatch internal will add it to the timeoutManager if it can't find a ready consumer dispatchInternalAndHandleException(message); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "eventUnlocked"); }
class class_name[name] begin[{] method[eventUnlocked, return_type[void], modifier[protected], parameter[msg]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["eventUnlocked"], member[.msg]]] else begin[{] None end[}] local_variable[type[AIMessageItem], message] call[.dispatchInternalAndHandleException, parameter[member[.message]]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["eventUnlocked"]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[eventUnlocked] operator[SEP] identifier[SIMPMessage] identifier[msg] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , identifier[msg] operator[SEP] operator[SEP] identifier[AIMessageItem] identifier[message] operator[=] operator[SEP] identifier[AIMessageItem] operator[SEP] identifier[msg] operator[SEP] identifier[dispatchInternalAndHandleException] operator[SEP] identifier[message] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
protected static <E extends SubSystemBase> SystemManager preCreate(Class<E> serviceClass) { SystemManager system = SystemManager.getCurrent(); if (system == null) throw new IllegalStateException(L.l("{0} must be created before {1}", SystemManager.class.getSimpleName(), serviceClass.getSimpleName())); if (system.getSystem(serviceClass) != null) throw new IllegalStateException(L.l("{0} was previously created", serviceClass.getSimpleName())); return system; }
class class_name[name] begin[{] method[preCreate, return_type[type[SystemManager]], modifier[static protected], parameter[serviceClass]] begin[{] local_variable[type[SystemManager], system] if[binary_operation[member[.system], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{0} must be created before {1}"), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=SystemManager, sub_type=None)), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=serviceClass, selectors=[], type_arguments=None)], member=l, postfix_operators=[], prefix_operators=[], qualifier=L, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[call[system.getSystem, parameter[member[.serviceClass]]], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{0} was previously created"), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=serviceClass, selectors=[], type_arguments=None)], member=l, postfix_operators=[], prefix_operators=[], qualifier=L, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.system]] end[}] END[}]
Keyword[protected] Keyword[static] operator[<] identifier[E] Keyword[extends] identifier[SubSystemBase] operator[>] identifier[SystemManager] identifier[preCreate] operator[SEP] identifier[Class] operator[<] identifier[E] operator[>] identifier[serviceClass] operator[SEP] { identifier[SystemManager] identifier[system] operator[=] identifier[SystemManager] operator[SEP] identifier[getCurrent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[system] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[L] operator[SEP] identifier[l] operator[SEP] literal[String] , identifier[SystemManager] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[serviceClass] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[system] operator[SEP] identifier[getSystem] operator[SEP] identifier[serviceClass] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[L] operator[SEP] identifier[l] operator[SEP] literal[String] , identifier[serviceClass] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[system] operator[SEP] }
public Frame reorderColumns(Frame f) { if ((_interactionsOnly == null) || (f == null)) return f; Vec[] interOnlyVecs = f.vecs(_interactionsOnly); f.remove(_interactionsOnly); for (int i = 0; i < _interactionsOnly.length; i++) { if (isUsed(_interactionsOnly[i])) { f.add(_interactionsOnly[i], interOnlyVecs[i]); } else if (! isIgnored(_interactionsOnly[i])) { Log.warn("Column '" + _interactionsOnly[i] + "' was marked to be used for interactions only " + "but it is not actually required in any interaction."); } } return f; }
class class_name[name] begin[{] method[reorderColumns, return_type[type[Frame]], modifier[public], parameter[f]] begin[{] if[binary_operation[binary_operation[member[._interactionsOnly], ==, literal[null]], ||, binary_operation[member[.f], ==, literal[null]]]] begin[{] return[member[.f]] else begin[{] None end[}] local_variable[type[Vec], interOnlyVecs] call[f.remove, parameter[member[._interactionsOnly]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=_interactionsOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=isUsed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=_interactionsOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=isIgnored, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Column '"), operandr=MemberReference(member=_interactionsOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' was marked to be used for interactions only "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="but it is not actually required in any interaction."), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=_interactionsOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=interOnlyVecs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=add, postfix_operators=[], prefix_operators=[], qualifier=f, 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=_interactionsOnly, 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[.f]] end[}] END[}]
Keyword[public] identifier[Frame] identifier[reorderColumns] operator[SEP] identifier[Frame] identifier[f] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[_interactionsOnly] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[f] operator[==] Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[f] operator[SEP] identifier[Vec] operator[SEP] operator[SEP] identifier[interOnlyVecs] operator[=] identifier[f] operator[SEP] identifier[vecs] operator[SEP] identifier[_interactionsOnly] operator[SEP] operator[SEP] identifier[f] operator[SEP] identifier[remove] operator[SEP] identifier[_interactionsOnly] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[_interactionsOnly] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[isUsed] operator[SEP] identifier[_interactionsOnly] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] { identifier[f] operator[SEP] identifier[add] operator[SEP] identifier[_interactionsOnly] operator[SEP] identifier[i] operator[SEP] , identifier[interOnlyVecs] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[isIgnored] operator[SEP] identifier[_interactionsOnly] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] { identifier[Log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[_interactionsOnly] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[return] identifier[f] operator[SEP] }
public void parseText(String text, AhoCorasickDoubleArrayTrie.IHit<V> processor) { Searcher searcher = getSearcher(text, 0); while (searcher.next()) { processor.hit(searcher.begin, searcher.begin + searcher.length, searcher.value); } }
class class_name[name] begin[{] method[parseText, return_type[void], modifier[public], parameter[text, processor]] begin[{] local_variable[type[Searcher], searcher] while[call[searcher.next, parameter[]]] begin[{] call[processor.hit, parameter[member[searcher.begin], binary_operation[member[searcher.begin], +, member[searcher.length]], member[searcher.value]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[parseText] operator[SEP] identifier[String] identifier[text] , identifier[AhoCorasickDoubleArrayTrie] operator[SEP] identifier[IHit] operator[<] identifier[V] operator[>] identifier[processor] operator[SEP] { identifier[Searcher] identifier[searcher] operator[=] identifier[getSearcher] operator[SEP] identifier[text] , Other[0] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[searcher] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] { identifier[processor] operator[SEP] identifier[hit] operator[SEP] identifier[searcher] operator[SEP] identifier[begin] , identifier[searcher] operator[SEP] identifier[begin] operator[+] identifier[searcher] operator[SEP] identifier[length] , identifier[searcher] operator[SEP] identifier[value] operator[SEP] operator[SEP] } }
private DrawerLayout inflateDrawerLayout(ViewGroup parent){ DrawerLayout drawer = (DrawerLayout) mActivity.getLayoutInflater() .inflate(R.layout.material_drawer, parent, false); // Find the associated views mDrawerPane = ButterKnife.findById(drawer, R.id.navdrawer); mDrawerContentFrame = ButterKnife.findById(drawer, R.id.drawer_content_frame); mDrawerHeaderFrame = ButterKnife.findById(mDrawerPane, R.id.header_container); mDrawerFooterFrame = ButterKnife.findById(mDrawerPane, R.id.footer); mDrawerItemsListContainer = ButterKnife.findById(mDrawerPane, R.id.navdrawer_items_list); // Return the drawer return drawer; }
class class_name[name] begin[{] method[inflateDrawerLayout, return_type[type[DrawerLayout]], modifier[private], parameter[parent]] begin[{] local_variable[type[DrawerLayout], drawer] assign[member[.mDrawerPane], call[ButterKnife.findById, parameter[member[.drawer], member[R.id.navdrawer]]]] assign[member[.mDrawerContentFrame], call[ButterKnife.findById, parameter[member[.drawer], member[R.id.drawer_content_frame]]]] assign[member[.mDrawerHeaderFrame], call[ButterKnife.findById, parameter[member[.mDrawerPane], member[R.id.header_container]]]] assign[member[.mDrawerFooterFrame], call[ButterKnife.findById, parameter[member[.mDrawerPane], member[R.id.footer]]]] assign[member[.mDrawerItemsListContainer], call[ButterKnife.findById, parameter[member[.mDrawerPane], member[R.id.navdrawer_items_list]]]] return[member[.drawer]] end[}] END[}]
Keyword[private] identifier[DrawerLayout] identifier[inflateDrawerLayout] operator[SEP] identifier[ViewGroup] identifier[parent] operator[SEP] { identifier[DrawerLayout] identifier[drawer] operator[=] operator[SEP] identifier[DrawerLayout] operator[SEP] identifier[mActivity] operator[SEP] identifier[getLayoutInflater] operator[SEP] operator[SEP] operator[SEP] identifier[inflate] operator[SEP] identifier[R] operator[SEP] identifier[layout] operator[SEP] identifier[material_drawer] , identifier[parent] , literal[boolean] operator[SEP] operator[SEP] identifier[mDrawerPane] operator[=] identifier[ButterKnife] operator[SEP] identifier[findById] operator[SEP] identifier[drawer] , identifier[R] operator[SEP] identifier[id] operator[SEP] identifier[navdrawer] operator[SEP] operator[SEP] identifier[mDrawerContentFrame] operator[=] identifier[ButterKnife] operator[SEP] identifier[findById] operator[SEP] identifier[drawer] , identifier[R] operator[SEP] identifier[id] operator[SEP] identifier[drawer_content_frame] operator[SEP] operator[SEP] identifier[mDrawerHeaderFrame] operator[=] identifier[ButterKnife] operator[SEP] identifier[findById] operator[SEP] identifier[mDrawerPane] , identifier[R] operator[SEP] identifier[id] operator[SEP] identifier[header_container] operator[SEP] operator[SEP] identifier[mDrawerFooterFrame] operator[=] identifier[ButterKnife] operator[SEP] identifier[findById] operator[SEP] identifier[mDrawerPane] , identifier[R] operator[SEP] identifier[id] operator[SEP] identifier[footer] operator[SEP] operator[SEP] identifier[mDrawerItemsListContainer] operator[=] identifier[ButterKnife] operator[SEP] identifier[findById] operator[SEP] identifier[mDrawerPane] , identifier[R] operator[SEP] identifier[id] operator[SEP] identifier[navdrawer_items_list] operator[SEP] operator[SEP] Keyword[return] identifier[drawer] operator[SEP] }
public static Type getSuperType(Type type) { if (type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; Type genericSuperClass = ((Class<?>) parameterizedType.getRawType()).getGenericSuperclass(); if (genericSuperClass instanceof ParameterizedType) { /* * Find erased generic types for the super class and replace * with actual type arguments from the parameterized type */ Type[] superTypeArguments = getTypeArguments(genericSuperClass); List<Type> typeParameters = Arrays.asList(((Class<?>) parameterizedType.getRawType()).getTypeParameters()); int j = 0; for (int i = 0; i != superTypeArguments.length; i++) { if (typeParameters.contains(superTypeArguments[i])) { superTypeArguments[i] = parameterizedType.getActualTypeArguments()[j++]; } } return new ParameterizedType() { @Override public Type[] getActualTypeArguments() { return superTypeArguments; } @Override public Type getRawType() { return ((ParameterizedType) genericSuperClass).getRawType(); } @Override public Type getOwnerType() { return null; } }; } else { return genericSuperClass; } } else { return ((Class<?>) type).getGenericSuperclass(); } }
class class_name[name] begin[{] method[getSuperType, return_type[type[Type]], modifier[public static], parameter[type]] begin[{] if[binary_operation[member[.type], instanceof, type[ParameterizedType]]] begin[{] local_variable[type[ParameterizedType], parameterizedType] local_variable[type[Type], genericSuperClass] if[binary_operation[member[.genericSuperClass], instanceof, type[ParameterizedType]]] begin[{] local_variable[type[Type], superTypeArguments] local_variable[type[List], typeParameters] local_variable[type[int], j] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=superTypeArguments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=typeParameters, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=superTypeArguments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getActualTypeArguments, postfix_operators=[], prefix_operators=[], qualifier=parameterizedType, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))], type_arguments=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=superTypeArguments, 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[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=superTypeArguments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=getActualTypeArguments, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[None], name=Type, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=Cast(expression=MemberReference(member=genericSuperClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ParameterizedType, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=getRawType, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], documentation=None, modifiers={'public'}, name=getOwnerType, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParameterizedType, sub_type=None))] else begin[{] return[member[.genericSuperClass]] end[}] else begin[{] return[Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[Type] identifier[getSuperType] operator[SEP] identifier[Type] identifier[type] operator[SEP] { Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[ParameterizedType] operator[SEP] { identifier[ParameterizedType] identifier[parameterizedType] operator[=] operator[SEP] identifier[ParameterizedType] operator[SEP] identifier[type] operator[SEP] identifier[Type] identifier[genericSuperClass] operator[=] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[parameterizedType] operator[SEP] identifier[getRawType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getGenericSuperclass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[genericSuperClass] Keyword[instanceof] identifier[ParameterizedType] operator[SEP] { identifier[Type] operator[SEP] operator[SEP] identifier[superTypeArguments] operator[=] identifier[getTypeArguments] operator[SEP] identifier[genericSuperClass] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Type] operator[>] identifier[typeParameters] operator[=] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[parameterizedType] operator[SEP] identifier[getRawType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getTypeParameters] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[!=] identifier[superTypeArguments] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[typeParameters] operator[SEP] identifier[contains] operator[SEP] identifier[superTypeArguments] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] { identifier[superTypeArguments] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[parameterizedType] operator[SEP] identifier[getActualTypeArguments] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] operator[SEP] } } Keyword[return] Keyword[new] identifier[ParameterizedType] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Type] operator[SEP] operator[SEP] identifier[getActualTypeArguments] operator[SEP] operator[SEP] { Keyword[return] identifier[superTypeArguments] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Type] identifier[getRawType] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[ParameterizedType] operator[SEP] identifier[genericSuperClass] operator[SEP] operator[SEP] identifier[getRawType] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Type] identifier[getOwnerType] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } } operator[SEP] } Keyword[else] { Keyword[return] identifier[genericSuperClass] operator[SEP] } } Keyword[else] { Keyword[return] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[getGenericSuperclass] operator[SEP] operator[SEP] operator[SEP] } }
public void displayTextCounter(boolean display) { if (display) { mTextCounterView.setVisibility(TextView.VISIBLE); } else { mTextCounterView.setVisibility(TextView.GONE); } }
class class_name[name] begin[{] method[displayTextCounter, return_type[void], modifier[public], parameter[display]] begin[{] if[member[.display]] begin[{] call[mTextCounterView.setVisibility, parameter[member[TextView.VISIBLE]]] else begin[{] call[mTextCounterView.setVisibility, parameter[member[TextView.GONE]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[displayTextCounter] operator[SEP] Keyword[boolean] identifier[display] operator[SEP] { Keyword[if] operator[SEP] identifier[display] operator[SEP] { identifier[mTextCounterView] operator[SEP] identifier[setVisibility] operator[SEP] identifier[TextView] operator[SEP] identifier[VISIBLE] operator[SEP] operator[SEP] } Keyword[else] { identifier[mTextCounterView] operator[SEP] identifier[setVisibility] operator[SEP] identifier[TextView] operator[SEP] identifier[GONE] operator[SEP] operator[SEP] } }
public List<OpenFalconBean> build(String metric, JSONArray valueJSONArray) { List<OpenFalconBean> beans = new ArrayList<>(); for (Object value : valueJSONArray) { beans.addAll(buildAll(metric, value)); } return beans; }
class class_name[name] begin[{] method[build, return_type[type[List]], modifier[public], parameter[metric, valueJSONArray]] begin[{] local_variable[type[List], beans] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=metric, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildAll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=beans, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=valueJSONArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) return[member[.beans]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[OpenFalconBean] operator[>] identifier[build] operator[SEP] identifier[String] identifier[metric] , identifier[JSONArray] identifier[valueJSONArray] operator[SEP] { identifier[List] operator[<] identifier[OpenFalconBean] operator[>] identifier[beans] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[value] operator[:] identifier[valueJSONArray] operator[SEP] { identifier[beans] operator[SEP] identifier[addAll] operator[SEP] identifier[buildAll] operator[SEP] identifier[metric] , identifier[value] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[beans] operator[SEP] }
@Override public void bind(String dn, Object obj, Attributes attributes) { ldapOperations.bind(dn, obj, attributes); }
class class_name[name] begin[{] method[bind, return_type[void], modifier[public], parameter[dn, obj, attributes]] begin[{] call[ldapOperations.bind, parameter[member[.dn], member[.obj], member[.attributes]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[bind] operator[SEP] identifier[String] identifier[dn] , identifier[Object] identifier[obj] , identifier[Attributes] identifier[attributes] operator[SEP] { identifier[ldapOperations] operator[SEP] identifier[bind] operator[SEP] identifier[dn] , identifier[obj] , identifier[attributes] operator[SEP] operator[SEP] }
public InetAddress getLocalAddress(){ if(localIP == null){ try{ localIP = InetAddress.getByName(localHost); }catch(UnknownHostException e){ return null; } } return localIP; }
class class_name[name] begin[{] method[getLocalAddress, return_type[type[InetAddress]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.localIP], ==, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=localIP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=localHost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByName, postfix_operators=[], prefix_operators=[], qualifier=InetAddress, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnknownHostException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[member[.localIP]] end[}] END[}]
Keyword[public] identifier[InetAddress] identifier[getLocalAddress] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[localIP] operator[==] Other[null] operator[SEP] { Keyword[try] { identifier[localIP] operator[=] identifier[InetAddress] operator[SEP] identifier[getByName] operator[SEP] identifier[localHost] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnknownHostException] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } } Keyword[return] identifier[localIP] operator[SEP] }
private static String[] executeShellCommand(String[] command) throws IOException { String groups = Shell.execCommand(command); StringTokenizer tokenizer = new StringTokenizer(groups); int numOfTokens = tokenizer.countTokens(); String[] tokens = new String[numOfTokens]; for (int i=0; tokenizer.hasMoreTokens(); i++) { tokens[i] = tokenizer.nextToken(); } return tokens; }
class class_name[name] begin[{] method[executeShellCommand, return_type[type[String]], modifier[private static], parameter[command]] begin[{] local_variable[type[String], groups] local_variable[type[StringTokenizer], tokenizer] local_variable[type[int], numOfTokens] local_variable[type[String], tokens] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=tokenizer, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasMoreTokens, postfix_operators=[], prefix_operators=[], qualifier=tokenizer, selectors=[], type_arguments=None), 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[.tokens]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[executeShellCommand] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[command] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[groups] operator[=] identifier[Shell] operator[SEP] identifier[execCommand] operator[SEP] identifier[command] operator[SEP] operator[SEP] identifier[StringTokenizer] identifier[tokenizer] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[groups] operator[SEP] operator[SEP] Keyword[int] identifier[numOfTokens] operator[=] identifier[tokenizer] operator[SEP] identifier[countTokens] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[tokens] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[numOfTokens] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[tokenizer] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[tokens] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[tokenizer] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[tokens] operator[SEP] }
public ComputeNodeUpdateUserOptions withOcpDate(DateTime ocpDate) { if (ocpDate == null) { this.ocpDate = null; } else { this.ocpDate = new DateTimeRfc1123(ocpDate); } return this; }
class class_name[name] begin[{] method[withOcpDate, return_type[type[ComputeNodeUpdateUserOptions]], modifier[public], parameter[ocpDate]] begin[{] if[binary_operation[member[.ocpDate], ==, literal[null]]] begin[{] assign[THIS[member[None.ocpDate]], literal[null]] else begin[{] assign[THIS[member[None.ocpDate]], ClassCreator(arguments=[MemberReference(member=ocpDate, 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=DateTimeRfc1123, sub_type=None))] end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[ComputeNodeUpdateUserOptions] identifier[withOcpDate] operator[SEP] identifier[DateTime] identifier[ocpDate] operator[SEP] { Keyword[if] operator[SEP] identifier[ocpDate] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[ocpDate] operator[=] Other[null] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[ocpDate] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[ocpDate] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public byte[] getBytes(long pos, int length) throws SQLException { if (pos < 1) throw new SQLException("The position of the first byte in the BLOB value to be " + "extracted cannot be less than 1"); if (length < 0) throw new SQLException( "The number of the consecutive bytes in the BLOB value to " + "be extracted cannot be a negative number"); int relativeIndex = this.getRelativeIndex(pos); ByteBuffer buffer = ByteBuffer.allocate(length); int j; for (j = 0; j < length; j++) { if (relativeIndex == currentChunk.length) { // go to the next chunk, if any... currentChunkIndex++; if (currentChunkIndex < binaryDataChunks.size()) { // the next chunk exists so we update the relative index and // the current chunk reference relativeIndex = 0; currentChunk = binaryDataChunks.get(currentChunkIndex); } else // exit from the loop: there are no more bytes to be read break; } buffer.put(currentChunk[relativeIndex]); relativeIndex++; } return buffer.array(); }
class class_name[name] begin[{] method[getBytes, return_type[type[byte]], modifier[public], parameter[pos, length]] begin[{] if[binary_operation[member[.pos], <, literal[1]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The position of the first byte in the BLOB value to be "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="extracted cannot be less than 1"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SQLException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.length], <, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The number of the consecutive bytes in the BLOB value to "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="be extracted cannot be a negative number"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SQLException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], relativeIndex] local_variable[type[ByteBuffer], buffer] local_variable[type[int], j] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=relativeIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=currentChunk, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=currentChunkIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=currentChunkIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=binaryDataChunks, selectors=[], type_arguments=None), operator=<), else_statement=BreakStatement(goto=None, label=None), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=relativeIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentChunk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=currentChunkIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=binaryDataChunks, selectors=[], type_arguments=None)), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=currentChunk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=relativeIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=put, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=relativeIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[buffer.array, parameter[]]] end[}] END[}]
Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] Keyword[long] identifier[pos] , Keyword[int] identifier[length] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[if] operator[SEP] identifier[pos] operator[<] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[SQLException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[length] operator[<] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[SQLException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[relativeIndex] operator[=] Keyword[this] operator[SEP] identifier[getRelativeIndex] operator[SEP] identifier[pos] operator[SEP] operator[SEP] identifier[ByteBuffer] identifier[buffer] operator[=] identifier[ByteBuffer] operator[SEP] identifier[allocate] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[int] identifier[j] operator[SEP] Keyword[for] operator[SEP] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[length] operator[SEP] identifier[j] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[relativeIndex] operator[==] identifier[currentChunk] operator[SEP] identifier[length] operator[SEP] { identifier[currentChunkIndex] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[currentChunkIndex] operator[<] identifier[binaryDataChunks] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { identifier[relativeIndex] operator[=] Other[0] operator[SEP] identifier[currentChunk] operator[=] identifier[binaryDataChunks] operator[SEP] identifier[get] operator[SEP] identifier[currentChunkIndex] operator[SEP] operator[SEP] } Keyword[else] Keyword[break] operator[SEP] } identifier[buffer] operator[SEP] identifier[put] operator[SEP] identifier[currentChunk] operator[SEP] identifier[relativeIndex] operator[SEP] operator[SEP] operator[SEP] identifier[relativeIndex] operator[++] operator[SEP] } Keyword[return] identifier[buffer] operator[SEP] identifier[array] operator[SEP] operator[SEP] operator[SEP] }
static public Class<? extends WritableComparable> getSequenceFileOutputKeyClass(JobConf conf) { return conf.getClass("mapred.seqbinary.output.key.class", conf.getOutputKeyClass().asSubclass(WritableComparable.class), WritableComparable.class); }
class class_name[name] begin[{] method[getSequenceFileOutputKeyClass, return_type[type[Class]], modifier[public static], parameter[conf]] begin[{] return[call[conf.getClass, parameter[literal["mapred.seqbinary.output.key.class"], call[conf.getOutputKeyClass, parameter[]], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WritableComparable, sub_type=None))]]] end[}] END[}]
Keyword[static] Keyword[public] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[WritableComparable] operator[>] identifier[getSequenceFileOutputKeyClass] operator[SEP] identifier[JobConf] identifier[conf] operator[SEP] { Keyword[return] identifier[conf] operator[SEP] identifier[getClass] operator[SEP] literal[String] , identifier[conf] operator[SEP] identifier[getOutputKeyClass] operator[SEP] operator[SEP] operator[SEP] identifier[asSubclass] operator[SEP] identifier[WritableComparable] operator[SEP] Keyword[class] operator[SEP] , identifier[WritableComparable] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public static void extract(InputStream is, File outputFolder) throws IOException { ZipInputStream zis = new ZipInputStream(is); ZipEntry entry; byte[] buffer = new byte[1024]; while ((entry = zis.getNextEntry()) != null) { File outputFile = new File(outputFolder.getCanonicalPath() + File.separatorChar + entry.getName()); File outputParent = new File(outputFile.getParent()); outputParent.mkdirs(); if (entry.isDirectory()) { if (!outputFile.exists()) { outputFile.mkdir(); } } else { try (FileOutputStream fos = new FileOutputStream(outputFile)) { int len; while ((len = zis.read(buffer)) > 0) { fos.write(buffer, 0, len); } } } } }
class class_name[name] begin[{] method[extract, return_type[void], modifier[public static], parameter[is, outputFolder]] begin[{] local_variable[type[ZipInputStream], zis] local_variable[type[ZipEntry], entry] local_variable[type[byte], buffer] while[binary_operation[assign[member[.entry], call[zis.getNextEntry, parameter[]]], !=, literal[null]]] begin[{] local_variable[type[File], outputFile] local_variable[type[File], outputParent] call[outputParent.mkdirs, parameter[]] if[call[entry.isDirectory, parameter[]]] begin[{] if[call[outputFile.exists, parameter[]]] begin[{] call[outputFile.mkdir, parameter[]] else begin[{] None end[}] else begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=len)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=fos, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=zis, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=fos, type=ReferenceType(arguments=None, dimensions=[], name=FileOutputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=outputFile, 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=FileOutputStream, sub_type=None)))]) end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[extract] operator[SEP] identifier[InputStream] identifier[is] , identifier[File] identifier[outputFolder] operator[SEP] Keyword[throws] identifier[IOException] { identifier[ZipInputStream] identifier[zis] operator[=] Keyword[new] identifier[ZipInputStream] operator[SEP] identifier[is] operator[SEP] operator[SEP] identifier[ZipEntry] identifier[entry] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[1024] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[entry] operator[=] identifier[zis] operator[SEP] identifier[getNextEntry] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[File] identifier[outputFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[outputFolder] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[+] identifier[File] operator[SEP] identifier[separatorChar] operator[+] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[outputParent] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[outputFile] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[outputParent] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entry] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[outputFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[outputFile] operator[SEP] identifier[mkdir] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[try] operator[SEP] identifier[FileOutputStream] identifier[fos] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[outputFile] operator[SEP] operator[SEP] { Keyword[int] identifier[len] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[len] operator[=] identifier[zis] operator[SEP] identifier[read] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[fos] operator[SEP] identifier[write] operator[SEP] identifier[buffer] , Other[0] , identifier[len] operator[SEP] operator[SEP] } } } } }
public void marshall(SdkConfigurationProperty sdkConfigurationProperty, ProtocolMarshaller protocolMarshaller) { if (sdkConfigurationProperty == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(sdkConfigurationProperty.getName(), NAME_BINDING); protocolMarshaller.marshall(sdkConfigurationProperty.getFriendlyName(), FRIENDLYNAME_BINDING); protocolMarshaller.marshall(sdkConfigurationProperty.getDescription(), DESCRIPTION_BINDING); protocolMarshaller.marshall(sdkConfigurationProperty.getRequired(), REQUIRED_BINDING); protocolMarshaller.marshall(sdkConfigurationProperty.getDefaultValue(), DEFAULTVALUE_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[sdkConfigurationProperty, protocolMarshaller]] begin[{] if[binary_operation[member[.sdkConfigurationProperty], ==, 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=getName, postfix_operators=[], prefix_operators=[], qualifier=sdkConfigurationProperty, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFriendlyName, postfix_operators=[], prefix_operators=[], qualifier=sdkConfigurationProperty, selectors=[], type_arguments=None), MemberReference(member=FRIENDLYNAME_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=getDescription, postfix_operators=[], prefix_operators=[], qualifier=sdkConfigurationProperty, selectors=[], type_arguments=None), MemberReference(member=DESCRIPTION_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=getRequired, postfix_operators=[], prefix_operators=[], qualifier=sdkConfigurationProperty, selectors=[], type_arguments=None), MemberReference(member=REQUIRED_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=getDefaultValue, postfix_operators=[], prefix_operators=[], qualifier=sdkConfigurationProperty, selectors=[], type_arguments=None), MemberReference(member=DEFAULTVALUE_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[SdkConfigurationProperty] identifier[sdkConfigurationProperty] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[sdkConfigurationProperty] 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[sdkConfigurationProperty] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[sdkConfigurationProperty] operator[SEP] identifier[getFriendlyName] operator[SEP] operator[SEP] , identifier[FRIENDLYNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[sdkConfigurationProperty] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] , identifier[DESCRIPTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[sdkConfigurationProperty] operator[SEP] identifier[getRequired] operator[SEP] operator[SEP] , identifier[REQUIRED_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[sdkConfigurationProperty] operator[SEP] identifier[getDefaultValue] operator[SEP] operator[SEP] , identifier[DEFAULTVALUE_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 List<Command> receive(final Command command) { Assert.requireNonNull(command, "command"); LOG.trace("Received command of type {}", command.getClass().getSimpleName()); List<Command> response = new LinkedList();// collecting parameter pattern if (!(command instanceof InterruptLongPollCommand)) {// signal commands must not update thread-confined state for (DolphinServerAction it : dolphinServerActions) { it.setDolphinResponse(response);// todo: can be deleted as soon as all action refer to the SMS } serverModelStore.setCurrentResponse(response); } List<CommandHandler> actions = registry.getActionsFor(command.getClass()); if (actions.isEmpty()) { LOG.warn("There is no server action registered for received command type {}, known commands types are {}", command.getClass().getSimpleName(), registry.getActions().keySet()); return response; } // copying the list of actions allows an Action to unregister itself // avoiding ConcurrentModificationException to be thrown by the loop List<CommandHandler> actionsCopy = new ArrayList<CommandHandler>(); actionsCopy.addAll(actions); try { for (CommandHandler action : actionsCopy) { action.handleCommand(command, response); } } catch (Exception exception) { throw exception; } return response; }
class class_name[name] begin[{] method[receive, return_type[type[List]], modifier[public], parameter[command]] begin[{] call[Assert.requireNonNull, parameter[member[.command], literal["command"]]] call[LOG.trace, parameter[literal["Received command of type {}"], call[command.getClass, parameter[]]]] local_variable[type[List], response] if[binary_operation[member[.command], instanceof, type[InterruptLongPollCommand]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDolphinResponse, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=dolphinServerActions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DolphinServerAction, sub_type=None))), label=None) call[serverModelStore.setCurrentResponse, parameter[member[.response]]] else begin[{] None end[}] local_variable[type[List], actions] if[call[actions.isEmpty, parameter[]]] begin[{] call[LOG.warn, parameter[literal["There is no server action registered for received command type {}, known commands types are {}"], call[command.getClass, parameter[]], call[registry.getActions, parameter[]]]] return[member[.response]] else begin[{] None end[}] local_variable[type[List], actionsCopy] call[actionsCopy.addAll, parameter[member[.actions]]] TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=command, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleCommand, postfix_operators=[], prefix_operators=[], qualifier=action, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=actionsCopy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=action)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommandHandler, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['Exception']))], finally_block=None, label=None, resources=None) return[member[.response]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Command] operator[>] identifier[receive] operator[SEP] Keyword[final] identifier[Command] identifier[command] operator[SEP] { identifier[Assert] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[command] , literal[String] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[command] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Command] operator[>] identifier[response] operator[=] Keyword[new] identifier[LinkedList] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[command] Keyword[instanceof] identifier[InterruptLongPollCommand] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[DolphinServerAction] identifier[it] operator[:] identifier[dolphinServerActions] operator[SEP] { identifier[it] operator[SEP] identifier[setDolphinResponse] operator[SEP] identifier[response] operator[SEP] operator[SEP] } identifier[serverModelStore] operator[SEP] identifier[setCurrentResponse] operator[SEP] identifier[response] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[CommandHandler] operator[>] identifier[actions] operator[=] identifier[registry] operator[SEP] identifier[getActionsFor] operator[SEP] identifier[command] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[actions] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[command] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[registry] operator[SEP] identifier[getActions] operator[SEP] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] } identifier[List] operator[<] identifier[CommandHandler] operator[>] identifier[actionsCopy] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CommandHandler] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[actionsCopy] operator[SEP] identifier[addAll] operator[SEP] identifier[actions] operator[SEP] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] identifier[CommandHandler] identifier[action] operator[:] identifier[actionsCopy] operator[SEP] { identifier[action] operator[SEP] identifier[handleCommand] operator[SEP] identifier[command] , identifier[response] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[exception] operator[SEP] { Keyword[throw] identifier[exception] operator[SEP] } Keyword[return] identifier[response] operator[SEP] }
public synchronized void generatePluginConfig(String root, String serverName,boolean utilityRequest, File writeDirectory) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "generatePluginConfig", "server is stopping = " + serverIsStopping); } try { // Method is synchronized so only one generate can be in progress at a time. generateInProgress = true; if (!serverIsStopping) { PluginGenerator generator = pluginGenerator; if ( generator == null ) { // Process the updated configuration generator = pluginGenerator = new PluginGenerator(this.config, locMgr, bundleContext); } generator.generateXML(root, serverName, (WebContainer) webContainer, smgr, dynVhostMgr, locMgr,utilityRequest, writeDirectory); } } catch (Throwable t) { FFDCFilter.processException(t, getClass().getName(), "generatePluginConfig"); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Error generate plugin xml: " + t.getMessage()); } } finally { generateInProgress = false; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "generatePluginConfig", "server is stopping = " + serverIsStopping); } }
class class_name[name] begin[{] method[generatePluginConfig, return_type[void], modifier[synchronized public], parameter[root, serverName, utilityRequest, writeDirectory]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[member[.tc], literal["generatePluginConfig"], binary_operation[literal["server is stopping = "], +, member[.serverIsStopping]]]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=generateInProgress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), IfStatement(condition=MemberReference(member=serverIsStopping, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=pluginGenerator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=generator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PluginGenerator, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=generator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=generator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Assignment(expressionl=MemberReference(member=pluginGenerator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=config, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=locMgr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bundleContext, 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=PluginGenerator, sub_type=None)))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=serverName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=webContainer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WebContainer, sub_type=None)), MemberReference(member=smgr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dynVhostMgr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=locMgr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=utilityRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=writeDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generateXML, postfix_operators=[], prefix_operators=[], qualifier=generator, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="generatePluginConfig")], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEventEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error generate plugin xml: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operator=+)], member=event, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=generateInProgress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)], label=None, resources=None) if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[member[.tc], literal["generatePluginConfig"], binary_operation[literal["server is stopping = "], +, member[.serverIsStopping]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[generatePluginConfig] operator[SEP] identifier[String] identifier[root] , identifier[String] identifier[serverName] , Keyword[boolean] identifier[utilityRequest] , identifier[File] identifier[writeDirectory] 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[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[+] identifier[serverIsStopping] operator[SEP] operator[SEP] } Keyword[try] { identifier[generateInProgress] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[serverIsStopping] operator[SEP] { identifier[PluginGenerator] identifier[generator] operator[=] identifier[pluginGenerator] operator[SEP] Keyword[if] operator[SEP] identifier[generator] operator[==] Other[null] operator[SEP] { identifier[generator] operator[=] identifier[pluginGenerator] operator[=] Keyword[new] identifier[PluginGenerator] operator[SEP] Keyword[this] operator[SEP] identifier[config] , identifier[locMgr] , identifier[bundleContext] operator[SEP] operator[SEP] } identifier[generator] operator[SEP] identifier[generateXML] operator[SEP] identifier[root] , identifier[serverName] , operator[SEP] identifier[WebContainer] operator[SEP] identifier[webContainer] , identifier[smgr] , identifier[dynVhostMgr] , identifier[locMgr] , identifier[utilityRequest] , identifier[writeDirectory] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[t] , identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[t] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[generateInProgress] operator[=] literal[boolean] 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[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[+] identifier[serverIsStopping] operator[SEP] operator[SEP] } }
public List<String> getMolecularProperties(String notation) throws BuilderMoleculeException, CTKException, ExtinctionCoefficientException, ValidationException, MonomerLoadingException, ChemistryException { MoleculeProperty result = MoleculePropertyCalculator.getMoleculeProperties(validate(notation)); setMonomerFactoryToDefault(notation); return new LinkedList<String>( Arrays.asList(result.getMolecularFormula(), Double.toString(result.getMolecularWeight()), Double.toString(result.getExactMass()), Double.toString(result.getExtinctionCoefficient()))); }
class class_name[name] begin[{] method[getMolecularProperties, return_type[type[List]], modifier[public], parameter[notation]] begin[{] local_variable[type[MoleculeProperty], result] call[.setMonomerFactoryToDefault, parameter[member[.notation]]] return[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMolecularFormula, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMolecularWeight, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getExactMass, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getExtinctionCoefficient, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None)], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=LinkedList, sub_type=None))] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[getMolecularProperties] operator[SEP] identifier[String] identifier[notation] operator[SEP] Keyword[throws] identifier[BuilderMoleculeException] , identifier[CTKException] , identifier[ExtinctionCoefficientException] , identifier[ValidationException] , identifier[MonomerLoadingException] , identifier[ChemistryException] { identifier[MoleculeProperty] identifier[result] operator[=] identifier[MoleculePropertyCalculator] operator[SEP] identifier[getMoleculeProperties] operator[SEP] identifier[validate] operator[SEP] identifier[notation] operator[SEP] operator[SEP] operator[SEP] identifier[setMonomerFactoryToDefault] operator[SEP] identifier[notation] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[LinkedList] operator[<] identifier[String] operator[>] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[result] operator[SEP] identifier[getMolecularFormula] operator[SEP] operator[SEP] , identifier[Double] operator[SEP] identifier[toString] operator[SEP] identifier[result] operator[SEP] identifier[getMolecularWeight] operator[SEP] operator[SEP] operator[SEP] , identifier[Double] operator[SEP] identifier[toString] operator[SEP] identifier[result] operator[SEP] identifier[getExactMass] operator[SEP] operator[SEP] operator[SEP] , identifier[Double] operator[SEP] identifier[toString] operator[SEP] identifier[result] operator[SEP] identifier[getExtinctionCoefficient] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public Resource createRelative(String relativePath) throws IOException { return new PathResource(this.path.resolve(relativePath)); }
class class_name[name] begin[{] method[createRelative, return_type[type[Resource]], modifier[public], parameter[relativePath]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=path, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=relativePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolve, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PathResource, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Resource] identifier[createRelative] operator[SEP] identifier[String] identifier[relativePath] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] Keyword[new] identifier[PathResource] operator[SEP] Keyword[this] operator[SEP] identifier[path] operator[SEP] identifier[resolve] operator[SEP] identifier[relativePath] operator[SEP] operator[SEP] operator[SEP] }
public Configuration configuration(String identity) throws IllegalArgumentException { Config variants = configurations.get(identity); if (variants == null) { return null; } else { return variants.configuration(); } }
class class_name[name] begin[{] method[configuration, return_type[type[Configuration]], modifier[public], parameter[identity]] begin[{] local_variable[type[Config], variants] if[binary_operation[member[.variants], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] return[call[variants.configuration, parameter[]]] end[}] end[}] END[}]
Keyword[public] identifier[Configuration] identifier[configuration] operator[SEP] identifier[String] identifier[identity] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] { identifier[Config] identifier[variants] operator[=] identifier[configurations] operator[SEP] identifier[get] operator[SEP] identifier[identity] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[variants] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[return] identifier[variants] operator[SEP] identifier[configuration] operator[SEP] operator[SEP] operator[SEP] } }
protected Content getNavSummaryLink(ClassDoc cd, boolean link) { if (link) { return writer.getHyperLink( SectionName.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY, writer.getResource("doclet.navAnnotationTypeOptionalMember")); } else { return writer.getResource("doclet.navAnnotationTypeOptionalMember"); } }
class class_name[name] begin[{] method[getNavSummaryLink, return_type[type[Content]], modifier[protected], parameter[cd, link]] begin[{] if[member[.link]] begin[{] return[call[writer.getHyperLink, parameter[member[SectionName.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY], call[writer.getResource, parameter[literal["doclet.navAnnotationTypeOptionalMember"]]]]]] else begin[{] return[call[writer.getResource, parameter[literal["doclet.navAnnotationTypeOptionalMember"]]]] end[}] end[}] END[}]
Keyword[protected] identifier[Content] identifier[getNavSummaryLink] operator[SEP] identifier[ClassDoc] identifier[cd] , Keyword[boolean] identifier[link] operator[SEP] { Keyword[if] operator[SEP] identifier[link] operator[SEP] { Keyword[return] identifier[writer] operator[SEP] identifier[getHyperLink] operator[SEP] identifier[SectionName] operator[SEP] identifier[ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY] , identifier[writer] operator[SEP] identifier[getResource] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[writer] operator[SEP] identifier[getResource] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
public static void parse(final String range, final RangeConfig tc) throws RangeException { if (range == null) { throw new RangeException("Range can't be null"); } ROOT_STAGE.parse(range, tc); checkBoundaries(tc); }
class class_name[name] begin[{] method[parse, return_type[void], modifier[public static], parameter[range, tc]] begin[{] if[binary_operation[member[.range], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Range can't be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RangeException, sub_type=None)), label=None) else begin[{] None end[}] call[ROOT_STAGE.parse, parameter[member[.range], member[.tc]]] call[.checkBoundaries, parameter[member[.tc]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[parse] operator[SEP] Keyword[final] identifier[String] identifier[range] , Keyword[final] identifier[RangeConfig] identifier[tc] operator[SEP] Keyword[throws] identifier[RangeException] { Keyword[if] operator[SEP] identifier[range] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[RangeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[ROOT_STAGE] operator[SEP] identifier[parse] operator[SEP] identifier[range] , identifier[tc] operator[SEP] operator[SEP] identifier[checkBoundaries] operator[SEP] identifier[tc] operator[SEP] operator[SEP] }
protected void computeFromSimpleMetrics(Points<SimpleNumber> input) throws IOException { if (input == null) { throw new IOException("Null input to create rollup from"); } if (input.isEmpty()) { return; } Map<Long, Points.Point<SimpleNumber>> points = input.getPoints(); for (Map.Entry<Long, Points.Point<SimpleNumber>> item : points.entrySet()) { this.count += 1; SimpleNumber numericMetric = item.getValue().getData(); average.handleFullResMetric(numericMetric.getValue()); variance.handleFullResMetric(numericMetric.getValue()); minValue.handleFullResMetric(numericMetric.getValue()); maxValue.handleFullResMetric(numericMetric.getValue()); } }
class class_name[name] begin[{] method[computeFromSimpleMetrics, return_type[void], modifier[protected], parameter[input]] begin[{] if[binary_operation[member[.input], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Null input to create rollup from")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] if[call[input.isEmpty, parameter[]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Map], points] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=count, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[MethodInvocation(arguments=[], member=getData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=numericMetric)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SimpleNumber, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=numericMetric, selectors=[], type_arguments=None)], member=handleFullResMetric, postfix_operators=[], prefix_operators=[], qualifier=average, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=numericMetric, selectors=[], type_arguments=None)], member=handleFullResMetric, postfix_operators=[], prefix_operators=[], qualifier=variance, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=numericMetric, selectors=[], type_arguments=None)], member=handleFullResMetric, postfix_operators=[], prefix_operators=[], qualifier=minValue, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=numericMetric, selectors=[], type_arguments=None)], member=handleFullResMetric, postfix_operators=[], prefix_operators=[], qualifier=maxValue, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=points, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Points, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SimpleNumber, sub_type=None))], dimensions=None, name=Point, sub_type=None)))], dimensions=None, name=Entry, sub_type=None)))), label=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[computeFromSimpleMetrics] operator[SEP] identifier[Points] operator[<] identifier[SimpleNumber] operator[>] identifier[input] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[input] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[input] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[Map] operator[<] identifier[Long] , identifier[Points] operator[SEP] identifier[Point] operator[<] identifier[SimpleNumber] operator[>] operator[>] identifier[points] operator[=] identifier[input] operator[SEP] identifier[getPoints] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Long] , identifier[Points] operator[SEP] identifier[Point] operator[<] identifier[SimpleNumber] operator[>] operator[>] identifier[item] operator[:] identifier[points] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[count] operator[+=] Other[1] operator[SEP] identifier[SimpleNumber] identifier[numericMetric] operator[=] identifier[item] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] identifier[average] operator[SEP] identifier[handleFullResMetric] operator[SEP] identifier[numericMetric] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[variance] operator[SEP] identifier[handleFullResMetric] operator[SEP] identifier[numericMetric] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[minValue] operator[SEP] identifier[handleFullResMetric] operator[SEP] identifier[numericMetric] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[maxValue] operator[SEP] identifier[handleFullResMetric] operator[SEP] identifier[numericMetric] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public final static String getHeaderIgnoreCase(HttpServletRequest request, String nameIgnoreCase) { Enumeration<String> names = request.getHeaderNames(); String name = null; while (names.hasMoreElements()) { name = names.nextElement(); if (name != null && name.equalsIgnoreCase(nameIgnoreCase)) { return request.getHeader(name); } } return null; }
class class_name[name] begin[{] method[getHeaderIgnoreCase, return_type[type[String]], modifier[final public static], parameter[request, nameIgnoreCase]] begin[{] local_variable[type[Enumeration], names] local_variable[type[String], name] while[call[names.hasMoreElements, parameter[]]] begin[{] assign[member[.name], call[names.nextElement, parameter[]]] if[binary_operation[binary_operation[member[.name], !=, literal[null]], &&, call[name.equalsIgnoreCase, parameter[member[.nameIgnoreCase]]]]] begin[{] return[call[request.getHeader, parameter[member[.name]]]] else begin[{] None end[}] end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[static] identifier[String] identifier[getHeaderIgnoreCase] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[String] identifier[nameIgnoreCase] operator[SEP] { identifier[Enumeration] operator[<] identifier[String] operator[>] identifier[names] operator[=] identifier[request] operator[SEP] identifier[getHeaderNames] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] identifier[names] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[name] operator[=] identifier[names] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[!=] Other[null] operator[&&] identifier[name] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[nameIgnoreCase] operator[SEP] operator[SEP] { Keyword[return] identifier[request] operator[SEP] identifier[getHeader] operator[SEP] identifier[name] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
private Decimal calculateMaximumDrawdown(TimeSeries series, CashFlow cashFlow) { Decimal maximumDrawdown = Decimal.ZERO; Decimal maxPeak = Decimal.ZERO; if (!series.isEmpty()) { // The series is not empty for (int i = series.getBeginIndex(); i <= series.getEndIndex(); i++) { Decimal value = cashFlow.getValue(i); if (value.isGreaterThan(maxPeak)) { maxPeak = value; } Decimal drawdown = maxPeak.minus(value).dividedBy(maxPeak); if (drawdown.isGreaterThan(maximumDrawdown)) { maximumDrawdown = drawdown; } } } return maximumDrawdown; }
class class_name[name] begin[{] method[calculateMaximumDrawdown, return_type[type[Decimal]], modifier[private], parameter[series, cashFlow]] begin[{] local_variable[type[Decimal], maximumDrawdown] local_variable[type[Decimal], maxPeak] if[call[series.isEmpty, parameter[]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=cashFlow, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Decimal, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=maxPeak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isGreaterThan, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxPeak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=minus, postfix_operators=[], prefix_operators=[], qualifier=maxPeak, selectors=[MethodInvocation(arguments=[MemberReference(member=maxPeak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=dividedBy, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=drawdown)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Decimal, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=maximumDrawdown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isGreaterThan, postfix_operators=[], prefix_operators=[], qualifier=drawdown, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=maximumDrawdown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=drawdown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getEndIndex, postfix_operators=[], prefix_operators=[], qualifier=series, selectors=[], type_arguments=None), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=getBeginIndex, postfix_operators=[], prefix_operators=[], qualifier=series, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] return[member[.maximumDrawdown]] end[}] END[}]
Keyword[private] identifier[Decimal] identifier[calculateMaximumDrawdown] operator[SEP] identifier[TimeSeries] identifier[series] , identifier[CashFlow] identifier[cashFlow] operator[SEP] { identifier[Decimal] identifier[maximumDrawdown] operator[=] identifier[Decimal] operator[SEP] identifier[ZERO] operator[SEP] identifier[Decimal] identifier[maxPeak] operator[=] identifier[Decimal] operator[SEP] identifier[ZERO] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[series] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[series] operator[SEP] identifier[getBeginIndex] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<=] identifier[series] operator[SEP] identifier[getEndIndex] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Decimal] identifier[value] operator[=] identifier[cashFlow] operator[SEP] identifier[getValue] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[isGreaterThan] operator[SEP] identifier[maxPeak] operator[SEP] operator[SEP] { identifier[maxPeak] operator[=] identifier[value] operator[SEP] } identifier[Decimal] identifier[drawdown] operator[=] identifier[maxPeak] operator[SEP] identifier[minus] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[dividedBy] operator[SEP] identifier[maxPeak] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[drawdown] operator[SEP] identifier[isGreaterThan] operator[SEP] identifier[maximumDrawdown] operator[SEP] operator[SEP] { identifier[maximumDrawdown] operator[=] identifier[drawdown] operator[SEP] } } } Keyword[return] identifier[maximumDrawdown] operator[SEP] }
public static int getByteCount(int width, int height, Config config) { int bytes = 0; switch (config) { case ALPHA_8: bytes = 1; break; case RGB_565: bytes = 2; break; case ARGB_4444: bytes = 2; break; case ARGB_8888: bytes = 4; break; } return width * height * bytes; }
class class_name[name] begin[{] method[getByteCount, return_type[type[int]], modifier[public static], parameter[width, height, config]] begin[{] local_variable[type[int], bytes] SwitchStatement(cases=[SwitchStatementCase(case=['ALPHA_8'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['RGB_565'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ARGB_4444'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ARGB_8888'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[binary_operation[binary_operation[member[.width], *, member[.height]], *, member[.bytes]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[getByteCount] operator[SEP] Keyword[int] identifier[width] , Keyword[int] identifier[height] , identifier[Config] identifier[config] operator[SEP] { Keyword[int] identifier[bytes] operator[=] Other[0] operator[SEP] Keyword[switch] operator[SEP] identifier[config] operator[SEP] { Keyword[case] identifier[ALPHA_8] operator[:] identifier[bytes] operator[=] Other[1] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[RGB_565] operator[:] identifier[bytes] operator[=] Other[2] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ARGB_4444] operator[:] identifier[bytes] operator[=] Other[2] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ARGB_8888] operator[:] identifier[bytes] operator[=] Other[4] operator[SEP] Keyword[break] operator[SEP] } Keyword[return] identifier[width] operator[*] identifier[height] operator[*] identifier[bytes] operator[SEP] }
@Override public CPDefinition moveCPDefinitionToTrash( long userId, long cpDefinitionId) throws PortalException { CPDefinition cpDefinition = cpDefinitionPersistence.findByPrimaryKey( cpDefinitionId); return cpDefinitionLocalService.moveCPDefinitionToTrash( userId, cpDefinition); }
class class_name[name] begin[{] method[moveCPDefinitionToTrash, return_type[type[CPDefinition]], modifier[public], parameter[userId, cpDefinitionId]] begin[{] local_variable[type[CPDefinition], cpDefinition] return[call[cpDefinitionLocalService.moveCPDefinitionToTrash, parameter[member[.userId], member[.cpDefinition]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CPDefinition] identifier[moveCPDefinitionToTrash] operator[SEP] Keyword[long] identifier[userId] , Keyword[long] identifier[cpDefinitionId] operator[SEP] Keyword[throws] identifier[PortalException] { identifier[CPDefinition] identifier[cpDefinition] operator[=] identifier[cpDefinitionPersistence] operator[SEP] identifier[findByPrimaryKey] operator[SEP] identifier[cpDefinitionId] operator[SEP] operator[SEP] Keyword[return] identifier[cpDefinitionLocalService] operator[SEP] identifier[moveCPDefinitionToTrash] operator[SEP] identifier[userId] , identifier[cpDefinition] operator[SEP] operator[SEP] }
private void movePos(float deltaY) { // has reached the top if ((deltaY < 0 && mPtrIndicator.isInStartPosition())) { if (DEBUG) { PtrCLog.e(LOG_TAG, String.format("has reached the top")); } return; } int to = mPtrIndicator.getCurrentPosY() + (int) deltaY; // over top if (mPtrIndicator.willOverTop(to)) { if (DEBUG) { PtrCLog.e(LOG_TAG, String.format("over top")); } to = PtrIndicator.POS_START; } mPtrIndicator.setCurrentPos(to); int change = to - mPtrIndicator.getLastPosY(); updatePos(change); }
class class_name[name] begin[{] method[movePos, return_type[void], modifier[private], parameter[deltaY]] begin[{] if[binary_operation[binary_operation[member[.deltaY], <, literal[0]], &&, call[mPtrIndicator.isInStartPosition, parameter[]]]] begin[{] if[member[.DEBUG]] begin[{] call[PtrCLog.e, parameter[member[.LOG_TAG], call[String.format, parameter[literal["has reached the top"]]]]] else begin[{] None end[}] return[None] else begin[{] None end[}] local_variable[type[int], to] if[call[mPtrIndicator.willOverTop, parameter[member[.to]]]] begin[{] if[member[.DEBUG]] begin[{] call[PtrCLog.e, parameter[member[.LOG_TAG], call[String.format, parameter[literal["over top"]]]]] else begin[{] None end[}] assign[member[.to], member[PtrIndicator.POS_START]] else begin[{] None end[}] call[mPtrIndicator.setCurrentPos, parameter[member[.to]]] local_variable[type[int], change] call[.updatePos, parameter[member[.change]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[movePos] operator[SEP] Keyword[float] identifier[deltaY] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[deltaY] operator[<] Other[0] operator[&&] identifier[mPtrIndicator] operator[SEP] identifier[isInStartPosition] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] { identifier[PtrCLog] operator[SEP] identifier[e] operator[SEP] identifier[LOG_TAG] , identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } Keyword[int] identifier[to] operator[=] identifier[mPtrIndicator] operator[SEP] identifier[getCurrentPosY] operator[SEP] operator[SEP] operator[+] operator[SEP] Keyword[int] operator[SEP] identifier[deltaY] operator[SEP] Keyword[if] operator[SEP] identifier[mPtrIndicator] operator[SEP] identifier[willOverTop] operator[SEP] identifier[to] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] { identifier[PtrCLog] operator[SEP] identifier[e] operator[SEP] identifier[LOG_TAG] , identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } identifier[to] operator[=] identifier[PtrIndicator] operator[SEP] identifier[POS_START] operator[SEP] } identifier[mPtrIndicator] operator[SEP] identifier[setCurrentPos] operator[SEP] identifier[to] operator[SEP] operator[SEP] Keyword[int] identifier[change] operator[=] identifier[to] operator[-] identifier[mPtrIndicator] operator[SEP] identifier[getLastPosY] operator[SEP] operator[SEP] operator[SEP] identifier[updatePos] operator[SEP] identifier[change] operator[SEP] operator[SEP] }
public Optional<JClassType> getClassFromJsonDeserializeAnnotation( TreeLogger logger, Annotation annotation, String name ) { try { Class asClass = (Class) annotation.getClass().getDeclaredMethod( name ).invoke( annotation ); if ( asClass != Void.class ) { return Optional.fromNullable( getType( asClass.getCanonicalName() ) ); } } catch ( Exception e ) { logger.log( Type.ERROR, "Cannot find method " + name + " on JsonDeserialize annotation", e ); } return Optional.absent(); }
class class_name[name] begin[{] method[getClassFromJsonDeserializeAnnotation, return_type[type[Optional]], modifier[public], parameter[logger, annotation, name]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDeclaredMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), name=asClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=asClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Void, sub_type=None)), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=[], prefix_operators=[], qualifier=asClass, selectors=[], type_arguments=None)], member=getType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=fromNullable, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ERROR, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot find method "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" on JsonDeserialize annotation"), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) return[call[Optional.absent, parameter[]]] end[}] END[}]
Keyword[public] identifier[Optional] operator[<] identifier[JClassType] operator[>] identifier[getClassFromJsonDeserializeAnnotation] operator[SEP] identifier[TreeLogger] identifier[logger] , identifier[Annotation] identifier[annotation] , identifier[String] identifier[name] operator[SEP] { Keyword[try] { identifier[Class] identifier[asClass] operator[=] operator[SEP] identifier[Class] operator[SEP] identifier[annotation] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getDeclaredMethod] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[invoke] operator[SEP] identifier[annotation] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[asClass] operator[!=] identifier[Void] operator[SEP] Keyword[class] operator[SEP] { Keyword[return] identifier[Optional] operator[SEP] identifier[fromNullable] operator[SEP] identifier[getType] operator[SEP] identifier[asClass] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[log] operator[SEP] identifier[Type] operator[SEP] identifier[ERROR] , literal[String] operator[+] identifier[name] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[Optional] operator[SEP] identifier[absent] operator[SEP] operator[SEP] operator[SEP] }
public VoiceCallLeg viewCallLegByCallIdAndLegId(final String callId, String legId) throws UnsupportedEncodingException, NotFoundException, GeneralException, UnauthorizedException { if (callId == null) { throw new IllegalArgumentException("Voice call ID must be specified."); } if (legId == null) { throw new IllegalArgumentException("Leg ID must be specified."); } String url = String.format( "%s%s/%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH, urlEncode(callId), VOICELEGS_SUFFIX_PATH); VoiceCallLegResponse response = messageBirdService.requestByID(url, legId, VoiceCallLegResponse.class); if (response.getData().size() == 1) { return response.getData().get(0); } else { throw new NotFoundException("No such leg", new LinkedList<ErrorReport>()); } }
class class_name[name] begin[{] method[viewCallLegByCallIdAndLegId, return_type[type[VoiceCallLeg]], modifier[public], parameter[callId, legId]] begin[{] if[binary_operation[member[.callId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Voice call ID must be 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[}] if[binary_operation[member[.legId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Leg ID must be 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[String], url] local_variable[type[VoiceCallLegResponse], response] if[binary_operation[call[response.getData, parameter[]], ==, literal[1]]] begin[{] return[call[response.getData, parameter[]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No such leg"), 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=ErrorReport, sub_type=None))], dimensions=None, name=LinkedList, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NotFoundException, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[public] identifier[VoiceCallLeg] identifier[viewCallLegByCallIdAndLegId] operator[SEP] Keyword[final] identifier[String] identifier[callId] , identifier[String] identifier[legId] operator[SEP] Keyword[throws] identifier[UnsupportedEncodingException] , identifier[NotFoundException] , identifier[GeneralException] , identifier[UnauthorizedException] { Keyword[if] operator[SEP] identifier[callId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[legId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[url] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[VOICE_CALLS_BASE_URL] , identifier[VOICECALLSPATH] , identifier[urlEncode] operator[SEP] identifier[callId] operator[SEP] , identifier[VOICELEGS_SUFFIX_PATH] operator[SEP] operator[SEP] identifier[VoiceCallLegResponse] identifier[response] operator[=] identifier[messageBirdService] operator[SEP] identifier[requestByID] operator[SEP] identifier[url] , identifier[legId] , identifier[VoiceCallLegResponse] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[NotFoundException] operator[SEP] literal[String] , Keyword[new] identifier[LinkedList] operator[<] identifier[ErrorReport] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public static GEOMTYPE getGeometryType( SimpleFeatureCollection featureCollection ) { GeometryDescriptor geometryDescriptor = featureCollection.getSchema().getGeometryDescriptor(); if (EGeometryType.isPolygon(geometryDescriptor)) { return GEOMTYPE.POLYGON; } else if (EGeometryType.isLine(geometryDescriptor)) { return GEOMTYPE.LINE; } else if (EGeometryType.isPoint(geometryDescriptor)) { return GEOMTYPE.POINT; } else { return GEOMTYPE.UNKNOWN; } }
class class_name[name] begin[{] method[getGeometryType, return_type[type[GEOMTYPE]], modifier[public static], parameter[featureCollection]] begin[{] local_variable[type[GeometryDescriptor], geometryDescriptor] if[call[EGeometryType.isPolygon, parameter[member[.geometryDescriptor]]]] begin[{] return[member[GEOMTYPE.POLYGON]] else begin[{] if[call[EGeometryType.isLine, parameter[member[.geometryDescriptor]]]] begin[{] return[member[GEOMTYPE.LINE]] else begin[{] if[call[EGeometryType.isPoint, parameter[member[.geometryDescriptor]]]] begin[{] return[member[GEOMTYPE.POINT]] else begin[{] return[member[GEOMTYPE.UNKNOWN]] end[}] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[GEOMTYPE] identifier[getGeometryType] operator[SEP] identifier[SimpleFeatureCollection] identifier[featureCollection] operator[SEP] { identifier[GeometryDescriptor] identifier[geometryDescriptor] operator[=] identifier[featureCollection] operator[SEP] identifier[getSchema] operator[SEP] operator[SEP] operator[SEP] identifier[getGeometryDescriptor] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[EGeometryType] operator[SEP] identifier[isPolygon] operator[SEP] identifier[geometryDescriptor] operator[SEP] operator[SEP] { Keyword[return] identifier[GEOMTYPE] operator[SEP] identifier[POLYGON] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[EGeometryType] operator[SEP] identifier[isLine] operator[SEP] identifier[geometryDescriptor] operator[SEP] operator[SEP] { Keyword[return] identifier[GEOMTYPE] operator[SEP] identifier[LINE] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[EGeometryType] operator[SEP] identifier[isPoint] operator[SEP] identifier[geometryDescriptor] operator[SEP] operator[SEP] { Keyword[return] identifier[GEOMTYPE] operator[SEP] identifier[POINT] operator[SEP] } Keyword[else] { Keyword[return] identifier[GEOMTYPE] operator[SEP] identifier[UNKNOWN] operator[SEP] } }
public AggregateResult aggregateQuery(TableDefinition tableDef, OlapAggregate request) { checkServiceState(); AggregationResult result = m_olap.aggregate(tableDef.getAppDef(), tableDef.getTableName(), request); return AggregateResultConverter.create(result, request); }
class class_name[name] begin[{] method[aggregateQuery, return_type[type[AggregateResult]], modifier[public], parameter[tableDef, request]] begin[{] call[.checkServiceState, parameter[]] local_variable[type[AggregationResult], result] return[call[AggregateResultConverter.create, parameter[member[.result], member[.request]]]] end[}] END[}]
Keyword[public] identifier[AggregateResult] identifier[aggregateQuery] operator[SEP] identifier[TableDefinition] identifier[tableDef] , identifier[OlapAggregate] identifier[request] operator[SEP] { identifier[checkServiceState] operator[SEP] operator[SEP] operator[SEP] identifier[AggregationResult] identifier[result] operator[=] identifier[m_olap] operator[SEP] identifier[aggregate] operator[SEP] identifier[tableDef] operator[SEP] identifier[getAppDef] operator[SEP] operator[SEP] , identifier[tableDef] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] , identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[AggregateResultConverter] operator[SEP] identifier[create] operator[SEP] identifier[result] , identifier[request] operator[SEP] operator[SEP] }
private static void assertName(final String name, final JBBPToken token) { if (name.indexOf('.') >= 0) { throw new JBBPCompilationException("Detected disallowed char '.' in name [" + name + ']', token); } }
class class_name[name] begin[{] method[assertName, return_type[void], modifier[private static], parameter[name, token]] begin[{] if[binary_operation[call[name.indexOf, parameter[literal['.']]], >=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Detected disallowed char '.' in name ["), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=']'), operator=+), MemberReference(member=token, 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=JBBPCompilationException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[assertName] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[JBBPToken] identifier[token] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>=] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[JBBPCompilationException] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] , identifier[token] operator[SEP] operator[SEP] } }
public void clean() { Instant minAge = Instant.now().minus(storageTimeInSeconds, ChronoUnit.SECONDS); synchronized (messages) { messages.removeIf(messageRef -> Optional.ofNullable(messageRef.get()) .map(message -> !message.isCachedForever() && message.getCreationTimestamp().isBefore(minAge)) .orElse(true)); long foreverCachedAmount = messages.stream() .map(Reference::get) .filter(Objects::nonNull) .filter(Message::isCachedForever) .count(); messages.removeAll(messages.stream() .filter(messageRef -> Optional.ofNullable(messageRef.get()) .map(message -> !message.isCachedForever()) .orElse(true)) .limit(Math.max(0, messages.size() - capacity - foreverCachedAmount)) .collect(Collectors.toList())); } }
class class_name[name] begin[{] method[clean, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[Instant], minAge] SYNCHRONIZED[member[.messages]] BEGIN[{] call[messages.removeIf, parameter[LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=messageRef, selectors=[], type_arguments=None)], member=ofNullable, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[MethodInvocation(arguments=[LambdaExpression(body=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isCachedForever, postfix_operators=[], prefix_operators=['!'], qualifier=message, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getCreationTimestamp, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[MethodInvocation(arguments=[MemberReference(member=minAge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isBefore, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), parameters=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=map, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=orElse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[MemberReference(member=messageRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] local_variable[type[long], foreverCachedAmount] call[messages.removeAll, parameter[call[messages.stream, parameter[]]]] END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[clean] operator[SEP] operator[SEP] { identifier[Instant] identifier[minAge] operator[=] identifier[Instant] operator[SEP] identifier[now] operator[SEP] operator[SEP] operator[SEP] identifier[minus] operator[SEP] identifier[storageTimeInSeconds] , identifier[ChronoUnit] operator[SEP] identifier[SECONDS] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[messages] operator[SEP] { identifier[messages] operator[SEP] identifier[removeIf] operator[SEP] identifier[messageRef] operator[->] identifier[Optional] operator[SEP] identifier[ofNullable] operator[SEP] identifier[messageRef] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[message] operator[->] operator[!] identifier[message] operator[SEP] identifier[isCachedForever] operator[SEP] operator[SEP] operator[&&] identifier[message] operator[SEP] identifier[getCreationTimestamp] operator[SEP] operator[SEP] operator[SEP] identifier[isBefore] operator[SEP] identifier[minAge] operator[SEP] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[foreverCachedAmount] operator[=] identifier[messages] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Reference] operator[::] identifier[get] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[Objects] operator[::] identifier[nonNull] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[Message] operator[::] identifier[isCachedForever] operator[SEP] operator[SEP] identifier[count] operator[SEP] operator[SEP] operator[SEP] identifier[messages] operator[SEP] identifier[removeAll] operator[SEP] identifier[messages] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[messageRef] operator[->] identifier[Optional] operator[SEP] identifier[ofNullable] operator[SEP] identifier[messageRef] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[message] operator[->] operator[!] identifier[message] operator[SEP] identifier[isCachedForever] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[limit] operator[SEP] identifier[Math] operator[SEP] identifier[max] operator[SEP] Other[0] , identifier[messages] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] identifier[capacity] operator[-] identifier[foreverCachedAmount] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@Override public void setupBindings() { super.setupBindings(); editableArea.visibleProperty().bind(Bindings.and(field.editableProperty(), field.multilineProperty())); editableField.visibleProperty().bind(Bindings.and(field.editableProperty(), field.multilineProperty().not())); readOnlyLabel.visibleProperty().bind(field.editableProperty().not()); editableField.textProperty().bindBidirectional(field.userInputProperty()); editableArea.textProperty().bindBidirectional(field.userInputProperty()); readOnlyLabel.textProperty().bind(field.userInputProperty()); editableField.promptTextProperty().bind(field.placeholderProperty()); editableArea.promptTextProperty().bind(field.placeholderProperty()); editableArea.managedProperty().bind(editableArea.visibleProperty()); editableField.managedProperty().bind(editableField.visibleProperty()); }
class class_name[name] begin[{] method[setupBindings, return_type[void], modifier[public], parameter[]] begin[{] SuperMethodInvocation(arguments=[], member=setupBindings, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) call[editableArea.visibleProperty, parameter[]] call[editableField.visibleProperty, parameter[]] call[readOnlyLabel.visibleProperty, parameter[]] call[editableField.textProperty, parameter[]] call[editableArea.textProperty, parameter[]] call[readOnlyLabel.textProperty, parameter[]] call[editableField.promptTextProperty, parameter[]] call[editableArea.promptTextProperty, parameter[]] call[editableArea.managedProperty, parameter[]] call[editableField.managedProperty, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setupBindings] operator[SEP] operator[SEP] { Keyword[super] operator[SEP] identifier[setupBindings] operator[SEP] operator[SEP] operator[SEP] identifier[editableArea] operator[SEP] identifier[visibleProperty] operator[SEP] operator[SEP] operator[SEP] identifier[bind] operator[SEP] identifier[Bindings] operator[SEP] identifier[and] operator[SEP] identifier[field] operator[SEP] identifier[editableProperty] operator[SEP] operator[SEP] , identifier[field] operator[SEP] identifier[multilineProperty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[editableField] operator[SEP] identifier[visibleProperty] operator[SEP] operator[SEP] operator[SEP] identifier[bind] operator[SEP] identifier[Bindings] operator[SEP] identifier[and] operator[SEP] identifier[field] operator[SEP] identifier[editableProperty] operator[SEP] operator[SEP] , identifier[field] operator[SEP] identifier[multilineProperty] operator[SEP] operator[SEP] operator[SEP] identifier[not] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[readOnlyLabel] operator[SEP] identifier[visibleProperty] operator[SEP] operator[SEP] operator[SEP] identifier[bind] operator[SEP] identifier[field] operator[SEP] identifier[editableProperty] operator[SEP] operator[SEP] operator[SEP] identifier[not] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[editableField] operator[SEP] identifier[textProperty] operator[SEP] operator[SEP] operator[SEP] identifier[bindBidirectional] operator[SEP] identifier[field] operator[SEP] identifier[userInputProperty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[editableArea] operator[SEP] identifier[textProperty] operator[SEP] operator[SEP] operator[SEP] identifier[bindBidirectional] operator[SEP] identifier[field] operator[SEP] identifier[userInputProperty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[readOnlyLabel] operator[SEP] identifier[textProperty] operator[SEP] operator[SEP] operator[SEP] identifier[bind] operator[SEP] identifier[field] operator[SEP] identifier[userInputProperty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[editableField] operator[SEP] identifier[promptTextProperty] operator[SEP] operator[SEP] operator[SEP] identifier[bind] operator[SEP] identifier[field] operator[SEP] identifier[placeholderProperty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[editableArea] operator[SEP] identifier[promptTextProperty] operator[SEP] operator[SEP] operator[SEP] identifier[bind] operator[SEP] identifier[field] operator[SEP] identifier[placeholderProperty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[editableArea] operator[SEP] identifier[managedProperty] operator[SEP] operator[SEP] operator[SEP] identifier[bind] operator[SEP] identifier[editableArea] operator[SEP] identifier[visibleProperty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[editableField] operator[SEP] identifier[managedProperty] operator[SEP] operator[SEP] operator[SEP] identifier[bind] operator[SEP] identifier[editableField] operator[SEP] identifier[visibleProperty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public String groupHtml(CmsWorkplace wp) { StringBuffer html = new StringBuffer(512); html.append(htmlStart(wp)); Iterator<CmsAdminMenuItem> itItem = m_container.elementList().iterator(); while (itItem.hasNext()) { CmsAdminMenuItem item = itItem.next(); html.append(item.itemHtml(wp)); html.append("\n"); } html.append(htmlEnd()); return html.toString(); }
class class_name[name] begin[{] method[groupHtml, return_type[type[String]], modifier[public], parameter[wp]] begin[{] local_variable[type[StringBuffer], html] call[html.append, parameter[call[.htmlStart, parameter[member[.wp]]]]] local_variable[type[Iterator], itItem] while[call[itItem.hasNext, parameter[]]] begin[{] local_variable[type[CmsAdminMenuItem], item] call[html.append, parameter[call[item.itemHtml, parameter[member[.wp]]]]] call[html.append, parameter[literal["\n"]]] end[}] call[html.append, parameter[call[.htmlEnd, parameter[]]]] return[call[html.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[groupHtml] operator[SEP] identifier[CmsWorkplace] identifier[wp] operator[SEP] { identifier[StringBuffer] identifier[html] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[512] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[htmlStart] operator[SEP] identifier[wp] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[CmsAdminMenuItem] operator[>] identifier[itItem] operator[=] identifier[m_container] operator[SEP] identifier[elementList] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itItem] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[CmsAdminMenuItem] identifier[item] operator[=] identifier[itItem] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[item] operator[SEP] identifier[itemHtml] operator[SEP] identifier[wp] operator[SEP] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[htmlEnd] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[html] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private boolean isApply(ChangeSet changeSet) { // 必须包含 PENDING_DROPS 不然无法在只删除列时产生变更脚本 return (changeSet.getType() == ChangeSetType.APPLY || changeSet.getType() == ChangeSetType.PENDING_DROPS) && !changeSet.getChangeSetChildren().isEmpty(); }
class class_name[name] begin[{] method[isApply, return_type[type[boolean]], modifier[private], parameter[changeSet]] begin[{] return[binary_operation[binary_operation[binary_operation[call[changeSet.getType, parameter[]], ==, member[ChangeSetType.APPLY]], ||, binary_operation[call[changeSet.getType, parameter[]], ==, member[ChangeSetType.PENDING_DROPS]]], &&, call[changeSet.getChangeSetChildren, parameter[]]]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isApply] operator[SEP] identifier[ChangeSet] identifier[changeSet] operator[SEP] { Keyword[return] operator[SEP] identifier[changeSet] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[ChangeSetType] operator[SEP] identifier[APPLY] operator[||] identifier[changeSet] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[ChangeSetType] operator[SEP] identifier[PENDING_DROPS] operator[SEP] operator[&&] operator[!] identifier[changeSet] operator[SEP] identifier[getChangeSetChildren] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] }
public Map<String, T> parseMap(byte[] byteArray) throws IOException { JsonParser jsonParser = LoganSquare.JSON_FACTORY.createParser(byteArray); jsonParser.nextToken(); return parseMap(jsonParser); }
class class_name[name] begin[{] method[parseMap, return_type[type[Map]], modifier[public], parameter[byteArray]] begin[{] local_variable[type[JsonParser], jsonParser] call[jsonParser.nextToken, parameter[]] return[call[.parseMap, parameter[member[.jsonParser]]]] end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[T] operator[>] identifier[parseMap] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[byteArray] operator[SEP] Keyword[throws] identifier[IOException] { identifier[JsonParser] identifier[jsonParser] operator[=] identifier[LoganSquare] operator[SEP] identifier[JSON_FACTORY] operator[SEP] identifier[createParser] operator[SEP] identifier[byteArray] operator[SEP] operator[SEP] identifier[jsonParser] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[parseMap] operator[SEP] identifier[jsonParser] operator[SEP] operator[SEP] }
public static void clear() { lock.writeLock().lock(); try { allStrings = new EfficientStringBiMap(HASH_MODULO); indexCounter.set(0); } finally { lock.writeLock().unlock(); } }
class class_name[name] begin[{] method[clear, return_type[void], modifier[public static], parameter[]] begin[{] call[lock.writeLock, parameter[]] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=allStrings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=HASH_MODULO, 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=EfficientStringBiMap, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=set, postfix_operators=[], prefix_operators=[], qualifier=indexCounter, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=writeLock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[clear] operator[SEP] operator[SEP] { identifier[lock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[allStrings] operator[=] Keyword[new] identifier[EfficientStringBiMap] operator[SEP] identifier[HASH_MODULO] operator[SEP] operator[SEP] identifier[indexCounter] operator[SEP] identifier[set] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[finally] { identifier[lock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } }
public static MimeMessage newMimeMessage(InputStream inputStream) { try { return new MimeMessage(Session.getDefaultInstance(new Properties()), inputStream); } catch (MessagingException e) { throw new IllegalArgumentException("Can not generate mime message for input stream " + inputStream, e); } }
class class_name[name] begin[{] method[newMimeMessage, return_type[type[MimeMessage]], modifier[public static], parameter[inputStream]] begin[{] TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Properties, sub_type=None))], member=getDefaultInstance, postfix_operators=[], prefix_operators=[], qualifier=Session, selectors=[], type_arguments=None), MemberReference(member=inputStream, 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=MimeMessage, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can not generate mime message for input stream "), operandr=MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MessagingException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[MimeMessage] identifier[newMimeMessage] operator[SEP] identifier[InputStream] identifier[inputStream] operator[SEP] { Keyword[try] { Keyword[return] Keyword[new] identifier[MimeMessage] operator[SEP] identifier[Session] operator[SEP] identifier[getDefaultInstance] operator[SEP] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] , identifier[inputStream] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[MessagingException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[inputStream] , identifier[e] operator[SEP] operator[SEP] } }
private boolean extendsVariableContext(final TypeElement typeElement) { boolean extendsVariableContext = false; for (TypeMirror extendingInterface : typeElement.getInterfaces()) { if (extendingInterface.toString().equals(VariableContext.class.getCanonicalName())) { extendsVariableContext = true; } } return extendsVariableContext; }
class class_name[name] begin[{] method[extendsVariableContext, return_type[type[boolean]], modifier[private], parameter[typeElement]] begin[{] local_variable[type[boolean], extendsVariableContext] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=extendingInterface, selectors=[MethodInvocation(arguments=[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=VariableContext, sub_type=None))], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=extendsVariableContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getInterfaces, postfix_operators=[], prefix_operators=[], qualifier=typeElement, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=extendingInterface)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TypeMirror, sub_type=None))), label=None) return[member[.extendsVariableContext]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[extendsVariableContext] operator[SEP] Keyword[final] identifier[TypeElement] identifier[typeElement] operator[SEP] { Keyword[boolean] identifier[extendsVariableContext] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[TypeMirror] identifier[extendingInterface] operator[:] identifier[typeElement] operator[SEP] identifier[getInterfaces] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[extendingInterface] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[VariableContext] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[extendsVariableContext] operator[=] literal[boolean] operator[SEP] } } Keyword[return] identifier[extendsVariableContext] operator[SEP] }
public static String getCompactServerStatus(final ODistributedServerManager manager, final ODocument distribCfg) { final StringBuilder buffer = new StringBuilder(); final Collection<ODocument> members = distribCfg.field("members"); if (members != null) { buffer.append(members.size()); buffer.append(":["); int memberCount = 0; for (ODocument m : members) { if (m == null) continue; if (memberCount++ > 0) buffer.append(","); final String serverName = m.field("name"); buffer.append(serverName); buffer.append((Object)m.field("status")); final Collection<String> databases = m.field("databases"); if (databases != null) { buffer.append("{"); int dbCount = 0; for (String dbName : databases) { final ODistributedConfiguration dbCfg = manager.getDatabaseConfiguration(dbName, false); if (dbCfg == null) continue; if (dbCount++ > 0) buffer.append(","); buffer.append(dbName); buffer.append("="); buffer.append(manager.getDatabaseStatus(serverName, dbName)); buffer.append(" ("); buffer.append(dbCfg.getServerRole(serverName)); buffer.append(")"); } buffer.append("}"); } } buffer.append("]"); } return buffer.toString(); }
class class_name[name] begin[{] method[getCompactServerStatus, return_type[type[String]], modifier[public static], parameter[manager, distribCfg]] begin[{] local_variable[type[StringBuilder], buffer] local_variable[type[Collection], members] if[binary_operation[member[.members], !=, literal[null]]] begin[{] call[buffer.append, parameter[call[members.size, parameter[]]]] call[buffer.append, parameter[literal[":["]]] local_variable[type[int], memberCount] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m, 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=ContinueStatement(goto=None, label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=memberCount, 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=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name")], member=field, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), name=serverName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=serverName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="status")], member=field, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="databases")], member=field, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), name=databases)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Collection, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=databases, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=dbCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dbName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getDatabaseConfiguration, postfix_operators=[], prefix_operators=[], qualifier=manager, selectors=[], type_arguments=None), name=dbCfg)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ODistributedConfiguration, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dbCfg, 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=ContinueStatement(goto=None, label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dbCount, 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=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dbName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=serverName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dbName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDatabaseStatus, postfix_operators=[], prefix_operators=[], qualifier=manager, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" (")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=serverName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getServerRole, postfix_operators=[], prefix_operators=[], qualifier=dbCfg, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=databases, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dbName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="}")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=members, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ODocument, sub_type=None))), label=None) call[buffer.append, parameter[literal["]"]]] else begin[{] None end[}] return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getCompactServerStatus] operator[SEP] Keyword[final] identifier[ODistributedServerManager] identifier[manager] , Keyword[final] identifier[ODocument] identifier[distribCfg] operator[SEP] { Keyword[final] identifier[StringBuilder] identifier[buffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[ODocument] operator[>] identifier[members] operator[=] identifier[distribCfg] operator[SEP] identifier[field] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[members] operator[!=] Other[null] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[members] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[memberCount] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[ODocument] identifier[m] operator[:] identifier[members] operator[SEP] { Keyword[if] operator[SEP] identifier[m] operator[==] Other[null] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[memberCount] operator[++] operator[>] Other[0] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[serverName] operator[=] identifier[m] operator[SEP] identifier[field] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[serverName] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] operator[SEP] identifier[Object] operator[SEP] identifier[m] operator[SEP] identifier[field] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[String] operator[>] identifier[databases] operator[=] identifier[m] operator[SEP] identifier[field] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[databases] operator[!=] Other[null] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[dbCount] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[dbName] operator[:] identifier[databases] operator[SEP] { Keyword[final] identifier[ODistributedConfiguration] identifier[dbCfg] operator[=] identifier[manager] operator[SEP] identifier[getDatabaseConfiguration] operator[SEP] identifier[dbName] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dbCfg] operator[==] Other[null] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[dbCount] operator[++] operator[>] Other[0] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[dbName] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[manager] operator[SEP] identifier[getDatabaseStatus] operator[SEP] identifier[serverName] , identifier[dbName] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[dbCfg] operator[SEP] identifier[getServerRole] operator[SEP] identifier[serverName] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } } identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(DeleteBotAliasRequest deleteBotAliasRequest, ProtocolMarshaller protocolMarshaller) { if (deleteBotAliasRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteBotAliasRequest.getName(), NAME_BINDING); protocolMarshaller.marshall(deleteBotAliasRequest.getBotName(), BOTNAME_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[deleteBotAliasRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.deleteBotAliasRequest], ==, 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=getName, postfix_operators=[], prefix_operators=[], qualifier=deleteBotAliasRequest, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBotName, postfix_operators=[], prefix_operators=[], qualifier=deleteBotAliasRequest, selectors=[], type_arguments=None), MemberReference(member=BOTNAME_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[DeleteBotAliasRequest] identifier[deleteBotAliasRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[deleteBotAliasRequest] 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[deleteBotAliasRequest] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteBotAliasRequest] operator[SEP] identifier[getBotName] operator[SEP] operator[SEP] , identifier[BOTNAME_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] } }
protected void init3() { if (disabledSubProjects == null) { disabledSubProjects = new PersistedList<>(this); } // Owner doesn't seem to be set when loading from XML disabledSubProjects.setOwner(this); try { XmlFile templateXmlFile = Items.getConfigFile(getTemplateDir()); if (templateXmlFile.getFile().isFile()) { /* * Do not use Items.load here, since it uses getRootDirFor(i) during onLoad, * which returns the wrong location since template would still be unset. * Instead, read the XML directly into template and then invoke onLoad. */ //noinspection unchecked template = (P) templateXmlFile.read(); template.onLoad(this, TEMPLATE); } else { /* * Don't use the factory here because newInstance calls setBranch, attempting * to save the project before template is set. That would invoke * getRootDirFor(i) and get the wrong directory to save into. */ template = newTemplate(); } // Prevent tampering if (!(template.getScm() instanceof NullSCM)) { template.setScm(new NullSCM()); } template.disable(); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to load template project " + getTemplateDir(), e); } }
class class_name[name] begin[{] method[init3, return_type[void], modifier[protected], parameter[]] begin[{] if[binary_operation[member[.disabledSubProjects], ==, literal[null]]] begin[{] assign[member[.disabledSubProjects], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=PersistedList, sub_type=None))] else begin[{] None end[}] call[disabledSubProjects.setOwner, parameter[THIS[]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTemplateDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getConfigFile, postfix_operators=[], prefix_operators=[], qualifier=Items, selectors=[], type_arguments=None), name=templateXmlFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XmlFile, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=templateXmlFile, selectors=[MethodInvocation(arguments=[], member=isFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=newTemplate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=read, postfix_operators=[], prefix_operators=[], qualifier=templateXmlFile, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=P, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=TEMPLATE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onLoad, postfix_operators=[], prefix_operators=[], qualifier=template, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getScm, postfix_operators=[], prefix_operators=[], qualifier=template, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=NullSCM, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullSCM, sub_type=None))], member=setScm, postfix_operators=[], prefix_operators=[], qualifier=template, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=disable, postfix_operators=[], prefix_operators=[], qualifier=template, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to load template project "), operandr=MethodInvocation(arguments=[], member=getTemplateDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[init3] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[disabledSubProjects] operator[==] Other[null] operator[SEP] { identifier[disabledSubProjects] operator[=] Keyword[new] identifier[PersistedList] operator[<] operator[>] operator[SEP] Keyword[this] operator[SEP] operator[SEP] } identifier[disabledSubProjects] operator[SEP] identifier[setOwner] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[try] { identifier[XmlFile] identifier[templateXmlFile] operator[=] identifier[Items] operator[SEP] identifier[getConfigFile] operator[SEP] identifier[getTemplateDir] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[templateXmlFile] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP] { identifier[template] operator[=] operator[SEP] identifier[P] operator[SEP] identifier[templateXmlFile] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] identifier[template] operator[SEP] identifier[onLoad] operator[SEP] Keyword[this] , identifier[TEMPLATE] operator[SEP] operator[SEP] } Keyword[else] { identifier[template] operator[=] identifier[newTemplate] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[template] operator[SEP] identifier[getScm] operator[SEP] operator[SEP] Keyword[instanceof] identifier[NullSCM] operator[SEP] operator[SEP] { identifier[template] operator[SEP] identifier[setScm] operator[SEP] Keyword[new] identifier[NullSCM] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[template] operator[SEP] identifier[disable] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , literal[String] operator[+] identifier[getTemplateDir] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
@Override public void close() { synchronized (cacheManagers) { for (Map.Entry<ClassLoader, ConcurrentMap<URI, Eh107CacheManager>> entry : cacheManagers.entrySet()) { for (Eh107CacheManager cacheManager : entry.getValue().values()) { cacheManager.close(); } } cacheManagers.clear(); } }
class class_name[name] begin[{] method[close, return_type[void], modifier[public], parameter[]] begin[{] SYNCHRONIZED[member[.cacheManagers]] BEGIN[{] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=cacheManager, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cacheManager)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Eh107CacheManager, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=cacheManagers, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ClassLoader, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Eh107CacheManager, sub_type=None))], dimensions=[], name=ConcurrentMap, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) call[cacheManagers.clear, parameter[]] END[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[cacheManagers] operator[SEP] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[ClassLoader] , identifier[ConcurrentMap] operator[<] identifier[URI] , identifier[Eh107CacheManager] operator[>] operator[>] identifier[entry] operator[:] identifier[cacheManagers] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Eh107CacheManager] identifier[cacheManager] operator[:] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[cacheManager] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } identifier[cacheManagers] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } }
@Override protected Map<String, Object> initializeVariables(final Set<StringTextValue<?>> allSettings) { final Map<String, Object> variables = super.initializeVariables(allSettings); variables.put(COMMAND, getCommand(getSettings())); return variables; }
class class_name[name] begin[{] method[initializeVariables, return_type[type[Map]], modifier[protected], parameter[allSettings]] begin[{] local_variable[type[Map], variables] call[variables.put, parameter[member[.COMMAND], call[.getCommand, parameter[call[.getSettings, parameter[]]]]]] return[member[.variables]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[initializeVariables] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[StringTextValue] operator[<] operator[?] operator[>] operator[>] identifier[allSettings] operator[SEP] { Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[variables] operator[=] Keyword[super] operator[SEP] identifier[initializeVariables] operator[SEP] identifier[allSettings] operator[SEP] operator[SEP] identifier[variables] operator[SEP] identifier[put] operator[SEP] identifier[COMMAND] , identifier[getCommand] operator[SEP] identifier[getSettings] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[variables] operator[SEP] }
public static boolean getBooleanValue(String primaryKey, String secondaryKey) { Object val = CFG.get(primaryKey); if (val == null) { val = CFG.get(secondaryKey); if (val == null) { throw new SofaRpcRuntimeException("Not found key: " + primaryKey + "/" + secondaryKey); } } return Boolean.valueOf(val.toString()); }
class class_name[name] begin[{] method[getBooleanValue, return_type[type[boolean]], modifier[public static], parameter[primaryKey, secondaryKey]] begin[{] local_variable[type[Object], val] if[binary_operation[member[.val], ==, literal[null]]] begin[{] assign[member[.val], call[CFG.get, parameter[member[.secondaryKey]]]] if[binary_operation[member[.val], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not found key: "), operandr=MemberReference(member=primaryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MemberReference(member=secondaryKey, 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=SofaRpcRuntimeException, sub_type=None)), label=None) else begin[{] None end[}] else begin[{] None end[}] return[call[Boolean.valueOf, parameter[call[val.toString, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[getBooleanValue] operator[SEP] identifier[String] identifier[primaryKey] , identifier[String] identifier[secondaryKey] operator[SEP] { identifier[Object] identifier[val] operator[=] identifier[CFG] operator[SEP] identifier[get] operator[SEP] identifier[primaryKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[val] operator[==] Other[null] operator[SEP] { identifier[val] operator[=] identifier[CFG] operator[SEP] identifier[get] operator[SEP] identifier[secondaryKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[val] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SofaRpcRuntimeException] operator[SEP] literal[String] operator[+] identifier[primaryKey] operator[+] literal[String] operator[+] identifier[secondaryKey] operator[SEP] operator[SEP] } } Keyword[return] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[val] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public void setBody(String body) { super.setBody(body); this.jsonValue = JsonValue.readFrom(body); }
class class_name[name] begin[{] method[setBody, return_type[void], modifier[public], parameter[body]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setBody, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) assign[THIS[member[None.jsonValue]], call[JsonValue.readFrom, parameter[member[.body]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setBody] operator[SEP] identifier[String] identifier[body] operator[SEP] { Keyword[super] operator[SEP] identifier[setBody] operator[SEP] identifier[body] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[jsonValue] operator[=] identifier[JsonValue] operator[SEP] identifier[readFrom] operator[SEP] identifier[body] operator[SEP] operator[SEP] }
public static HTML embedFlashObject (Panel container, String htmlString) { // Please note: the following is a work-around for an IE7 bug. If we create a Flash object // node *before* attaching it to the DOM tree, IE will silently fail to register // the Flash object's callback functions for access from JavaScript. To make this work, // create an empty node first, add it to the DOM tree, and then initialize it with // the Flash object definition. HTML element = new HTML(); container.add(element); element.setHTML(htmlString); return element; }
class class_name[name] begin[{] method[embedFlashObject, return_type[type[HTML]], modifier[public static], parameter[container, htmlString]] begin[{] local_variable[type[HTML], element] call[container.add, parameter[member[.element]]] call[element.setHTML, parameter[member[.htmlString]]] return[member[.element]] end[}] END[}]
Keyword[public] Keyword[static] identifier[HTML] identifier[embedFlashObject] operator[SEP] identifier[Panel] identifier[container] , identifier[String] identifier[htmlString] operator[SEP] { identifier[HTML] identifier[element] operator[=] Keyword[new] identifier[HTML] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[add] operator[SEP] identifier[element] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[setHTML] operator[SEP] identifier[htmlString] operator[SEP] operator[SEP] Keyword[return] identifier[element] operator[SEP] }
public static void copy(InputStream input, Writer output) throws IOException { copy(input, output, Const.DEFAULT_ENCODING); }
class class_name[name] begin[{] method[copy, return_type[void], modifier[public static], parameter[input, output]] begin[{] call[.copy, parameter[member[.input], member[.output], member[Const.DEFAULT_ENCODING]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[copy] operator[SEP] identifier[InputStream] identifier[input] , identifier[Writer] identifier[output] operator[SEP] Keyword[throws] identifier[IOException] { identifier[copy] operator[SEP] identifier[input] , identifier[output] , identifier[Const] operator[SEP] identifier[DEFAULT_ENCODING] operator[SEP] operator[SEP] }
public void setAwsRegions(java.util.Collection<String> awsRegions) { if (awsRegions == null) { this.awsRegions = null; return; } this.awsRegions = new com.amazonaws.internal.SdkInternalList<String>(awsRegions); }
class class_name[name] begin[{] method[setAwsRegions, return_type[void], modifier[public], parameter[awsRegions]] begin[{] if[binary_operation[member[.awsRegions], ==, literal[null]]] begin[{] assign[THIS[member[None.awsRegions]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.awsRegions]], ClassCreator(arguments=[MemberReference(member=awsRegions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setAwsRegions] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[awsRegions] operator[SEP] { Keyword[if] operator[SEP] identifier[awsRegions] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[awsRegions] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[awsRegions] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[awsRegions] operator[SEP] operator[SEP] }
public static GroovyObject parseGroovyScript(final Resource groovyScript, final boolean failOnError) { return AccessController.doPrivileged((PrivilegedAction<GroovyObject>) () -> { val parent = ScriptingUtils.class.getClassLoader(); try (val loader = new GroovyClassLoader(parent)) { val groovyFile = groovyScript.getFile(); if (groovyFile.exists()) { val groovyClass = loader.parseClass(groovyFile); LOGGER.trace("Creating groovy object instance from class [{}]", groovyFile.getCanonicalPath()); return (GroovyObject) groovyClass.getDeclaredConstructor().newInstance(); } LOGGER.trace("Groovy script at [{}] does not exist", groovyScript); } catch (final Exception e) { if (failOnError) { throw new RuntimeException(e); } LOGGER.error(e.getMessage(), e); } return null; }); }
class class_name[name] begin[{] method[parseGroovyScript, return_type[type[GroovyObject]], modifier[public static], parameter[groovyScript, failOnError]] begin[{] return[call[AccessController.doPrivileged, parameter[Cast(expression=LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ScriptingUtils, sub_type=None)), name=parent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=groovyScript, selectors=[], type_arguments=None), name=groovyFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=groovyFile, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=groovyFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseClass, postfix_operators=[], prefix_operators=[], qualifier=loader, selectors=[], type_arguments=None), name=groovyClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Creating groovy object instance from class [{}]"), MethodInvocation(arguments=[], member=getCanonicalPath, postfix_operators=[], prefix_operators=[], qualifier=groovyFile, selectors=[], type_arguments=None)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[], member=getDeclaredConstructor, postfix_operators=[], prefix_operators=[], qualifier=groovyClass, selectors=[MethodInvocation(arguments=[], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=GroovyObject, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Groovy script at [{}] does not exist"), MemberReference(member=groovyScript, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MemberReference(member=failOnError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=loader, type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=parent, 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=GroovyClassLoader, sub_type=None)))]), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], parameters=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=GroovyObject, sub_type=None))], dimensions=[], name=PrivilegedAction, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[GroovyObject] identifier[parseGroovyScript] operator[SEP] Keyword[final] identifier[Resource] identifier[groovyScript] , Keyword[final] Keyword[boolean] identifier[failOnError] operator[SEP] { Keyword[return] identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] operator[SEP] identifier[PrivilegedAction] operator[<] identifier[GroovyObject] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[->] { identifier[val] identifier[parent] operator[=] identifier[ScriptingUtils] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[val] identifier[loader] operator[=] Keyword[new] identifier[GroovyClassLoader] operator[SEP] identifier[parent] operator[SEP] operator[SEP] { identifier[val] identifier[groovyFile] operator[=] identifier[groovyScript] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[groovyFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[val] identifier[groovyClass] operator[=] identifier[loader] operator[SEP] identifier[parseClass] operator[SEP] identifier[groovyFile] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[groovyFile] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[GroovyObject] operator[SEP] identifier[groovyClass] operator[SEP] identifier[getDeclaredConstructor] operator[SEP] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] } identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[groovyScript] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[failOnError] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] } operator[SEP] operator[SEP] }
@VisibleForTesting public static void runMain(final String[] args) throws Exception { final CliHelpDefinition helpCli = new CliHelpDefinition(); try { Args.parse(helpCli, args); if (helpCli.help) { printUsage(0); return; } } catch (IllegalArgumentException invalidOption) { // Ignore because it is probably one of the non-help options. } final CliDefinition cli = new CliDefinition(); try { List<String> unusedArguments = Args.parse(cli, args); if (!unusedArguments.isEmpty()) { System.out.println("\n\nThe following arguments are not recognized: " + unusedArguments); printUsage(1); return; } } catch (IllegalArgumentException invalidOption) { System.out.println("\n\n" + invalidOption.getMessage()); printUsage(1); return; } configureLogs(cli.verbose); AbstractXmlApplicationContext context = new ClassPathXmlApplicationContext(DEFAULT_SPRING_CONTEXT); if (cli.springConfig != null) { context = new ClassPathXmlApplicationContext(DEFAULT_SPRING_CONTEXT, cli.springConfig); } try { context.getBean(Main.class).run(cli); } finally { context.close(); } }
class class_name[name] begin[{] method[runMain, return_type[void], modifier[public static], parameter[args]] begin[{] local_variable[type[CliHelpDefinition], helpCli] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=helpCli, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=Args, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=help, postfix_operators=[], prefix_operators=[], qualifier=helpCli, 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=0)], member=printUsage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=invalidOption, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None) local_variable[type[CliDefinition], cli] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=cli, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=Args, selectors=[], type_arguments=None), name=unusedArguments)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=unusedArguments, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n\nThe following arguments are not recognized: "), operandr=MemberReference(member=unusedArguments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=printUsage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n\n"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=invalidOption, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=printUsage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=invalidOption, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None) call[.configureLogs, parameter[member[cli.verbose]]] local_variable[type[AbstractXmlApplicationContext], context] if[binary_operation[member[cli.springConfig], !=, literal[null]]] begin[{] assign[member[.context], ClassCreator(arguments=[MemberReference(member=DEFAULT_SPRING_CONTEXT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=springConfig, postfix_operators=[], prefix_operators=[], qualifier=cli, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClassPathXmlApplicationContext, sub_type=None))] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Main, sub_type=None))], member=getBean, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[MemberReference(member=cli, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=run, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[VisibleForTesting] Keyword[public] Keyword[static] Keyword[void] identifier[runMain] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[final] identifier[CliHelpDefinition] identifier[helpCli] operator[=] Keyword[new] identifier[CliHelpDefinition] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Args] operator[SEP] identifier[parse] operator[SEP] identifier[helpCli] , identifier[args] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[helpCli] operator[SEP] identifier[help] operator[SEP] { identifier[printUsage] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[invalidOption] operator[SEP] { } Keyword[final] identifier[CliDefinition] identifier[cli] operator[=] Keyword[new] identifier[CliDefinition] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[List] operator[<] identifier[String] operator[>] identifier[unusedArguments] operator[=] identifier[Args] operator[SEP] identifier[parse] operator[SEP] identifier[cli] , identifier[args] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[unusedArguments] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[unusedArguments] operator[SEP] operator[SEP] identifier[printUsage] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[invalidOption] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[invalidOption] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[printUsage] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[configureLogs] operator[SEP] identifier[cli] operator[SEP] identifier[verbose] operator[SEP] operator[SEP] identifier[AbstractXmlApplicationContext] identifier[context] operator[=] Keyword[new] identifier[ClassPathXmlApplicationContext] operator[SEP] identifier[DEFAULT_SPRING_CONTEXT] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cli] operator[SEP] identifier[springConfig] operator[!=] Other[null] operator[SEP] { identifier[context] operator[=] Keyword[new] identifier[ClassPathXmlApplicationContext] operator[SEP] identifier[DEFAULT_SPRING_CONTEXT] , identifier[cli] operator[SEP] identifier[springConfig] operator[SEP] operator[SEP] } Keyword[try] { identifier[context] operator[SEP] identifier[getBean] operator[SEP] identifier[Main] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[run] operator[SEP] identifier[cli] operator[SEP] operator[SEP] } Keyword[finally] { identifier[context] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } }
@ShellMethod(key = "jasypt-list-algorithms", value = "List alogrithms you can use with Jasypt for property encryption") public void listAlgorithms(@ShellOption(value = {"includeBC"}, help = "Include Bouncy Castle provider") final boolean includeBC) { if (includeBC) { if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) { Security.addProvider(new BouncyCastleProvider()); } } else { Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME); } val providers = Security.getProviders(); LOGGER.info("Loaded providers: "); for (val provider : providers) { LOGGER.info("Provider: [{}] [{}]", provider.getName(), provider.getClass().getName()); } val pbeAlgos = AlgorithmRegistry.getAllPBEAlgorithms(); LOGGER.info("==== JASYPT Password Based Encryption Algorithms ====\n"); for (val pbeAlgo : pbeAlgos) { LOGGER.info(pbeAlgo.toString()); } }
class class_name[name] begin[{] method[listAlgorithms, return_type[void], modifier[public], parameter[includeBC]] begin[{] if[member[.includeBC]] begin[{] if[binary_operation[call[Security.getProvider, parameter[member[BouncyCastleProvider.PROVIDER_NAME]]], ==, literal[null]]] begin[{] call[Security.addProvider, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BouncyCastleProvider, sub_type=None))]] else begin[{] None end[}] else begin[{] call[Security.removeProvider, parameter[member[BouncyCastleProvider.PROVIDER_NAME]]] end[}] local_variable[type[val], providers] call[LOGGER.info, parameter[literal["Loaded providers: "]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Provider: [{}] [{}]"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=provider, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=provider, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=providers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=provider)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None))), label=None) local_variable[type[val], pbeAlgos] call[LOGGER.info, parameter[literal["==== JASYPT Password Based Encryption Algorithms ====\n"]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=pbeAlgo, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=pbeAlgos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pbeAlgo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[ShellMethod] operator[SEP] identifier[key] operator[=] literal[String] , identifier[value] operator[=] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[listAlgorithms] operator[SEP] annotation[@] identifier[ShellOption] operator[SEP] identifier[value] operator[=] { literal[String] } , identifier[help] operator[=] literal[String] operator[SEP] Keyword[final] Keyword[boolean] identifier[includeBC] operator[SEP] { Keyword[if] operator[SEP] identifier[includeBC] operator[SEP] { Keyword[if] operator[SEP] identifier[Security] operator[SEP] identifier[getProvider] operator[SEP] identifier[BouncyCastleProvider] operator[SEP] identifier[PROVIDER_NAME] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[Security] operator[SEP] identifier[addProvider] operator[SEP] Keyword[new] identifier[BouncyCastleProvider] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[Security] operator[SEP] identifier[removeProvider] operator[SEP] identifier[BouncyCastleProvider] operator[SEP] identifier[PROVIDER_NAME] operator[SEP] operator[SEP] } identifier[val] identifier[providers] operator[=] identifier[Security] operator[SEP] identifier[getProviders] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[val] identifier[provider] operator[:] identifier[providers] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[provider] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[provider] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[val] identifier[pbeAlgos] operator[=] identifier[AlgorithmRegistry] operator[SEP] identifier[getAllPBEAlgorithms] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[val] identifier[pbeAlgo] operator[:] identifier[pbeAlgos] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] identifier[pbeAlgo] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public static void execute(RunnableWithException task, Consumer<Throwable> exceptionHandler, Runnable runFinally, Executor executor) { Preconditions.checkNotNull(task, "task"); Preconditions.checkNotNull(exceptionHandler, "exceptionHandler"); Preconditions.checkNotNull(runFinally, "runFinally"); boolean scheduledSuccess = false; try { executor.execute(() -> { try { task.run(); } catch (Throwable ex) { if (!Exceptions.mustRethrow(ex)) { // Invoke the exception handler, but there's no point in rethrowing the exception, as it will simply // be ignored by the executor. exceptionHandler.accept(ex); } } finally { runFinally.run(); } }); scheduledSuccess = true; } finally { // Invoke the finally callback in case we were not able to successfully schedule the task. if (!scheduledSuccess) { runFinally.run(); } } }
class class_name[name] begin[{] method[execute, return_type[void], modifier[public static], parameter[task, exceptionHandler, runFinally, executor]] begin[{] call[Preconditions.checkNotNull, parameter[member[.task], literal["task"]]] call[Preconditions.checkNotNull, parameter[member[.exceptionHandler], literal["exceptionHandler"]]] call[Preconditions.checkNotNull, parameter[member[.runFinally], literal["runFinally"]]] local_variable[type[boolean], scheduledSuccess] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[LambdaExpression(body=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=task, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mustRethrow, postfix_operators=[], prefix_operators=['!'], qualifier=Exceptions, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=exceptionHandler, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Throwable']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=runFinally, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], parameters=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=executor, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=scheduledSuccess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=None, finally_block=[IfStatement(condition=MemberReference(member=scheduledSuccess, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=runFinally, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[execute] operator[SEP] identifier[RunnableWithException] identifier[task] , identifier[Consumer] operator[<] identifier[Throwable] operator[>] identifier[exceptionHandler] , identifier[Runnable] identifier[runFinally] , identifier[Executor] identifier[executor] operator[SEP] { identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[task] , literal[String] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[exceptionHandler] , literal[String] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[runFinally] , literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[scheduledSuccess] operator[=] literal[boolean] operator[SEP] Keyword[try] { identifier[executor] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] operator[->] { Keyword[try] { identifier[task] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[ex] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[Exceptions] operator[SEP] identifier[mustRethrow] operator[SEP] identifier[ex] operator[SEP] operator[SEP] { identifier[exceptionHandler] operator[SEP] identifier[accept] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[runFinally] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[scheduledSuccess] operator[=] literal[boolean] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] operator[!] identifier[scheduledSuccess] operator[SEP] { identifier[runFinally] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } } }
public Generic onTypeVariable(Generic typeVariable) { return declaringType.isGenerified() ? new Generic.OfNonGenericType.Latent(typeVariable.asErasure(), typeVariable) : typeVariable; }
class class_name[name] begin[{] method[onTypeVariable, return_type[type[Generic]], modifier[public], parameter[typeVariable]] begin[{] return[TernaryExpression(condition=MethodInvocation(arguments=[], member=isGenerified, postfix_operators=[], prefix_operators=[], qualifier=declaringType, selectors=[], type_arguments=None), if_false=MemberReference(member=typeVariable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=ClassCreator(arguments=[MethodInvocation(arguments=[], member=asErasure, postfix_operators=[], prefix_operators=[], qualifier=typeVariable, selectors=[], type_arguments=None), MemberReference(member=typeVariable, 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=Generic, sub_type=ReferenceType(arguments=None, dimensions=None, name=OfNonGenericType, sub_type=ReferenceType(arguments=None, dimensions=None, name=Latent, sub_type=None)))))] end[}] END[}]
Keyword[public] identifier[Generic] identifier[onTypeVariable] operator[SEP] identifier[Generic] identifier[typeVariable] operator[SEP] { Keyword[return] identifier[declaringType] operator[SEP] identifier[isGenerified] operator[SEP] operator[SEP] operator[?] Keyword[new] identifier[Generic] operator[SEP] identifier[OfNonGenericType] operator[SEP] identifier[Latent] operator[SEP] identifier[typeVariable] operator[SEP] identifier[asErasure] operator[SEP] operator[SEP] , identifier[typeVariable] operator[SEP] operator[:] identifier[typeVariable] operator[SEP] }
public static Method getFunction(String functionName) { Method method = FUNCTION_MAP.get(functionName); if (method != null) { return method; } String nameLower = functionName.toLowerCase(Locale.US); if (nameLower == functionName) { // Input name was in lower case, the function is not there return null; } method = FUNCTION_MAP.get(nameLower); if (method != null && FUNCTION_MAP.size() < 1000) { // Avoid OutOfMemoryError in case input function names are randomized // The number of methods is finite, however the number of upper-lower case combinations // is quite a few (e.g. substr, Substr, sUbstr, SUbstr, etc). FUNCTION_MAP.putIfAbsent(functionName, method); } return method; }
class class_name[name] begin[{] method[getFunction, return_type[type[Method]], modifier[public static], parameter[functionName]] begin[{] local_variable[type[Method], method] if[binary_operation[member[.method], !=, literal[null]]] begin[{] return[member[.method]] else begin[{] None end[}] local_variable[type[String], nameLower] if[binary_operation[member[.nameLower], ==, member[.functionName]]] begin[{] return[literal[null]] else begin[{] None end[}] assign[member[.method], call[FUNCTION_MAP.get, parameter[member[.nameLower]]]] if[binary_operation[binary_operation[member[.method], !=, literal[null]], &&, binary_operation[call[FUNCTION_MAP.size, parameter[]], <, literal[1000]]]] begin[{] call[FUNCTION_MAP.putIfAbsent, parameter[member[.functionName], member[.method]]] else begin[{] None end[}] return[member[.method]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Method] identifier[getFunction] operator[SEP] identifier[String] identifier[functionName] operator[SEP] { identifier[Method] identifier[method] operator[=] identifier[FUNCTION_MAP] operator[SEP] identifier[get] operator[SEP] identifier[functionName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[method] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[method] operator[SEP] } identifier[String] identifier[nameLower] operator[=] identifier[functionName] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[Locale] operator[SEP] identifier[US] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nameLower] operator[==] identifier[functionName] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[method] operator[=] identifier[FUNCTION_MAP] operator[SEP] identifier[get] operator[SEP] identifier[nameLower] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[method] operator[!=] Other[null] operator[&&] identifier[FUNCTION_MAP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[1000] operator[SEP] { identifier[FUNCTION_MAP] operator[SEP] identifier[putIfAbsent] operator[SEP] identifier[functionName] , identifier[method] operator[SEP] operator[SEP] } Keyword[return] identifier[method] operator[SEP] }
public List<? extends TypeMirror> getBounds(TypeParameterElement tpe) { List<? extends TypeMirror> bounds = tpe.getBounds(); if (!bounds.isEmpty()) { TypeMirror upperBound = bounds.get(bounds.size() - 1); if (ignoreBounds(upperBound)) { return Collections.emptyList(); } } return bounds; }
class class_name[name] begin[{] method[getBounds, return_type[type[List]], modifier[public], parameter[tpe]] begin[{] local_variable[type[List], bounds] if[call[bounds.isEmpty, parameter[]]] begin[{] local_variable[type[TypeMirror], upperBound] if[call[.ignoreBounds, parameter[member[.upperBound]]]] begin[{] return[call[Collections.emptyList, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.bounds]] end[}] END[}]
Keyword[public] identifier[List] operator[<] operator[?] Keyword[extends] identifier[TypeMirror] operator[>] identifier[getBounds] operator[SEP] identifier[TypeParameterElement] identifier[tpe] operator[SEP] { identifier[List] operator[<] operator[?] Keyword[extends] identifier[TypeMirror] operator[>] identifier[bounds] operator[=] identifier[tpe] operator[SEP] identifier[getBounds] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[bounds] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[TypeMirror] identifier[upperBound] operator[=] identifier[bounds] operator[SEP] identifier[get] operator[SEP] identifier[bounds] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ignoreBounds] operator[SEP] identifier[upperBound] operator[SEP] operator[SEP] { Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[bounds] operator[SEP] }
@Override protected void prepareQueries() throws SQLException { super.prepareQueries(); FIND_NODES_AND_PROPERTIES = "select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION, P.P_TYPE, P.P_MULTIVALUED," + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from " + JCR_VALUE + " V, " + JCR_ITEM + " P" + " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM from " + JCR_ITEM + " I" + " where I.I_CLASS=1 AND I.ID > ? order by I.ID FETCH FIRST $rowNb ROWS ONLY) J on P.PARENT_ID = J.ID" + " where P.I_CLASS=2 and V.PROPERTY_ID=P.ID order by J.ID"; if (containerConfig.useSequenceForOrderNumber) { FIND_LAST_ORDER_NUMBER = "SELECT " + JCR_ITEM_NEXT_VAL + " ('" + JCR_ITEM_SEQ + "', ?, ?) FROM SYSIBM.SYSDUMMY1"; FIND_NODES_BY_PARENTID_LAZILY_CQ = "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA from " + JCR_VALUE +" V, "+JCR_ITEM +" P " + " join (select J.* from "+JCR_ITEM +" J where J.I_CLASS=1 and J.PARENT_ID=?" + " AND J.N_ORDER_NUM >= ? order by J.N_ORDER_NUM, J.ID FETCH FIRST $rowNb ROWS ONLY) I on P.PARENT_ID = I.ID" + " where P.I_CLASS=2 and P.PARENT_ID=I.ID and" + " (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or" + " P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or" + " P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or" + " P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions')" + " and V.PROPERTY_ID=P.ID order by I.N_ORDER_NUM, I.ID"; } }
class class_name[name] begin[{] method[prepareQueries, return_type[void], modifier[protected], parameter[]] begin[{] SuperMethodInvocation(arguments=[], member=prepareQueries, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) assign[member[.FIND_NODES_AND_PROPERTIES], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION, P.P_TYPE, P.P_MULTIVALUED,"], +, literal[" V.DATA, V.ORDER_NUM, V.STORAGE_DESC from "]], +, member[.JCR_VALUE]], +, literal[" V, "]], +, member[.JCR_ITEM]], +, literal[" P"]], +, literal[" join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM from "]], +, member[.JCR_ITEM]], +, literal[" I"]], +, literal[" where I.I_CLASS=1 AND I.ID > ? order by I.ID FETCH FIRST $rowNb ROWS ONLY) J on P.PARENT_ID = J.ID"]], +, literal[" where P.I_CLASS=2 and V.PROPERTY_ID=P.ID order by J.ID"]]] if[member[containerConfig.useSequenceForOrderNumber]] begin[{] assign[member[.FIND_LAST_ORDER_NUMBER], binary_operation[binary_operation[binary_operation[binary_operation[literal["SELECT "], +, member[.JCR_ITEM_NEXT_VAL]], +, literal[" ('"]], +, member[.JCR_ITEM_SEQ]], +, literal["', ?, ?) FROM SYSIBM.SYSDUMMY1"]]] assign[member[.FIND_NODES_BY_PARENTID_LAZILY_CQ], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA from "], +, member[.JCR_VALUE]], +, literal[" V, "]], +, member[.JCR_ITEM]], +, literal[" P "]], +, literal[" join (select J.* from "]], +, member[.JCR_ITEM]], +, literal[" J where J.I_CLASS=1 and J.PARENT_ID=?"]], +, literal[" AND J.N_ORDER_NUM >= ? order by J.N_ORDER_NUM, J.ID FETCH FIRST $rowNb ROWS ONLY) I on P.PARENT_ID = I.ID"]], +, literal[" where P.I_CLASS=2 and P.PARENT_ID=I.ID and"]], +, literal[" (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or"]], +, literal[" P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or"]], +, literal[" P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or"]], +, literal[" P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions')"]], +, literal[" and V.PROPERTY_ID=P.ID order by I.N_ORDER_NUM, I.ID"]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[prepareQueries] operator[SEP] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[super] operator[SEP] identifier[prepareQueries] operator[SEP] operator[SEP] operator[SEP] identifier[FIND_NODES_AND_PROPERTIES] operator[=] literal[String] operator[+] literal[String] operator[+] identifier[JCR_VALUE] operator[+] literal[String] operator[+] identifier[JCR_ITEM] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[JCR_ITEM] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[containerConfig] operator[SEP] identifier[useSequenceForOrderNumber] operator[SEP] { identifier[FIND_LAST_ORDER_NUMBER] operator[=] literal[String] operator[+] identifier[JCR_ITEM_NEXT_VAL] operator[+] literal[String] operator[+] identifier[JCR_ITEM_SEQ] operator[+] literal[String] operator[SEP] identifier[FIND_NODES_BY_PARENTID_LAZILY_CQ] operator[=] literal[String] operator[+] identifier[JCR_VALUE] operator[+] literal[String] operator[+] identifier[JCR_ITEM] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[JCR_ITEM] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] } }
public Matrix4f orthoSymmetricLH(float width, float height, float zNear, float zFar, Matrix4f dest) { return orthoSymmetricLH(width, height, zNear, zFar, false, dest); }
class class_name[name] begin[{] method[orthoSymmetricLH, return_type[type[Matrix4f]], modifier[public], parameter[width, height, zNear, zFar, dest]] begin[{] return[call[.orthoSymmetricLH, parameter[member[.width], member[.height], member[.zNear], member[.zFar], literal[false], member[.dest]]]] end[}] END[}]
Keyword[public] identifier[Matrix4f] identifier[orthoSymmetricLH] operator[SEP] Keyword[float] identifier[width] , Keyword[float] identifier[height] , Keyword[float] identifier[zNear] , Keyword[float] identifier[zFar] , identifier[Matrix4f] identifier[dest] operator[SEP] { Keyword[return] identifier[orthoSymmetricLH] operator[SEP] identifier[width] , identifier[height] , identifier[zNear] , identifier[zFar] , literal[boolean] , identifier[dest] operator[SEP] operator[SEP] }
public String getQueryString(TableSchema tableSchema, Phase phase) throws Exception { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); boolean first = true; for(String fieldName : fieldNames) { if( first ) { pw.print("least(coalesce(nullif(position(lower(?) IN lower("); first = false; } else { pw.print(")),0),9999),coalesce(nullif(position(lower(?) IN lower("); } pw.print(fieldName); } pw.print(")),0),9999))"); if( Phase.SELECT == phase ) { pw.print(" AS score"); } pw.flush(); return sw.toString(); }
class class_name[name] begin[{] method[getQueryString, return_type[type[String]], modifier[public], parameter[tableSchema, phase]] begin[{] local_variable[type[StringWriter], sw] local_variable[type[PrintWriter], pw] local_variable[type[boolean], first] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")),0),9999),coalesce(nullif(position(lower(?) IN lower(")], member=print, postfix_operators=[], prefix_operators=[], qualifier=pw, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="least(coalesce(nullif(position(lower(?) IN lower(")], member=print, postfix_operators=[], prefix_operators=[], qualifier=pw, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=pw, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=fieldNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fieldName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[pw.print, parameter[literal[")),0),9999))"]]] if[binary_operation[member[Phase.SELECT], ==, member[.phase]]] begin[{] call[pw.print, parameter[literal[" AS score"]]] else begin[{] None end[}] call[pw.flush, parameter[]] return[call[sw.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getQueryString] operator[SEP] identifier[TableSchema] identifier[tableSchema] , identifier[Phase] identifier[phase] operator[SEP] Keyword[throws] identifier[Exception] { identifier[StringWriter] identifier[sw] operator[=] Keyword[new] identifier[StringWriter] operator[SEP] operator[SEP] operator[SEP] identifier[PrintWriter] identifier[pw] operator[=] Keyword[new] identifier[PrintWriter] operator[SEP] identifier[sw] operator[SEP] operator[SEP] Keyword[boolean] identifier[first] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[fieldName] operator[:] identifier[fieldNames] operator[SEP] { Keyword[if] operator[SEP] identifier[first] operator[SEP] { identifier[pw] operator[SEP] identifier[print] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[first] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[pw] operator[SEP] identifier[print] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[pw] operator[SEP] identifier[print] operator[SEP] identifier[fieldName] operator[SEP] operator[SEP] } identifier[pw] operator[SEP] identifier[print] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Phase] operator[SEP] identifier[SELECT] operator[==] identifier[phase] operator[SEP] { identifier[pw] operator[SEP] identifier[print] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[pw] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[sw] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
@Override public void start(PrintStream writer, String[] params) { parse(params); out = writer; // Create a new belief set about neighbours BeliefSetField[] fields = {new BeliefSetField("name", String.class, true),}; try { // Attach this belief set to this agent this.createBeliefSet(beliefset, fields); int numAgents = GlobalState.agents.size(); // Cannot have more neighbours than agents if (neighbourhood >= numAgents) { Log.error("Agent " + getName() + " cannot add " + neighbourhood + " neighbours, when there are only " + numAgents + " agents all up"); System.exit(-1); } // Add beliefs about neighbours for (int i = 1; i <= neighbourhood; i++) { int neighbour = (getId() + i) % numAgents; this.addBelief(beliefset, Integer.toString(neighbour)); Log.debug("Agent " + getName() + " added neighbour " + neighbour); } Log.debug("Agent " + getName() + " is initialising with neighbourhood size of " + neighbourhood + " on each side (so " + (neighbourhood * 2) + " neighbours)"); // Let Agent 0 start the token passing if (getId() == 0) { Log.debug("round 1"); Token3 token = new Token3(1, 1); token.setHops(1); send(1, token); } } catch (BeliefBaseException e) { Log.error(e.getMessage()); } }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[writer, params]] begin[{] call[.parse, parameter[member[.params]]] assign[member[.out], member[.writer]] local_variable[type[BeliefSetField], fields] TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=beliefset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createBeliefSet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=GlobalState.agents, selectors=[], type_arguments=None), name=numAgents)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=neighbourhood, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numAgents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Agent "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" cannot add "), operator=+), operandr=MemberReference(member=neighbourhood, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" neighbours, when there are only "), operator=+), operandr=MemberReference(member=numAgents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" agents all up"), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=exit, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=numAgents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%), name=neighbour)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=beliefset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=neighbour, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=addBelief, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Agent "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" added neighbour "), operator=+), operandr=MemberReference(member=neighbour, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=neighbourhood, 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), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Agent "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is initialising with neighbourhood size of "), operator=+), operandr=MemberReference(member=neighbourhood, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" on each side (so "), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=neighbourhood, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" neighbours)"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=, 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="round 1")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Token3, sub_type=None)), name=token)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Token3, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=setHops, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=send, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['BeliefBaseException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[start] operator[SEP] identifier[PrintStream] identifier[writer] , identifier[String] operator[SEP] operator[SEP] identifier[params] operator[SEP] { identifier[parse] operator[SEP] identifier[params] operator[SEP] operator[SEP] identifier[out] operator[=] identifier[writer] operator[SEP] identifier[BeliefSetField] operator[SEP] operator[SEP] identifier[fields] operator[=] { Keyword[new] identifier[BeliefSetField] operator[SEP] literal[String] , identifier[String] operator[SEP] Keyword[class] , literal[boolean] operator[SEP] , } operator[SEP] Keyword[try] { Keyword[this] operator[SEP] identifier[createBeliefSet] operator[SEP] identifier[beliefset] , identifier[fields] operator[SEP] operator[SEP] Keyword[int] identifier[numAgents] operator[=] identifier[GlobalState] operator[SEP] identifier[agents] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[neighbourhood] operator[>=] identifier[numAgents] operator[SEP] { identifier[Log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[neighbourhood] operator[+] literal[String] operator[+] identifier[numAgents] operator[+] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<=] identifier[neighbourhood] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[neighbour] operator[=] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] identifier[i] operator[SEP] operator[%] identifier[numAgents] operator[SEP] Keyword[this] operator[SEP] identifier[addBelief] operator[SEP] identifier[beliefset] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[neighbour] operator[SEP] operator[SEP] operator[SEP] identifier[Log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[neighbour] operator[SEP] operator[SEP] } identifier[Log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[neighbourhood] operator[+] literal[String] operator[+] operator[SEP] identifier[neighbourhood] operator[*] Other[2] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[Log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Token3] identifier[token] operator[=] Keyword[new] identifier[Token3] operator[SEP] Other[1] , Other[1] operator[SEP] operator[SEP] identifier[token] operator[SEP] identifier[setHops] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[send] operator[SEP] Other[1] , identifier[token] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[BeliefBaseException] identifier[e] operator[SEP] { identifier[Log] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public static double meanDiffSq(GrayF32 imgA, GrayF32 imgB ) { InputSanityCheck.checkSameShape(imgA,imgB); if(BoofConcurrency.USE_CONCURRENT) { return ImplImageStatistics_MT.meanDiffSq(imgA.data,imgA.startIndex,imgA.stride, imgB.data,imgB.startIndex,imgB.stride,imgA.height, imgA.width); } else { return ImplImageStatistics.meanDiffSq(imgA.data,imgA.startIndex,imgA.stride, imgB.data,imgB.startIndex,imgB.stride,imgA.height, imgA.width); } }
class class_name[name] begin[{] method[meanDiffSq, return_type[type[double]], modifier[public static], parameter[imgA, imgB]] begin[{] call[InputSanityCheck.checkSameShape, parameter[member[.imgA], member[.imgB]]] if[member[BoofConcurrency.USE_CONCURRENT]] begin[{] return[call[ImplImageStatistics_MT.meanDiffSq, parameter[member[imgA.data], member[imgA.startIndex], member[imgA.stride], member[imgB.data], member[imgB.startIndex], member[imgB.stride], member[imgA.height], member[imgA.width]]]] else begin[{] return[call[ImplImageStatistics.meanDiffSq, parameter[member[imgA.data], member[imgA.startIndex], member[imgA.stride], member[imgB.data], member[imgB.startIndex], member[imgB.stride], member[imgA.height], member[imgA.width]]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[meanDiffSq] operator[SEP] identifier[GrayF32] identifier[imgA] , identifier[GrayF32] identifier[imgB] operator[SEP] { identifier[InputSanityCheck] operator[SEP] identifier[checkSameShape] operator[SEP] identifier[imgA] , identifier[imgB] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[BoofConcurrency] operator[SEP] identifier[USE_CONCURRENT] operator[SEP] { Keyword[return] identifier[ImplImageStatistics_MT] operator[SEP] identifier[meanDiffSq] operator[SEP] identifier[imgA] operator[SEP] identifier[data] , identifier[imgA] operator[SEP] identifier[startIndex] , identifier[imgA] operator[SEP] identifier[stride] , identifier[imgB] operator[SEP] identifier[data] , identifier[imgB] operator[SEP] identifier[startIndex] , identifier[imgB] operator[SEP] identifier[stride] , identifier[imgA] operator[SEP] identifier[height] , identifier[imgA] operator[SEP] identifier[width] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[ImplImageStatistics] operator[SEP] identifier[meanDiffSq] operator[SEP] identifier[imgA] operator[SEP] identifier[data] , identifier[imgA] operator[SEP] identifier[startIndex] , identifier[imgA] operator[SEP] identifier[stride] , identifier[imgB] operator[SEP] identifier[data] , identifier[imgB] operator[SEP] identifier[startIndex] , identifier[imgB] operator[SEP] identifier[stride] , identifier[imgA] operator[SEP] identifier[height] , identifier[imgA] operator[SEP] identifier[width] operator[SEP] operator[SEP] } }
public Campaign readFile(String fileName) throws Exception { Campaign result = new Campaign(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(fileName); doc.getDocumentElement().normalize(); Element el = doc.getDocumentElement(); if (!el.getNodeName().equals("campaign")) { throw new Exception(fileName + " is not a valid xml campain file"); } result.name = el.getAttributeNode("name").getValue(); NodeList nodeLst = doc.getElementsByTagName("run"); for (int s = 0; s < nodeLst.getLength(); s++) { Node node = nodeLst.item(s); if (node.getNodeType() == Node.ELEMENT_NODE) { Element element = (Element) node; CampaignRun run = new CampaignRun(); run.testbed = element.getAttribute("testbed"); result.runs.add(run); NodeList nodeList = element.getElementsByTagName("testsuite"); for (int t = 0; t < nodeList.getLength(); t++) { TestSuiteParams params = new TestSuiteParams(); run.testsuites.add(params); params.setDirectory(nodeList.item(t).getAttributes().getNamedItem("directory").getNodeValue()); NodeList childList = nodeList.item(t).getChildNodes(); for (int c = 0; c < childList.getLength(); c++) { Node childNode = childList.item(c); if (childNode.getNodeName().equals("testdata")) { String selectorStr = childNode.getAttributes().getNamedItem("selector").getNodeValue(); String[] selectedRowsStr = selectorStr.split(","); TreeSet<Integer> selectedRows = new TreeSet<>(); for (String selectedRowStr : selectedRowsStr) { selectedRows.add(Integer.parseInt(selectedRowStr)); } params.setDataRows(selectedRows); } if (childList.item(c).getNodeName().equals("loopInHours")) { params.setLoopInHours(true); } if (childList.item(c).getNodeName().equals("count")) { try { params.setCount(Integer.parseInt(childList.item(c).getTextContent())); } catch (NumberFormatException e) { logger.error("count field in " + fileName + " file should be numeric"); } } } } } } return result; }
class class_name[name] begin[{] method[readFile, return_type[type[Campaign]], modifier[public], parameter[fileName]] begin[{] local_variable[type[Campaign], result] local_variable[type[DocumentBuilderFactory], dbf] local_variable[type[DocumentBuilder], db] local_variable[type[Document], doc] call[doc.getDocumentElement, parameter[]] local_variable[type[Element], el] if[call[el.getNodeName, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not a valid xml campain file"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None) else begin[{] None end[}] assign[member[result.name], call[el.getAttributeNode, parameter[literal["name"]]]] local_variable[type[NodeList], nodeLst] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=nodeLst, selectors=[], type_arguments=None), name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNodeType, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), operandr=MemberReference(member=ELEMENT_NODE, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), name=element)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CampaignRun, sub_type=None)), name=run)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CampaignRun, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=testbed, postfix_operators=[], prefix_operators=[], qualifier=run, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="testbed")], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=run, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result.runs, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="testsuite")], member=getElementsByTagName, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), name=nodeList)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NodeList, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TestSuiteParams, sub_type=None)), name=params)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TestSuiteParams, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=run.testsuites, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=nodeList, selectors=[MethodInvocation(arguments=[], member=getAttributes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="directory")], member=getNamedItem, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getNodeValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setDirectory, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=nodeList, selectors=[MethodInvocation(arguments=[], member=getChildNodes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=childList)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NodeList, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=childList, selectors=[], type_arguments=None), name=childNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getNodeName, postfix_operators=[], prefix_operators=[], qualifier=childNode, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="testdata")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=childNode, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="selector")], member=getNamedItem, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getNodeValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=selectorStr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=split, postfix_operators=[], prefix_operators=[], qualifier=selectorStr, selectors=[], type_arguments=None), name=selectedRowsStr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, 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=TreeSet, sub_type=None)), name=selectedRows)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=TreeSet, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=selectedRowStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=selectedRows, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=selectedRowsStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=selectedRowStr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=selectedRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDataRows, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=childList, selectors=[MethodInvocation(arguments=[], member=getNodeName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="loopInHours")], 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=true)], member=setLoopInHours, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=childList, selectors=[MethodInvocation(arguments=[], member=getNodeName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="count")], 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=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=childList, selectors=[MethodInvocation(arguments=[], member=getTextContent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=setCount, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="count field in "), operandr=MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" file should be numeric"), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=childList, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=c, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=nodeList, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=t)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=t, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=nodeLst, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=s)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=s, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.result]] end[}] END[}]
Keyword[public] identifier[Campaign] identifier[readFile] operator[SEP] identifier[String] identifier[fileName] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Campaign] identifier[result] operator[=] Keyword[new] identifier[Campaign] operator[SEP] operator[SEP] operator[SEP] identifier[DocumentBuilderFactory] identifier[dbf] operator[=] identifier[DocumentBuilderFactory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[DocumentBuilder] identifier[db] operator[=] identifier[dbf] operator[SEP] identifier[newDocumentBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[Document] identifier[doc] operator[=] identifier[db] operator[SEP] identifier[parse] operator[SEP] identifier[fileName] operator[SEP] operator[SEP] identifier[doc] operator[SEP] identifier[getDocumentElement] operator[SEP] operator[SEP] operator[SEP] identifier[normalize] operator[SEP] operator[SEP] operator[SEP] identifier[Element] identifier[el] operator[=] identifier[doc] operator[SEP] identifier[getDocumentElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[el] operator[SEP] identifier[getNodeName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] identifier[fileName] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[name] operator[=] identifier[el] operator[SEP] identifier[getAttributeNode] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[NodeList] identifier[nodeLst] operator[=] identifier[doc] operator[SEP] identifier[getElementsByTagName] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[s] operator[=] Other[0] operator[SEP] identifier[s] operator[<] identifier[nodeLst] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[s] operator[++] operator[SEP] { identifier[Node] identifier[node] operator[=] identifier[nodeLst] operator[SEP] identifier[item] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[ELEMENT_NODE] operator[SEP] { identifier[Element] identifier[element] operator[=] operator[SEP] identifier[Element] operator[SEP] identifier[node] operator[SEP] identifier[CampaignRun] identifier[run] operator[=] Keyword[new] identifier[CampaignRun] operator[SEP] operator[SEP] operator[SEP] identifier[run] operator[SEP] identifier[testbed] operator[=] identifier[element] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[runs] operator[SEP] identifier[add] operator[SEP] identifier[run] operator[SEP] operator[SEP] identifier[NodeList] identifier[nodeList] operator[=] identifier[element] operator[SEP] identifier[getElementsByTagName] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[t] operator[=] Other[0] operator[SEP] identifier[t] operator[<] identifier[nodeList] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[t] operator[++] operator[SEP] { identifier[TestSuiteParams] identifier[params] operator[=] Keyword[new] identifier[TestSuiteParams] operator[SEP] operator[SEP] operator[SEP] identifier[run] operator[SEP] identifier[testsuites] operator[SEP] identifier[add] operator[SEP] identifier[params] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[setDirectory] operator[SEP] identifier[nodeList] operator[SEP] identifier[item] operator[SEP] identifier[t] operator[SEP] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[getNamedItem] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getNodeValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[NodeList] identifier[childList] operator[=] identifier[nodeList] operator[SEP] identifier[item] operator[SEP] identifier[t] operator[SEP] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] identifier[c] operator[<] identifier[childList] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[++] operator[SEP] { identifier[Node] identifier[childNode] operator[=] identifier[childList] operator[SEP] identifier[item] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[childNode] operator[SEP] identifier[getNodeName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] identifier[selectorStr] operator[=] identifier[childNode] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[getNamedItem] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getNodeValue] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[selectedRowsStr] operator[=] identifier[selectorStr] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[TreeSet] operator[<] identifier[Integer] operator[>] identifier[selectedRows] operator[=] Keyword[new] identifier[TreeSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[selectedRowStr] operator[:] identifier[selectedRowsStr] operator[SEP] { identifier[selectedRows] operator[SEP] identifier[add] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[selectedRowStr] operator[SEP] operator[SEP] operator[SEP] } identifier[params] operator[SEP] identifier[setDataRows] operator[SEP] identifier[selectedRows] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[childList] operator[SEP] identifier[item] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[getNodeName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[params] operator[SEP] identifier[setLoopInHours] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[childList] operator[SEP] identifier[item] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[getNodeName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[try] { identifier[params] operator[SEP] identifier[setCount] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[childList] operator[SEP] identifier[item] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[fileName] operator[+] literal[String] operator[SEP] operator[SEP] } } } } } } Keyword[return] identifier[result] operator[SEP] }
@Override public boolean applyAction(Model c) { Mapping map = c.getMapping(); return !map.isOffline(node) && map.addOfflineNode(node); }
class class_name[name] begin[{] method[applyAction, return_type[type[boolean]], modifier[public], parameter[c]] begin[{] local_variable[type[Mapping], map] return[binary_operation[call[map.isOffline, parameter[member[.node]]], &&, call[map.addOfflineNode, parameter[member[.node]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[applyAction] operator[SEP] identifier[Model] identifier[c] operator[SEP] { identifier[Mapping] identifier[map] operator[=] identifier[c] operator[SEP] identifier[getMapping] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[!] identifier[map] operator[SEP] identifier[isOffline] operator[SEP] identifier[node] operator[SEP] operator[&&] identifier[map] operator[SEP] identifier[addOfflineNode] operator[SEP] identifier[node] operator[SEP] operator[SEP] }
public void doubleSnapshotOccurred(HollowReadStateEngine newHollowStateEngine, long newVersion) { if(!keyIndex.isInitialized()) keyIndex.update(latestHollowReadStateEngine, false); keyIndex.update(newHollowStateEngine, false); HollowHistoricalStateDataAccess historicalDataAccess; DiffEqualityMapping mapping = new DiffEqualityMapping(latestHollowReadStateEngine, newHollowStateEngine, true, !ignoreListOrderingOnDoubleSnapshot); DiffEqualityMappingOrdinalRemapper remapper = new DiffEqualityMappingOrdinalRemapper(mapping); historicalDataAccess = creator.createHistoricalStateFromDoubleSnapshot(latestVersion, latestHollowReadStateEngine, newHollowStateEngine, remapper); HollowHistoricalStateDataAccess nextRemappedDataAccess = historicalDataAccess; HollowHistoricalState nextRemappedState = null; HollowHistoricalStateDataAccess[] remappedDataAccesses = new HollowHistoricalStateDataAccess[historicalStates.size()]; HollowHistoricalStateKeyOrdinalMapping[] remappedKeyOrdinalMappings = new HollowHistoricalStateKeyOrdinalMapping[historicalStates.size()]; remapHistoricalStateOrdinals(remapper, remappedDataAccesses, remappedKeyOrdinalMappings); for(int i=0;i<historicalStates.size();i++) { HollowHistoricalState historicalStateToRemap = historicalStates.get(i); HollowHistoricalStateDataAccess remappedDataAccess = remappedDataAccesses[i]; HollowHistoricalStateKeyOrdinalMapping remappedKeyOrdinalMapping = remappedKeyOrdinalMappings[i]; remappedDataAccess.setNextState(nextRemappedDataAccess); nextRemappedDataAccess = remappedDataAccess; HollowHistoricalState remappedState = new HollowHistoricalState(historicalStateToRemap.getVersion(), remappedKeyOrdinalMapping, remappedDataAccess, historicalStateToRemap.getHeaderEntries()); remappedState.setNextState(nextRemappedState); nextRemappedState = remappedState; historicalStates.set(i, remappedState); historicalStateLookupMap.put(remappedState.getVersion(), remappedState); } historicalDataAccess.setNextState(newHollowStateEngine); HollowHistoricalStateKeyOrdinalMapping keyOrdinalMapping = createKeyOrdinalMappingFromDoubleSnapshot(newHollowStateEngine, remapper); HollowHistoricalState historicalState = new HollowHistoricalState(newVersion, keyOrdinalMapping, historicalDataAccess, latestHeaderEntries); addHistoricalState(historicalState); this.latestVersion = newVersion; this.latestHollowReadStateEngine = newHollowStateEngine; this.latestHeaderEntries = latestHollowReadStateEngine.getHeaderTags(); }
class class_name[name] begin[{] method[doubleSnapshotOccurred, return_type[void], modifier[public], parameter[newHollowStateEngine, newVersion]] begin[{] if[call[keyIndex.isInitialized, parameter[]]] begin[{] call[keyIndex.update, parameter[member[.latestHollowReadStateEngine], literal[false]]] else begin[{] None end[}] call[keyIndex.update, parameter[member[.newHollowStateEngine], literal[false]]] local_variable[type[HollowHistoricalStateDataAccess], historicalDataAccess] local_variable[type[DiffEqualityMapping], mapping] local_variable[type[DiffEqualityMappingOrdinalRemapper], remapper] assign[member[.historicalDataAccess], call[creator.createHistoricalStateFromDoubleSnapshot, parameter[member[.latestVersion], member[.latestHollowReadStateEngine], member[.newHollowStateEngine], member[.remapper]]]] local_variable[type[HollowHistoricalStateDataAccess], nextRemappedDataAccess] local_variable[type[HollowHistoricalState], nextRemappedState] local_variable[type[HollowHistoricalStateDataAccess], remappedDataAccesses] local_variable[type[HollowHistoricalStateKeyOrdinalMapping], remappedKeyOrdinalMappings] call[.remapHistoricalStateOrdinals, parameter[member[.remapper], member[.remappedDataAccesses], member[.remappedKeyOrdinalMappings]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=historicalStates, selectors=[], type_arguments=None), name=historicalStateToRemap)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HollowHistoricalState, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=remappedDataAccesses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=remappedDataAccess)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HollowHistoricalStateDataAccess, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=remappedKeyOrdinalMappings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=remappedKeyOrdinalMapping)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HollowHistoricalStateKeyOrdinalMapping, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nextRemappedDataAccess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setNextState, postfix_operators=[], prefix_operators=[], qualifier=remappedDataAccess, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nextRemappedDataAccess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=remappedDataAccess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getVersion, postfix_operators=[], prefix_operators=[], qualifier=historicalStateToRemap, selectors=[], type_arguments=None), MemberReference(member=remappedKeyOrdinalMapping, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=remappedDataAccess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getHeaderEntries, postfix_operators=[], prefix_operators=[], qualifier=historicalStateToRemap, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HollowHistoricalState, sub_type=None)), name=remappedState)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HollowHistoricalState, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nextRemappedState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setNextState, postfix_operators=[], prefix_operators=[], qualifier=remappedState, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nextRemappedState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=remappedState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=remappedState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=historicalStates, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getVersion, postfix_operators=[], prefix_operators=[], qualifier=remappedState, selectors=[], type_arguments=None), MemberReference(member=remappedState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=historicalStateLookupMap, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=historicalStates, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[historicalDataAccess.setNextState, parameter[member[.newHollowStateEngine]]] local_variable[type[HollowHistoricalStateKeyOrdinalMapping], keyOrdinalMapping] local_variable[type[HollowHistoricalState], historicalState] call[.addHistoricalState, parameter[member[.historicalState]]] assign[THIS[member[None.latestVersion]], member[.newVersion]] assign[THIS[member[None.latestHollowReadStateEngine]], member[.newHollowStateEngine]] assign[THIS[member[None.latestHeaderEntries]], call[latestHollowReadStateEngine.getHeaderTags, parameter[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[doubleSnapshotOccurred] operator[SEP] identifier[HollowReadStateEngine] identifier[newHollowStateEngine] , Keyword[long] identifier[newVersion] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[keyIndex] operator[SEP] identifier[isInitialized] operator[SEP] operator[SEP] operator[SEP] identifier[keyIndex] operator[SEP] identifier[update] operator[SEP] identifier[latestHollowReadStateEngine] , literal[boolean] operator[SEP] operator[SEP] identifier[keyIndex] operator[SEP] identifier[update] operator[SEP] identifier[newHollowStateEngine] , literal[boolean] operator[SEP] operator[SEP] identifier[HollowHistoricalStateDataAccess] identifier[historicalDataAccess] operator[SEP] identifier[DiffEqualityMapping] identifier[mapping] operator[=] Keyword[new] identifier[DiffEqualityMapping] operator[SEP] identifier[latestHollowReadStateEngine] , identifier[newHollowStateEngine] , literal[boolean] , operator[!] identifier[ignoreListOrderingOnDoubleSnapshot] operator[SEP] operator[SEP] identifier[DiffEqualityMappingOrdinalRemapper] identifier[remapper] operator[=] Keyword[new] identifier[DiffEqualityMappingOrdinalRemapper] operator[SEP] identifier[mapping] operator[SEP] operator[SEP] identifier[historicalDataAccess] operator[=] identifier[creator] operator[SEP] identifier[createHistoricalStateFromDoubleSnapshot] operator[SEP] identifier[latestVersion] , identifier[latestHollowReadStateEngine] , identifier[newHollowStateEngine] , identifier[remapper] operator[SEP] operator[SEP] identifier[HollowHistoricalStateDataAccess] identifier[nextRemappedDataAccess] operator[=] identifier[historicalDataAccess] operator[SEP] identifier[HollowHistoricalState] identifier[nextRemappedState] operator[=] Other[null] operator[SEP] identifier[HollowHistoricalStateDataAccess] operator[SEP] operator[SEP] identifier[remappedDataAccesses] operator[=] Keyword[new] identifier[HollowHistoricalStateDataAccess] operator[SEP] identifier[historicalStates] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[HollowHistoricalStateKeyOrdinalMapping] operator[SEP] operator[SEP] identifier[remappedKeyOrdinalMappings] operator[=] Keyword[new] identifier[HollowHistoricalStateKeyOrdinalMapping] operator[SEP] identifier[historicalStates] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[remapHistoricalStateOrdinals] operator[SEP] identifier[remapper] , identifier[remappedDataAccesses] , identifier[remappedKeyOrdinalMappings] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[historicalStates] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[HollowHistoricalState] identifier[historicalStateToRemap] operator[=] identifier[historicalStates] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[HollowHistoricalStateDataAccess] identifier[remappedDataAccess] operator[=] identifier[remappedDataAccesses] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[HollowHistoricalStateKeyOrdinalMapping] identifier[remappedKeyOrdinalMapping] operator[=] identifier[remappedKeyOrdinalMappings] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[remappedDataAccess] operator[SEP] identifier[setNextState] operator[SEP] identifier[nextRemappedDataAccess] operator[SEP] operator[SEP] identifier[nextRemappedDataAccess] operator[=] identifier[remappedDataAccess] operator[SEP] identifier[HollowHistoricalState] identifier[remappedState] operator[=] Keyword[new] identifier[HollowHistoricalState] operator[SEP] identifier[historicalStateToRemap] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] , identifier[remappedKeyOrdinalMapping] , identifier[remappedDataAccess] , identifier[historicalStateToRemap] operator[SEP] identifier[getHeaderEntries] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[remappedState] operator[SEP] identifier[setNextState] operator[SEP] identifier[nextRemappedState] operator[SEP] operator[SEP] identifier[nextRemappedState] operator[=] identifier[remappedState] operator[SEP] identifier[historicalStates] operator[SEP] identifier[set] operator[SEP] identifier[i] , identifier[remappedState] operator[SEP] operator[SEP] identifier[historicalStateLookupMap] operator[SEP] identifier[put] operator[SEP] identifier[remappedState] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] , identifier[remappedState] operator[SEP] operator[SEP] } identifier[historicalDataAccess] operator[SEP] identifier[setNextState] operator[SEP] identifier[newHollowStateEngine] operator[SEP] operator[SEP] identifier[HollowHistoricalStateKeyOrdinalMapping] identifier[keyOrdinalMapping] operator[=] identifier[createKeyOrdinalMappingFromDoubleSnapshot] operator[SEP] identifier[newHollowStateEngine] , identifier[remapper] operator[SEP] operator[SEP] identifier[HollowHistoricalState] identifier[historicalState] operator[=] Keyword[new] identifier[HollowHistoricalState] operator[SEP] identifier[newVersion] , identifier[keyOrdinalMapping] , identifier[historicalDataAccess] , identifier[latestHeaderEntries] operator[SEP] operator[SEP] identifier[addHistoricalState] operator[SEP] identifier[historicalState] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[latestVersion] operator[=] identifier[newVersion] operator[SEP] Keyword[this] operator[SEP] identifier[latestHollowReadStateEngine] operator[=] identifier[newHollowStateEngine] operator[SEP] Keyword[this] operator[SEP] identifier[latestHeaderEntries] operator[=] identifier[latestHollowReadStateEngine] operator[SEP] identifier[getHeaderTags] operator[SEP] operator[SEP] operator[SEP] }
public void setClobValue(long locator, Clob data) throws PersistException, IOException { if (data == null) { deleteLob(locator); return; } if (locator == 0) { throw new IllegalArgumentException("Cannot use locator zero"); } if (data instanceof ClobImpl) { BlobImpl impl = ((ClobImpl) data).getWrappedBlob(); if (impl.getEnclosing() == this && impl.mLocator == locator) { // Blob is ours and locator is the same, so nothing to do. return; } } try { setClobValue(locator, data.openReader(0, 0)); } catch (FetchException e) { throw e.toPersistException(); } }
class class_name[name] begin[{] method[setClobValue, return_type[void], modifier[public], parameter[locator, data]] begin[{] if[binary_operation[member[.data], ==, literal[null]]] begin[{] call[.deleteLob, parameter[member[.locator]]] return[None] else begin[{] None end[}] if[binary_operation[member[.locator], ==, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot use locator zero")], 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[.data], instanceof, type[ClobImpl]]] begin[{] local_variable[type[BlobImpl], impl] if[binary_operation[binary_operation[call[impl.getEnclosing, parameter[]], ==, THIS[]], &&, binary_operation[member[impl.mLocator], ==, member[.locator]]]] begin[{] return[None] else begin[{] None end[}] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=locator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=openReader, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None)], member=setClobValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[], member=toPersistException, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FetchException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setClobValue] operator[SEP] Keyword[long] identifier[locator] , identifier[Clob] identifier[data] operator[SEP] Keyword[throws] identifier[PersistException] , identifier[IOException] { Keyword[if] operator[SEP] identifier[data] operator[==] Other[null] operator[SEP] { identifier[deleteLob] operator[SEP] identifier[locator] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[locator] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[data] Keyword[instanceof] identifier[ClobImpl] operator[SEP] { identifier[BlobImpl] identifier[impl] operator[=] operator[SEP] operator[SEP] identifier[ClobImpl] operator[SEP] identifier[data] operator[SEP] operator[SEP] identifier[getWrappedBlob] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[impl] operator[SEP] identifier[getEnclosing] operator[SEP] operator[SEP] operator[==] Keyword[this] operator[&&] identifier[impl] operator[SEP] identifier[mLocator] operator[==] identifier[locator] operator[SEP] { Keyword[return] operator[SEP] } } Keyword[try] { identifier[setClobValue] operator[SEP] identifier[locator] , identifier[data] operator[SEP] identifier[openReader] operator[SEP] Other[0] , Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FetchException] identifier[e] operator[SEP] { Keyword[throw] identifier[e] operator[SEP] identifier[toPersistException] operator[SEP] operator[SEP] operator[SEP] } }
public int findHeaderPositionUnder(int x, int y) { for (int i = 0; i < mHeaderRects.size(); i++) { Rect rect = mHeaderRects.get(mHeaderRects.keyAt(i)); if (rect.contains(x, y)) { return mHeaderRects.keyAt(i); } } return -1; }
class class_name[name] begin[{] method[findHeaderPositionUnder, return_type[type[int]], modifier[public], parameter[x, y]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=keyAt, postfix_operators=[], prefix_operators=[], qualifier=mHeaderRects, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=mHeaderRects, selectors=[], type_arguments=None), name=rect)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Rect, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=rect, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=keyAt, postfix_operators=[], prefix_operators=[], qualifier=mHeaderRects, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=mHeaderRects, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[1]] end[}] END[}]
Keyword[public] Keyword[int] identifier[findHeaderPositionUnder] operator[SEP] Keyword[int] identifier[x] , Keyword[int] identifier[y] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[mHeaderRects] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Rect] identifier[rect] operator[=] identifier[mHeaderRects] operator[SEP] identifier[get] operator[SEP] identifier[mHeaderRects] operator[SEP] identifier[keyAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rect] operator[SEP] identifier[contains] operator[SEP] identifier[x] , identifier[y] operator[SEP] operator[SEP] { Keyword[return] identifier[mHeaderRects] operator[SEP] identifier[keyAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] } } Keyword[return] operator[-] Other[1] operator[SEP] }
protected Set<Class<? extends S>> findInstanceAbleScript(Set<Class<? extends S>> scriptClazzs) throws InstantiationException, IllegalAccessException { Set<Class<? extends S>> result=new HashSet<>(); for (Class<? extends S> scriptClazz : scriptClazzs) { if(isInstanceAble(scriptClazz)) { result.add(scriptClazz); } } return result; }
class class_name[name] begin[{] method[findInstanceAbleScript, return_type[type[Set]], modifier[protected], parameter[scriptClazzs]] begin[{] local_variable[type[Set], result] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=scriptClazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isInstanceAble, 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=scriptClazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=scriptClazzs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=scriptClazz)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=S, sub_type=None))], dimensions=[], name=Class, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[protected] identifier[Set] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[S] operator[>] operator[>] identifier[findInstanceAbleScript] operator[SEP] identifier[Set] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[S] operator[>] operator[>] identifier[scriptClazzs] operator[SEP] Keyword[throws] identifier[InstantiationException] , identifier[IllegalAccessException] { identifier[Set] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[S] operator[>] operator[>] identifier[result] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[S] operator[>] identifier[scriptClazz] operator[:] identifier[scriptClazzs] operator[SEP] { Keyword[if] operator[SEP] identifier[isInstanceAble] operator[SEP] identifier[scriptClazz] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[scriptClazz] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public static IntegerChromosome of( final int min, final int max, final IntRange lengthRange ) { final ISeq<IntegerGene> values = IntegerGene.seq(min, max, lengthRange); return new IntegerChromosome(values, lengthRange); }
class class_name[name] begin[{] method[of, return_type[type[IntegerChromosome]], modifier[public static], parameter[min, max, lengthRange]] begin[{] local_variable[type[ISeq], values] return[ClassCreator(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lengthRange, 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=IntegerChromosome, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[IntegerChromosome] identifier[of] operator[SEP] Keyword[final] Keyword[int] identifier[min] , Keyword[final] Keyword[int] identifier[max] , Keyword[final] identifier[IntRange] identifier[lengthRange] operator[SEP] { Keyword[final] identifier[ISeq] operator[<] identifier[IntegerGene] operator[>] identifier[values] operator[=] identifier[IntegerGene] operator[SEP] identifier[seq] operator[SEP] identifier[min] , identifier[max] , identifier[lengthRange] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[IntegerChromosome] operator[SEP] identifier[values] , identifier[lengthRange] operator[SEP] operator[SEP] }
private void writeName(DataOutputStream os, MLArray array) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); DataOutputStream bufferDOS = new DataOutputStream(buffer); byte[] nameByteArray = array.getNameToByteArray(); buffer = new ByteArrayOutputStream(); bufferDOS = new DataOutputStream(buffer); bufferDOS.write( nameByteArray ); OSArrayTag tag = new OSArrayTag(MatDataTypes.miINT8, buffer.toByteArray() ); tag.writeTo( os ); }
class class_name[name] begin[{] method[writeName, return_type[void], modifier[private], parameter[os, array]] begin[{] local_variable[type[ByteArrayOutputStream], buffer] local_variable[type[DataOutputStream], bufferDOS] local_variable[type[byte], nameByteArray] assign[member[.buffer], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayOutputStream, sub_type=None))] assign[member[.bufferDOS], ClassCreator(arguments=[MemberReference(member=buffer, 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=DataOutputStream, sub_type=None))] call[bufferDOS.write, parameter[member[.nameByteArray]]] local_variable[type[OSArrayTag], tag] call[tag.writeTo, parameter[member[.os]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[writeName] operator[SEP] identifier[DataOutputStream] identifier[os] , identifier[MLArray] identifier[array] operator[SEP] Keyword[throws] identifier[IOException] { identifier[ByteArrayOutputStream] identifier[buffer] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[DataOutputStream] identifier[bufferDOS] operator[=] Keyword[new] identifier[DataOutputStream] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[nameByteArray] operator[=] identifier[array] operator[SEP] identifier[getNameToByteArray] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[bufferDOS] operator[=] Keyword[new] identifier[DataOutputStream] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] identifier[bufferDOS] operator[SEP] identifier[write] operator[SEP] identifier[nameByteArray] operator[SEP] operator[SEP] identifier[OSArrayTag] identifier[tag] operator[=] Keyword[new] identifier[OSArrayTag] operator[SEP] identifier[MatDataTypes] operator[SEP] identifier[miINT8] , identifier[buffer] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tag] operator[SEP] identifier[writeTo] operator[SEP] identifier[os] operator[SEP] operator[SEP] }
@Override public UpdateSSHPublicKeyResult updateSSHPublicKey(UpdateSSHPublicKeyRequest request) { request = beforeClientExecution(request); return executeUpdateSSHPublicKey(request); }
class class_name[name] begin[{] method[updateSSHPublicKey, return_type[type[UpdateSSHPublicKeyResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeUpdateSSHPublicKey, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[UpdateSSHPublicKeyResult] identifier[updateSSHPublicKey] operator[SEP] identifier[UpdateSSHPublicKeyRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeUpdateSSHPublicKey] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
@Override public boolean logModified(Logger log) { if (_depend.logModified(log)) { return true; } else if (_sourcePath == null) return false; else if (_sourcePath.getLastModified() != _sourceLastModified) { log.info("source modified time: " + _sourcePath + " old:" + new Date(_sourceLastModified) + " new:" + new Date(_sourcePath.getLastModified())); return true; } else if (_sourcePath.length() != _sourceLength) { log.info("source modified length: " + _sourcePath + " old:" + _sourceLength + " new:" + _sourcePath.length()); return true; } else { return false; } }
class class_name[name] begin[{] method[logModified, return_type[type[boolean]], modifier[public], parameter[log]] begin[{] if[call[_depend.logModified, parameter[member[.log]]]] begin[{] return[literal[true]] else begin[{] if[binary_operation[member[._sourcePath], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] if[binary_operation[call[_sourcePath.getLastModified, parameter[]], !=, member[._sourceLastModified]]] begin[{] call[log.info, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["source modified time: "], +, member[._sourcePath]], +, literal[" old:"]], +, ClassCreator(arguments=[MemberReference(member=_sourceLastModified, 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=Date, sub_type=None))], +, literal[" new:"]], +, ClassCreator(arguments=[MethodInvocation(arguments=[], member=getLastModified, postfix_operators=[], prefix_operators=[], qualifier=_sourcePath, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]]] return[literal[true]] else begin[{] if[binary_operation[call[_sourcePath.length, parameter[]], !=, member[._sourceLength]]] begin[{] call[log.info, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["source modified length: "], +, member[._sourcePath]], +, literal[" old:"]], +, member[._sourceLength]], +, literal[" new:"]], +, call[_sourcePath.length, parameter[]]]]] return[literal[true]] else begin[{] return[literal[false]] end[}] end[}] end[}] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[logModified] operator[SEP] identifier[Logger] identifier[log] operator[SEP] { Keyword[if] operator[SEP] identifier[_depend] operator[SEP] identifier[logModified] operator[SEP] identifier[log] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[_sourcePath] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[_sourcePath] operator[SEP] identifier[getLastModified] operator[SEP] operator[SEP] operator[!=] identifier[_sourceLastModified] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[_sourcePath] operator[+] literal[String] operator[+] Keyword[new] identifier[Date] operator[SEP] identifier[_sourceLastModified] operator[SEP] operator[+] literal[String] operator[+] Keyword[new] identifier[Date] operator[SEP] identifier[_sourcePath] operator[SEP] identifier[getLastModified] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[_sourcePath] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] identifier[_sourceLength] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[_sourcePath] operator[+] literal[String] operator[+] identifier[_sourceLength] operator[+] literal[String] operator[+] identifier[_sourcePath] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } }
private void expect(JsonToken expected) throws IOException { peek(); if (token != expected) { throw new IllegalStateException("Expected " + expected + " but was " + peek()); } advance(); }
class class_name[name] begin[{] method[expect, return_type[void], modifier[private], parameter[expected]] begin[{] call[.peek, parameter[]] if[binary_operation[member[.token], !=, member[.expected]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected "), operandr=MemberReference(member=expected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" but was "), operator=+), operandr=MethodInvocation(arguments=[], member=peek, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] call[.advance, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[expect] operator[SEP] identifier[JsonToken] identifier[expected] operator[SEP] Keyword[throws] identifier[IOException] { identifier[peek] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[!=] identifier[expected] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[expected] operator[+] literal[String] operator[+] identifier[peek] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[advance] operator[SEP] operator[SEP] operator[SEP] }
public Observable<Boolean> handleMessage(final ChatMessage message) { String sender = message.getSentBy(); Observable<Boolean> replaceMessages = persistenceController.updateStoreWithNewMessage(message, noConversationListener); if (!TextUtils.isEmpty(sender) && !sender.equals(getProfileId())) { final Set<String> ids = new HashSet<>(); ids.add(message.getMessageId()); return Observable.zip(replaceMessages, markDelivered(message.getConversationId(), ids), (saved, result) -> saved && result.isSuccessful()); } else { return replaceMessages; } }
class class_name[name] begin[{] method[handleMessage, return_type[type[Observable]], modifier[public], parameter[message]] begin[{] local_variable[type[String], sender] local_variable[type[Observable], replaceMessages] if[binary_operation[call[TextUtils.isEmpty, parameter[member[.sender]]], &&, call[sender.equals, parameter[call[.getProfileId, parameter[]]]]]] begin[{] local_variable[type[Set], ids] call[ids.add, parameter[call[message.getMessageId, parameter[]]]] return[call[Observable.zip, parameter[member[.replaceMessages], call[.markDelivered, parameter[call[message.getConversationId, parameter[]], member[.ids]]], LambdaExpression(body=BinaryOperation(operandl=MemberReference(member=saved, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isSuccessful, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operator=&&), parameters=[InferredFormalParameter(name=saved), InferredFormalParameter(name=result)])]]] else begin[{] return[member[.replaceMessages]] end[}] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[Boolean] operator[>] identifier[handleMessage] operator[SEP] Keyword[final] identifier[ChatMessage] identifier[message] operator[SEP] { identifier[String] identifier[sender] operator[=] identifier[message] operator[SEP] identifier[getSentBy] operator[SEP] operator[SEP] operator[SEP] identifier[Observable] operator[<] identifier[Boolean] operator[>] identifier[replaceMessages] operator[=] identifier[persistenceController] operator[SEP] identifier[updateStoreWithNewMessage] operator[SEP] identifier[message] , identifier[noConversationListener] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[TextUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[sender] operator[SEP] operator[&&] operator[!] identifier[sender] operator[SEP] identifier[equals] operator[SEP] identifier[getProfileId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[ids] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ids] operator[SEP] identifier[add] operator[SEP] identifier[message] operator[SEP] identifier[getMessageId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[zip] operator[SEP] identifier[replaceMessages] , identifier[markDelivered] operator[SEP] identifier[message] operator[SEP] identifier[getConversationId] operator[SEP] operator[SEP] , identifier[ids] operator[SEP] , operator[SEP] identifier[saved] , identifier[result] operator[SEP] operator[->] identifier[saved] operator[&&] identifier[result] operator[SEP] identifier[isSuccessful] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[replaceMessages] operator[SEP] } }
public ReplicatorDocument find() { assertNotEmpty(replicatorDoc.getId(), "Doc id"); final URI uri = buildUri(dbURI).path(replicatorDoc.getId()).query("rev", replicatorDoc.getRevision()).build(); return dbc.get(uri, ReplicatorDocument.class); }
class class_name[name] begin[{] method[find, return_type[type[ReplicatorDocument]], modifier[public], parameter[]] begin[{] call[.assertNotEmpty, parameter[call[replicatorDoc.getId, parameter[]], literal["Doc id"]]] local_variable[type[URI], uri] return[call[dbc.get, parameter[member[.uri], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReplicatorDocument, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[ReplicatorDocument] identifier[find] operator[SEP] operator[SEP] { identifier[assertNotEmpty] operator[SEP] identifier[replicatorDoc] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[URI] identifier[uri] operator[=] identifier[buildUri] operator[SEP] identifier[dbURI] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[replicatorDoc] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[query] operator[SEP] literal[String] , identifier[replicatorDoc] operator[SEP] identifier[getRevision] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[dbc] operator[SEP] identifier[get] operator[SEP] identifier[uri] , identifier[ReplicatorDocument] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public static List<WordInfo> extractWords(String text, int size) { return extractWords(text, size, false); }
class class_name[name] begin[{] method[extractWords, return_type[type[List]], modifier[public static], parameter[text, size]] begin[{] return[call[.extractWords, parameter[member[.text], member[.size], literal[false]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[WordInfo] operator[>] identifier[extractWords] operator[SEP] identifier[String] identifier[text] , Keyword[int] identifier[size] operator[SEP] { Keyword[return] identifier[extractWords] operator[SEP] identifier[text] , identifier[size] , literal[boolean] operator[SEP] operator[SEP] }
public void setArgumentResolvers( List<HandlerMethodArgumentResolver> argumentResolvers) { if (argumentResolvers == null) { this.argumentResolvers.clear(); return; } this.argumentResolvers.addResolvers(argumentResolvers); }
class class_name[name] begin[{] method[setArgumentResolvers, return_type[void], modifier[public], parameter[argumentResolvers]] begin[{] if[binary_operation[member[.argumentResolvers], ==, literal[null]]] begin[{] THIS[member[None.argumentResolvers]call[None.clear, parameter[]]] return[None] else begin[{] None end[}] THIS[member[None.argumentResolvers]call[None.addResolvers, parameter[member[.argumentResolvers]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setArgumentResolvers] operator[SEP] identifier[List] operator[<] identifier[HandlerMethodArgumentResolver] operator[>] identifier[argumentResolvers] operator[SEP] { Keyword[if] operator[SEP] identifier[argumentResolvers] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[argumentResolvers] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[argumentResolvers] operator[SEP] identifier[addResolvers] operator[SEP] identifier[argumentResolvers] operator[SEP] operator[SEP] }
public void postProcessThisDirectory(File fileDir, Object objDirID) { if (DBConstants.TRUE.equalsIgnoreCase(this.getProperty("deleteDir"))) fileDir.delete(); }
class class_name[name] begin[{] method[postProcessThisDirectory, return_type[void], modifier[public], parameter[fileDir, objDirID]] begin[{] if[call[DBConstants.TRUE.equalsIgnoreCase, parameter[THIS[call[None.getProperty, parameter[literal["deleteDir"]]]]]]] begin[{] call[fileDir.delete, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[postProcessThisDirectory] operator[SEP] identifier[File] identifier[fileDir] , identifier[Object] identifier[objDirID] operator[SEP] { Keyword[if] operator[SEP] identifier[DBConstants] operator[SEP] identifier[TRUE] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] Keyword[this] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[fileDir] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] }
public static com.liferay.commerce.product.model.CPOptionValue getCPOptionValueByUuidAndGroupId( String uuid, long groupId) throws com.liferay.portal.kernel.exception.PortalException { return getService().getCPOptionValueByUuidAndGroupId(uuid, groupId); }
class class_name[name] begin[{] method[getCPOptionValueByUuidAndGroupId, return_type[type[com]], modifier[public static], parameter[uuid, groupId]] begin[{] return[call[.getService, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[product] operator[SEP] identifier[model] operator[SEP] identifier[CPOptionValue] identifier[getCPOptionValueByUuidAndGroupId] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[groupId] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[portal] operator[SEP] identifier[kernel] operator[SEP] identifier[exception] operator[SEP] identifier[PortalException] { Keyword[return] identifier[getService] operator[SEP] operator[SEP] operator[SEP] identifier[getCPOptionValueByUuidAndGroupId] operator[SEP] identifier[uuid] , identifier[groupId] operator[SEP] operator[SEP] }
private WsByteBuffer getBuffer() { WsByteBuffer buffer = this._output[this.outputIndex]; if (null == buffer) { buffer = getNewByteBuffer(); buffer.clear(); this._output[this.outputIndex] = buffer; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "getBuffer, new buffer -->" + buffer + " ,outputIndex -->" + this.outputIndex); } } else if (!buffer.hasRemaining()) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "getBuffer, buffer -->" + buffer + " ,outputIndex -->" + this.outputIndex + " ,outputLength -->" + this._output.length); } buffer.flip(); this.outputIndex++; // next array spot may or may not exist from previous iterations if (null == this._output[this.outputIndex]) { this._output[this.outputIndex] = getNewByteBuffer(); } buffer = this._output[this.outputIndex]; buffer.clear(); } return buffer; }
class class_name[name] begin[{] method[getBuffer, return_type[type[WsByteBuffer]], modifier[private], parameter[]] begin[{] local_variable[type[WsByteBuffer], buffer] if[binary_operation[literal[null], ==, member[.buffer]]] begin[{] assign[member[.buffer], call[.getNewByteBuffer, parameter[]]] call[buffer.clear, parameter[]] assign[THIS[member[None._output]ArraySelector(index=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=outputIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))], member[.buffer]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[literal["getBuffer, new buffer -->"], +, member[.buffer]], +, literal[" ,outputIndex -->"]], +, THIS[member[None.outputIndex]]]]] else begin[{] None end[}] else begin[{] if[call[buffer.hasRemaining, parameter[]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["getBuffer, buffer -->"], +, member[.buffer]], +, literal[" ,outputIndex -->"]], +, THIS[member[None.outputIndex]]], +, literal[" ,outputLength -->"]], +, THIS[member[None._output]member[None.length]]]]] else begin[{] None end[}] call[buffer.flip, parameter[]] THIS[member[None.outputIndex]] if[binary_operation[literal[null], ==, THIS[member[None._output]ArraySelector(index=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=outputIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))]]] begin[{] assign[THIS[member[None._output]ArraySelector(index=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=outputIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))], call[.getNewByteBuffer, parameter[]]] else begin[{] None end[}] assign[member[.buffer], THIS[member[None._output]ArraySelector(index=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=outputIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))]] call[buffer.clear, parameter[]] else begin[{] None end[}] end[}] return[member[.buffer]] end[}] END[}]
Keyword[private] identifier[WsByteBuffer] identifier[getBuffer] operator[SEP] operator[SEP] { identifier[WsByteBuffer] identifier[buffer] operator[=] Keyword[this] operator[SEP] identifier[_output] operator[SEP] Keyword[this] operator[SEP] identifier[outputIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[buffer] operator[SEP] { identifier[buffer] operator[=] identifier[getNewByteBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[_output] operator[SEP] Keyword[this] operator[SEP] identifier[outputIndex] operator[SEP] operator[=] identifier[buffer] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[buffer] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[outputIndex] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[buffer] operator[SEP] identifier[hasRemaining] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[buffer] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[outputIndex] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[_output] operator[SEP] identifier[length] operator[SEP] operator[SEP] } identifier[buffer] operator[SEP] identifier[flip] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[outputIndex] operator[++] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] Keyword[this] operator[SEP] identifier[_output] operator[SEP] Keyword[this] operator[SEP] identifier[outputIndex] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[_output] operator[SEP] Keyword[this] operator[SEP] identifier[outputIndex] operator[SEP] operator[=] identifier[getNewByteBuffer] operator[SEP] operator[SEP] operator[SEP] } identifier[buffer] operator[=] Keyword[this] operator[SEP] identifier[_output] operator[SEP] Keyword[this] operator[SEP] identifier[outputIndex] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[buffer] operator[SEP] }
public void setLevNum(Integer newLevNum) { Integer oldLevNum = levNum; levNum = newLevNum; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.ATTRIBUTE_QUALIFIER__LEV_NUM, oldLevNum, levNum)); }
class class_name[name] begin[{] method[setLevNum, return_type[void], modifier[public], parameter[newLevNum]] begin[{] local_variable[type[Integer], oldLevNum] assign[member[.levNum], member[.newLevNum]] if[call[.eNotificationRequired, parameter[]]] begin[{] call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=ATTRIBUTE_QUALIFIER__LEV_NUM, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[]), MemberReference(member=oldLevNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=levNum, 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=ENotificationImpl, sub_type=None))]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setLevNum] operator[SEP] identifier[Integer] identifier[newLevNum] operator[SEP] { identifier[Integer] identifier[oldLevNum] operator[=] identifier[levNum] operator[SEP] identifier[levNum] operator[=] identifier[newLevNum] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[AfplibPackage] operator[SEP] identifier[ATTRIBUTE_QUALIFIER__LEV_NUM] , identifier[oldLevNum] , identifier[levNum] operator[SEP] operator[SEP] operator[SEP] }
public void sendCookie(String name, String value) { RequestContext.getHttpResponse().addCookie(Cookie.toServletCookie(new Cookie(name, value))); }
class class_name[name] begin[{] method[sendCookie, return_type[void], modifier[public], parameter[name, value]] begin[{] call[RequestContext.getHttpResponse, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[sendCookie] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[value] operator[SEP] { identifier[RequestContext] operator[SEP] identifier[getHttpResponse] operator[SEP] operator[SEP] operator[SEP] identifier[addCookie] operator[SEP] identifier[Cookie] operator[SEP] identifier[toServletCookie] operator[SEP] Keyword[new] identifier[Cookie] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public ServiceFuture<List<DeletedKeyItem>> getDeletedKeysNextAsync(final String nextPageLink, final ServiceFuture<List<DeletedKeyItem>> serviceFuture, final ListOperationCallback<DeletedKeyItem> serviceCallback) { return AzureServiceFuture.fromPageResponse( getDeletedKeysNextSinglePageAsync(nextPageLink), new Func1<String, Observable<ServiceResponse<Page<DeletedKeyItem>>>>() { @Override public Observable<ServiceResponse<Page<DeletedKeyItem>>> call(String nextPageLink) { return getDeletedKeysNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
class class_name[name] begin[{] method[getDeletedKeysNextAsync, return_type[type[ServiceFuture]], modifier[public], parameter[nextPageLink, serviceFuture, serviceCallback]] begin[{] return[call[AzureServiceFuture.fromPageResponse, parameter[call[.getDeletedKeysNextSinglePageAsync, parameter[member[.nextPageLink]]], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=nextPageLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDeletedKeysNextSinglePageAsync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[FormalParameter(annotations=[], modifiers=set(), name=nextPageLink, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DeletedKeyItem, sub_type=None))], dimensions=[], name=Page, sub_type=None))], dimensions=[], name=ServiceResponse, sub_type=None))], dimensions=[], name=Observable, 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=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DeletedKeyItem, sub_type=None))], dimensions=[], name=Page, sub_type=None))], dimensions=[], name=ServiceResponse, sub_type=None))], dimensions=[], name=Observable, sub_type=None))], dimensions=None, name=Func1, sub_type=None)), member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[DeletedKeyItem] operator[>] operator[>] identifier[getDeletedKeysNextAsync] operator[SEP] Keyword[final] identifier[String] identifier[nextPageLink] , Keyword[final] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[DeletedKeyItem] operator[>] operator[>] identifier[serviceFuture] , Keyword[final] identifier[ListOperationCallback] operator[<] identifier[DeletedKeyItem] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[AzureServiceFuture] operator[SEP] identifier[fromPageResponse] operator[SEP] identifier[getDeletedKeysNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] , Keyword[new] identifier[Func1] operator[<] identifier[String] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[DeletedKeyItem] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[DeletedKeyItem] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[String] identifier[nextPageLink] operator[SEP] { Keyword[return] identifier[getDeletedKeysNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] } } , identifier[serviceCallback] operator[SEP] operator[SEP] }
public static CommercePriceList fetchByLtD_S_Last(Date displayDate, int status, OrderByComparator<CommercePriceList> orderByComparator) { return getPersistence() .fetchByLtD_S_Last(displayDate, status, orderByComparator); }
class class_name[name] begin[{] method[fetchByLtD_S_Last, return_type[type[CommercePriceList]], modifier[public static], parameter[displayDate, status, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CommercePriceList] identifier[fetchByLtD_S_Last] operator[SEP] identifier[Date] identifier[displayDate] , Keyword[int] identifier[status] , identifier[OrderByComparator] operator[<] identifier[CommercePriceList] operator[>] identifier[orderByComparator] operator[SEP] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByLtD_S_Last] operator[SEP] identifier[displayDate] , identifier[status] , identifier[orderByComparator] operator[SEP] operator[SEP] }
public void set(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4) { this.points[0] = x1; this.points[1] = y1; this.points[2] = 0; this.points[3] = x2; this.points[4] = y2; this.points[5] = 0; this.points[6] = x3; this.points[7] = y3; this.points[8] = 0; this.points[9] = x4; this.points[10] = y4; this.points[11] = 0; set(); }
class class_name[name] begin[{] method[set, return_type[void], modifier[public], parameter[x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4]] begin[{] assign[THIS[member[None.points]ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], member[.x1]] assign[THIS[member[None.points]ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))], member[.y1]] assign[THIS[member[None.points]ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))], literal[0]] assign[THIS[member[None.points]ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3))], member[.x2]] assign[THIS[member[None.points]ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4))], member[.y2]] assign[THIS[member[None.points]ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5))], literal[0]] assign[THIS[member[None.points]ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6))], member[.x3]] assign[THIS[member[None.points]ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=7))], member[.y3]] assign[THIS[member[None.points]ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8))], literal[0]] assign[THIS[member[None.points]ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=9))], member[.x4]] assign[THIS[member[None.points]ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10))], member[.y4]] assign[THIS[member[None.points]ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=11))], literal[0]] call[.set, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[set] operator[SEP] Keyword[float] identifier[x1] , Keyword[float] identifier[y1] , Keyword[float] identifier[z1] , Keyword[float] identifier[x2] , Keyword[float] identifier[y2] , Keyword[float] identifier[z2] , Keyword[float] identifier[x3] , Keyword[float] identifier[y3] , Keyword[float] identifier[z3] , Keyword[float] identifier[x4] , Keyword[float] identifier[y4] , Keyword[float] identifier[z4] operator[SEP] { Keyword[this] operator[SEP] identifier[points] operator[SEP] Other[0] operator[SEP] operator[=] identifier[x1] operator[SEP] Keyword[this] operator[SEP] identifier[points] operator[SEP] Other[1] operator[SEP] operator[=] identifier[y1] operator[SEP] Keyword[this] operator[SEP] identifier[points] operator[SEP] Other[2] operator[SEP] operator[=] Other[0] operator[SEP] Keyword[this] operator[SEP] identifier[points] operator[SEP] Other[3] operator[SEP] operator[=] identifier[x2] operator[SEP] Keyword[this] operator[SEP] identifier[points] operator[SEP] Other[4] operator[SEP] operator[=] identifier[y2] operator[SEP] Keyword[this] operator[SEP] identifier[points] operator[SEP] Other[5] operator[SEP] operator[=] Other[0] operator[SEP] Keyword[this] operator[SEP] identifier[points] operator[SEP] Other[6] operator[SEP] operator[=] identifier[x3] operator[SEP] Keyword[this] operator[SEP] identifier[points] operator[SEP] Other[7] operator[SEP] operator[=] identifier[y3] operator[SEP] Keyword[this] operator[SEP] identifier[points] operator[SEP] Other[8] operator[SEP] operator[=] Other[0] operator[SEP] Keyword[this] operator[SEP] identifier[points] operator[SEP] Other[9] operator[SEP] operator[=] identifier[x4] operator[SEP] Keyword[this] operator[SEP] identifier[points] operator[SEP] Other[10] operator[SEP] operator[=] identifier[y4] operator[SEP] Keyword[this] operator[SEP] identifier[points] operator[SEP] Other[11] operator[SEP] operator[=] Other[0] operator[SEP] identifier[set] operator[SEP] operator[SEP] operator[SEP] }
@Deprecated public final void reset(String str) { int length = 0; if (str != null) { length = str.length(); } reset(str, 0, length); }
class class_name[name] begin[{] method[reset, return_type[void], modifier[final public], parameter[str]] begin[{] local_variable[type[int], length] if[binary_operation[member[.str], !=, literal[null]]] begin[{] assign[member[.length], call[str.length, parameter[]]] else begin[{] None end[}] call[.reset, parameter[member[.str], literal[0], member[.length]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[final] Keyword[void] identifier[reset] operator[SEP] identifier[String] identifier[str] operator[SEP] { Keyword[int] identifier[length] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[str] operator[!=] Other[null] operator[SEP] { identifier[length] operator[=] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } identifier[reset] operator[SEP] identifier[str] , Other[0] , identifier[length] operator[SEP] operator[SEP] }
public synchronized int getActualTotal(T actual) { if (!matrix.containsKey(actual)) { return 0; } else { int total = 0; for (T elem : matrix.get(actual).elementSet()) { total += matrix.get(actual).count(elem); } return total; } }
class class_name[name] begin[{] method[getActualTotal, return_type[type[int]], modifier[synchronized public], parameter[actual]] begin[{] if[call[matrix.containsKey, parameter[member[.actual]]]] begin[{] return[literal[0]] else begin[{] local_variable[type[int], total] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=actual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=matrix, selectors=[MethodInvocation(arguments=[MemberReference(member=elem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=count, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=actual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=matrix, selectors=[MethodInvocation(arguments=[], member=elementSet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=elem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))), label=None) return[member[.total]] end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[int] identifier[getActualTotal] operator[SEP] identifier[T] identifier[actual] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[matrix] operator[SEP] identifier[containsKey] operator[SEP] identifier[actual] operator[SEP] operator[SEP] { Keyword[return] Other[0] operator[SEP] } Keyword[else] { Keyword[int] identifier[total] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[T] identifier[elem] operator[:] identifier[matrix] operator[SEP] identifier[get] operator[SEP] identifier[actual] operator[SEP] operator[SEP] identifier[elementSet] operator[SEP] operator[SEP] operator[SEP] { identifier[total] operator[+=] identifier[matrix] operator[SEP] identifier[get] operator[SEP] identifier[actual] operator[SEP] operator[SEP] identifier[count] operator[SEP] identifier[elem] operator[SEP] operator[SEP] } Keyword[return] identifier[total] operator[SEP] } }
public ActivityImpl findCompensationHandler() { String compensationHandlerId = (String) getProperty(BpmnParse.PROPERTYNAME_COMPENSATION_HANDLER_ID); if(compensationHandlerId != null) { return getProcessDefinition().findActivity(compensationHandlerId); } else { return null; } }
class class_name[name] begin[{] method[findCompensationHandler, return_type[type[ActivityImpl]], modifier[public], parameter[]] begin[{] local_variable[type[String], compensationHandlerId] if[binary_operation[member[.compensationHandlerId], !=, literal[null]]] begin[{] return[call[.getProcessDefinition, parameter[]]] else begin[{] return[literal[null]] end[}] end[}] END[}]
Keyword[public] identifier[ActivityImpl] identifier[findCompensationHandler] operator[SEP] operator[SEP] { identifier[String] identifier[compensationHandlerId] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[getProperty] operator[SEP] identifier[BpmnParse] operator[SEP] identifier[PROPERTYNAME_COMPENSATION_HANDLER_ID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[compensationHandlerId] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[getProcessDefinition] operator[SEP] operator[SEP] operator[SEP] identifier[findActivity] operator[SEP] identifier[compensationHandlerId] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
private Collection<ConfigAttribute> wrap(final AccessPredicate predicate) { requireNonNull(predicate, "predicate"); if (predicate == AccessPredicates.PERMIT_ALL) { return of(); // Empty collection => public invocation } return of(new AccessPredicateConfigAttribute(predicate)); }
class class_name[name] begin[{] method[wrap, return_type[type[Collection]], modifier[private], parameter[predicate]] begin[{] call[.requireNonNull, parameter[member[.predicate], literal["predicate"]]] if[binary_operation[member[.predicate], ==, member[AccessPredicates.PERMIT_ALL]]] begin[{] return[call[.of, parameter[]]] else begin[{] None end[}] return[call[.of, parameter[ClassCreator(arguments=[MemberReference(member=predicate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AccessPredicateConfigAttribute, sub_type=None))]]] end[}] END[}]
Keyword[private] identifier[Collection] operator[<] identifier[ConfigAttribute] operator[>] identifier[wrap] operator[SEP] Keyword[final] identifier[AccessPredicate] identifier[predicate] operator[SEP] { identifier[requireNonNull] operator[SEP] identifier[predicate] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[predicate] operator[==] identifier[AccessPredicates] operator[SEP] identifier[PERMIT_ALL] operator[SEP] { Keyword[return] identifier[of] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[of] operator[SEP] Keyword[new] identifier[AccessPredicateConfigAttribute] operator[SEP] identifier[predicate] operator[SEP] operator[SEP] operator[SEP] }
public List<JoinableResourceBundle> getResourceBundles(Properties properties) { PropertiesConfigHelper props = new PropertiesConfigHelper(properties, resourceType); String fileExtension = "." + resourceType; // Initialize custom bundles List<JoinableResourceBundle> customBundles = new ArrayList<>(); // Check if we should use the bundle names property or // find the bundle name using the bundle id declaration : // jawr.<type>.bundle.<name>.id if (null != props.getProperty(PropertiesBundleConstant.BUNDLE_FACTORY_CUSTOM_NAMES)) { StringTokenizer tk = new StringTokenizer( props.getProperty(PropertiesBundleConstant.BUNDLE_FACTORY_CUSTOM_NAMES), ","); while (tk.hasMoreTokens()) { customBundles .add(buildJoinableResourceBundle(props, tk.nextToken().trim(), fileExtension, rsReaderHandler)); } } else { Iterator<String> bundleNames = props.getPropertyBundleNameSet().iterator(); while (bundleNames.hasNext()) { customBundles .add(buildJoinableResourceBundle(props, bundleNames.next(), fileExtension, rsReaderHandler)); } } // Initialize the bundles dependencies Iterator<String> bundleNames = props.getPropertyBundleNameSet().iterator(); while (bundleNames.hasNext()) { String bundleName = (String) bundleNames.next(); List<String> bundleNameDependencies = props.getCustomBundlePropertyAsList(bundleName, PropertiesBundleConstant.BUNDLE_FACTORY_CUSTOM_DEPENDENCIES); if (!bundleNameDependencies.isEmpty()) { JoinableResourceBundle bundle = getBundleFromName(bundleName, customBundles); List<JoinableResourceBundle> bundleDependencies = getBundlesFromName(bundleNameDependencies, customBundles); bundle.setDependencies(bundleDependencies); } } return customBundles; }
class class_name[name] begin[{] method[getResourceBundles, return_type[type[List]], modifier[public], parameter[properties]] begin[{] local_variable[type[PropertiesConfigHelper], props] local_variable[type[String], fileExtension] local_variable[type[List], customBundles] if[binary_operation[literal[null], !=, call[props.getProperty, parameter[member[PropertiesBundleConstant.BUNDLE_FACTORY_CUSTOM_NAMES]]]]] begin[{] local_variable[type[StringTokenizer], tk] while[call[tk.hasMoreTokens, parameter[]]] begin[{] call[customBundles.add, parameter[call[.buildJoinableResourceBundle, parameter[member[.props], call[tk.nextToken, parameter[]], member[.fileExtension], member[.rsReaderHandler]]]]] end[}] else begin[{] local_variable[type[Iterator], bundleNames] while[call[bundleNames.hasNext, parameter[]]] begin[{] call[customBundles.add, parameter[call[.buildJoinableResourceBundle, parameter[member[.props], call[bundleNames.next, parameter[]], member[.fileExtension], member[.rsReaderHandler]]]]] end[}] end[}] local_variable[type[Iterator], bundleNames] while[call[bundleNames.hasNext, parameter[]]] begin[{] local_variable[type[String], bundleName] local_variable[type[List], bundleNameDependencies] if[call[bundleNameDependencies.isEmpty, parameter[]]] begin[{] local_variable[type[JoinableResourceBundle], bundle] local_variable[type[List], bundleDependencies] call[bundle.setDependencies, parameter[member[.bundleDependencies]]] else begin[{] None end[}] end[}] return[member[.customBundles]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[JoinableResourceBundle] operator[>] identifier[getResourceBundles] operator[SEP] identifier[Properties] identifier[properties] operator[SEP] { identifier[PropertiesConfigHelper] identifier[props] operator[=] Keyword[new] identifier[PropertiesConfigHelper] operator[SEP] identifier[properties] , identifier[resourceType] operator[SEP] operator[SEP] identifier[String] identifier[fileExtension] operator[=] literal[String] operator[+] identifier[resourceType] operator[SEP] identifier[List] operator[<] identifier[JoinableResourceBundle] operator[>] identifier[customBundles] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[props] operator[SEP] identifier[getProperty] operator[SEP] identifier[PropertiesBundleConstant] operator[SEP] identifier[BUNDLE_FACTORY_CUSTOM_NAMES] operator[SEP] operator[SEP] { identifier[StringTokenizer] identifier[tk] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[props] operator[SEP] identifier[getProperty] operator[SEP] identifier[PropertiesBundleConstant] operator[SEP] identifier[BUNDLE_FACTORY_CUSTOM_NAMES] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[tk] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] { identifier[customBundles] operator[SEP] identifier[add] operator[SEP] identifier[buildJoinableResourceBundle] operator[SEP] identifier[props] , identifier[tk] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] , identifier[fileExtension] , identifier[rsReaderHandler] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[Iterator] operator[<] identifier[String] operator[>] identifier[bundleNames] operator[=] identifier[props] operator[SEP] identifier[getPropertyBundleNameSet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[bundleNames] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[customBundles] operator[SEP] identifier[add] operator[SEP] identifier[buildJoinableResourceBundle] operator[SEP] identifier[props] , identifier[bundleNames] operator[SEP] identifier[next] operator[SEP] operator[SEP] , identifier[fileExtension] , identifier[rsReaderHandler] operator[SEP] operator[SEP] operator[SEP] } } identifier[Iterator] operator[<] identifier[String] operator[>] identifier[bundleNames] operator[=] identifier[props] operator[SEP] identifier[getPropertyBundleNameSet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[bundleNames] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[bundleName] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[bundleNames] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[bundleNameDependencies] operator[=] identifier[props] operator[SEP] identifier[getCustomBundlePropertyAsList] operator[SEP] identifier[bundleName] , identifier[PropertiesBundleConstant] operator[SEP] identifier[BUNDLE_FACTORY_CUSTOM_DEPENDENCIES] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[bundleNameDependencies] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[JoinableResourceBundle] identifier[bundle] operator[=] identifier[getBundleFromName] operator[SEP] identifier[bundleName] , identifier[customBundles] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[JoinableResourceBundle] operator[>] identifier[bundleDependencies] operator[=] identifier[getBundlesFromName] operator[SEP] identifier[bundleNameDependencies] , identifier[customBundles] operator[SEP] operator[SEP] identifier[bundle] operator[SEP] identifier[setDependencies] operator[SEP] identifier[bundleDependencies] operator[SEP] operator[SEP] } } Keyword[return] identifier[customBundles] operator[SEP] }
public void load(ResourceLocation resourceLocation) { try { IResource res = Minecraft.getMinecraft().getResourceManager().getResource(resourceLocation); load(res.getInputStream()); } catch (IOException e) { MalisisCore.log.error("[ObjFileImporter] An error happened while reading the file : {}", resourceLocation, e); } }
class class_name[name] begin[{] method[load, return_type[void], modifier[public], parameter[resourceLocation]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMinecraft, postfix_operators=[], prefix_operators=[], qualifier=Minecraft, selectors=[MethodInvocation(arguments=[], member=getResourceManager, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=resourceLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=res)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IResource, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None)], member=load, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[ObjFileImporter] An error happened while reading the file : {}"), MemberReference(member=resourceLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=MalisisCore.log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[load] operator[SEP] identifier[ResourceLocation] identifier[resourceLocation] operator[SEP] { Keyword[try] { identifier[IResource] identifier[res] operator[=] identifier[Minecraft] operator[SEP] identifier[getMinecraft] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getResource] operator[SEP] identifier[resourceLocation] operator[SEP] operator[SEP] identifier[load] operator[SEP] identifier[res] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[MalisisCore] operator[SEP] identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[resourceLocation] , identifier[e] operator[SEP] operator[SEP] } }
protected OperationResponse internalExecute(final ModelNode operation, final OperationMessageHandler handler, final OperationTransactionControl control, final OperationAttachments attachments, final OperationStepHandler prepareStep, final boolean attemptLock, boolean partialModel) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(ModelController.ACCESS_PERMISSION); } final ModelNode responseNode = validateOperation(operation); if(responseNode.hasDefined(FAILURE_DESCRIPTION)) { return OperationResponse.Factory.createSimple(responseNode); } OperationHeaders headers; try { headers = OperationHeaders.fromOperation(operation); } catch (OperationFailedException ofe) { return OperationHeaders.fromFailure(ofe); } // Report the correct operation response, otherwise the preparedResult would only contain // the result of the last active step in a composite operation final OperationTransactionControl originalResultTxControl = control == null ? null : new OperationTransactionControl() { @Override public void operationPrepared(OperationTransaction transaction, ModelNode result, OperationContext context) { control.operationPrepared(transaction, responseNode, context); } @Override public void operationPrepared(OperationTransaction transaction, ModelNode result) { control.operationPrepared(transaction, responseNode); } }; Map<String, OperationResponse.StreamEntry> responseStreams; AccessMechanism accessMechanism = null; AccessAuditContext accessContext = SecurityActions.currentAccessAuditContext(); if (accessContext != null) { // External caller of some sort. // Internal domain ManagementRequestHandler impls will set a header to track an op through the domain // This header will only be set at this point if the request came in that way; for user-originated // requests on this process the header is added later during op execution by OperationCoordinatorStepHandler if (headers.getDomainUUID() != null) { accessContext.setDomainUuid(headers.getDomainUUID()); accessContext.setDomainRollout(true); } // Native and http ManagementRequestHandler impls, plus those used for intra-domain comms // will always set a header to specify the access mechanism. JMX directly sets it on the accessContext if (headers.getAccessMechanism() != null) { accessContext.setAccessMechanism(headers.getAccessMechanism()); } accessMechanism = accessContext.getAccessMechanism(); } // else its an internal caller as external callers always get an AccessAuditContext // WFCORE-184. Exclude external callers during boot. AccessMechanism is always set for external callers if (accessMechanism != null && bootingFlag.get()) { return handleExternalRequestDuringBoot(); } for (;;) { responseStreams = null; // Create a random operation-id final Integer operationID = random.nextInt(); final OperationContextImpl context = new OperationContextImpl(operationID, operation.get(OP).asString(), operation.get(OP_ADDR), this, processType, runningModeControl.getRunningMode(), headers, handler, attachments, managementModel.get(), originalResultTxControl, processState, auditLogger, bootingFlag.get(), hostServerGroupTracker, accessContext, notificationSupport, false, extraValidationStepHandler, partialModel, securityIdentitySupplier); // Try again if the operation-id is already taken if(activeOperations.putIfAbsent(operationID, context) == null) { //noinspection deprecation CurrentOperationIdHolder.setCurrentOperationID(operationID); boolean shouldUnlock = false; try { if (attemptLock) { if (!controllerLock.detectDeadlockAndGetLock(operationID)) { responseNode.get(OUTCOME).set(FAILED); responseNode.get(FAILURE_DESCRIPTION).set(ControllerLogger.ROOT_LOGGER.cannotGetControllerLock()); return OperationResponse.Factory.createSimple(responseNode); } shouldUnlock = true; } context.addStep(responseNode, operation, prepareStep, OperationContext.Stage.MODEL); ControllerLogger.MGMT_OP_LOGGER.tracef("Executing %s", operation); context.executeOperation(); responseStreams = context.getResponseStreams(); } catch (Error e) { try { controllerUnstable(); } catch (Error ignored) { // we already have the main error } throw e; } finally { if (!responseNode.hasDefined(RESPONSE_HEADERS) || !responseNode.get(RESPONSE_HEADERS).hasDefined(PROCESS_STATE)) { ControlledProcessState.State state = processState.getState(); switch (state) { case RELOAD_REQUIRED: case RESTART_REQUIRED: responseNode.get(RESPONSE_HEADERS, PROCESS_STATE).set(state.toString()); break; default: break; } } if (shouldUnlock) { controllerLock.unlock(operationID); } activeOperations.remove(operationID); //noinspection deprecation CurrentOperationIdHolder.setCurrentOperationID(null); } break; } } if (responseStreams == null || responseStreams.size() == 0) { return OperationResponse.Factory.createSimple(responseNode); } else { return new OperationResponseImpl(responseNode, responseStreams); } }
class class_name[name] begin[{] method[internalExecute, return_type[type[OperationResponse]], modifier[protected], parameter[operation, handler, control, attachments, prepareStep, attemptLock, partialModel]] begin[{] local_variable[type[SecurityManager], sm] if[binary_operation[member[.sm], !=, literal[null]]] begin[{] call[sm.checkPermission, parameter[member[ModelController.ACCESS_PERMISSION]]] else begin[{] None end[}] local_variable[type[ModelNode], responseNode] if[call[responseNode.hasDefined, parameter[member[.FAILURE_DESCRIPTION]]]] begin[{] return[call[OperationResponse.Factory.createSimple, parameter[member[.responseNode]]]] else begin[{] None end[}] local_variable[type[OperationHeaders], headers] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=headers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=operation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromOperation, postfix_operators=[], prefix_operators=[], qualifier=OperationHeaders, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=ofe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromFailure, postfix_operators=[], prefix_operators=[], qualifier=OperationHeaders, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ofe, types=['OperationFailedException']))], finally_block=None, label=None, resources=None) local_variable[type[OperationTransactionControl], originalResultTxControl] local_variable[type[Map], responseStreams] local_variable[type[AccessMechanism], accessMechanism] local_variable[type[AccessAuditContext], accessContext] if[binary_operation[member[.accessContext], !=, literal[null]]] begin[{] if[binary_operation[call[headers.getDomainUUID, parameter[]], !=, literal[null]]] begin[{] call[accessContext.setDomainUuid, parameter[call[headers.getDomainUUID, parameter[]]]] call[accessContext.setDomainRollout, parameter[literal[true]]] else begin[{] None end[}] if[binary_operation[call[headers.getAccessMechanism, parameter[]], !=, literal[null]]] begin[{] call[accessContext.setAccessMechanism, parameter[call[headers.getAccessMechanism, parameter[]]]] else begin[{] None end[}] assign[member[.accessMechanism], call[accessContext.getAccessMechanism, parameter[]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.accessMechanism], !=, literal[null]], &&, call[bootingFlag.get, parameter[]]]] begin[{] return[call[.handleExternalRequestDuringBoot, parameter[]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=responseStreams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=random, selectors=[], type_arguments=None), name=operationID)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=operationID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=OP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=operation, selectors=[MethodInvocation(arguments=[], member=asString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=OP_ADDR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=operation, selectors=[], type_arguments=None), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=processType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getRunningMode, postfix_operators=[], prefix_operators=[], qualifier=runningModeControl, selectors=[], type_arguments=None), MemberReference(member=headers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attachments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=managementModel, selectors=[], type_arguments=None), MemberReference(member=originalResultTxControl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=processState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=auditLogger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=bootingFlag, selectors=[], type_arguments=None), MemberReference(member=hostServerGroupTracker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=accessContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=notificationSupport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=extraValidationStepHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=partialModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=securityIdentitySupplier, 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=OperationContextImpl, sub_type=None)), name=context)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=OperationContextImpl, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=operationID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putIfAbsent, postfix_operators=[], prefix_operators=[], qualifier=activeOperations, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=operationID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCurrentOperationID, postfix_operators=[], prefix_operators=[], qualifier=CurrentOperationIdHolder, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=shouldUnlock)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), TryStatement(block=[IfStatement(condition=MemberReference(member=attemptLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=operationID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=detectDeadlockAndGetLock, postfix_operators=[], prefix_operators=['!'], qualifier=controllerLock, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=OUTCOME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=responseNode, selectors=[MethodInvocation(arguments=[MemberReference(member=FAILED, postfix_operators=[], prefix_operators=[], qualifier=, 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=FAILURE_DESCRIPTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=responseNode, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=cannotGetControllerLock, postfix_operators=[], prefix_operators=[], qualifier=ControllerLogger.ROOT_LOGGER, selectors=[], type_arguments=None)], member=set, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=responseNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createSimple, postfix_operators=[], prefix_operators=[], qualifier=OperationResponse.Factory, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=shouldUnlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=responseNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=operation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prepareStep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MODEL, postfix_operators=[], prefix_operators=[], qualifier=OperationContext.Stage, selectors=[])], member=addStep, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Executing %s"), MemberReference(member=operation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=tracef, postfix_operators=[], prefix_operators=[], qualifier=ControllerLogger.MGMT_OP_LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=executeOperation, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=responseStreams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getResponseStreams, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=controllerUnstable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['Error']))], finally_block=None, label=None, resources=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Error']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=RESPONSE_HEADERS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasDefined, postfix_operators=[], prefix_operators=['!'], qualifier=responseNode, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=RESPONSE_HEADERS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=['!'], qualifier=responseNode, selectors=[MethodInvocation(arguments=[MemberReference(member=PROCESS_STATE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasDefined, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getState, postfix_operators=[], prefix_operators=[], qualifier=processState, selectors=[], type_arguments=None), name=state)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ControlledProcessState, sub_type=ReferenceType(arguments=None, dimensions=None, name=State, sub_type=None))), SwitchStatement(cases=[SwitchStatementCase(case=['RELOAD_REQUIRED', 'RESTART_REQUIRED'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=RESPONSE_HEADERS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=PROCESS_STATE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=responseNode, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[], type_arguments=None)], member=set, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), IfStatement(condition=MemberReference(member=shouldUnlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=operationID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=controllerLock, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=operationID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=activeOperations, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setCurrentOperationID, postfix_operators=[], prefix_operators=[], qualifier=CurrentOperationIdHolder, selectors=[], type_arguments=None), label=None)], label=None, resources=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=None, init=None, update=None), label=None) if[binary_operation[binary_operation[member[.responseStreams], ==, literal[null]], ||, binary_operation[call[responseStreams.size, parameter[]], ==, literal[0]]]] begin[{] return[call[OperationResponse.Factory.createSimple, parameter[member[.responseNode]]]] else begin[{] return[ClassCreator(arguments=[MemberReference(member=responseNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=responseStreams, 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=OperationResponseImpl, sub_type=None))] end[}] end[}] END[}]
Keyword[protected] identifier[OperationResponse] identifier[internalExecute] operator[SEP] Keyword[final] identifier[ModelNode] identifier[operation] , Keyword[final] identifier[OperationMessageHandler] identifier[handler] , Keyword[final] identifier[OperationTransactionControl] identifier[control] , Keyword[final] identifier[OperationAttachments] identifier[attachments] , Keyword[final] identifier[OperationStepHandler] identifier[prepareStep] , Keyword[final] Keyword[boolean] identifier[attemptLock] , Keyword[boolean] identifier[partialModel] operator[SEP] { identifier[SecurityManager] identifier[sm] operator[=] identifier[System] operator[SEP] identifier[getSecurityManager] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sm] operator[!=] Other[null] operator[SEP] { identifier[sm] operator[SEP] identifier[checkPermission] operator[SEP] identifier[ModelController] operator[SEP] identifier[ACCESS_PERMISSION] operator[SEP] operator[SEP] } Keyword[final] identifier[ModelNode] identifier[responseNode] operator[=] identifier[validateOperation] operator[SEP] identifier[operation] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[responseNode] operator[SEP] identifier[hasDefined] operator[SEP] identifier[FAILURE_DESCRIPTION] operator[SEP] operator[SEP] { Keyword[return] identifier[OperationResponse] operator[SEP] identifier[Factory] operator[SEP] identifier[createSimple] operator[SEP] identifier[responseNode] operator[SEP] operator[SEP] } identifier[OperationHeaders] identifier[headers] operator[SEP] Keyword[try] { identifier[headers] operator[=] identifier[OperationHeaders] operator[SEP] identifier[fromOperation] operator[SEP] identifier[operation] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[OperationFailedException] identifier[ofe] operator[SEP] { Keyword[return] identifier[OperationHeaders] operator[SEP] identifier[fromFailure] operator[SEP] identifier[ofe] operator[SEP] operator[SEP] } Keyword[final] identifier[OperationTransactionControl] identifier[originalResultTxControl] operator[=] identifier[control] operator[==] Other[null] operator[?] Other[null] operator[:] Keyword[new] identifier[OperationTransactionControl] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[operationPrepared] operator[SEP] identifier[OperationTransaction] identifier[transaction] , identifier[ModelNode] identifier[result] , identifier[OperationContext] identifier[context] operator[SEP] { identifier[control] operator[SEP] identifier[operationPrepared] operator[SEP] identifier[transaction] , identifier[responseNode] , identifier[context] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[operationPrepared] operator[SEP] identifier[OperationTransaction] identifier[transaction] , identifier[ModelNode] identifier[result] operator[SEP] { identifier[control] operator[SEP] identifier[operationPrepared] operator[SEP] identifier[transaction] , identifier[responseNode] operator[SEP] operator[SEP] } } operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[OperationResponse] operator[SEP] identifier[StreamEntry] operator[>] identifier[responseStreams] operator[SEP] identifier[AccessMechanism] identifier[accessMechanism] operator[=] Other[null] operator[SEP] identifier[AccessAuditContext] identifier[accessContext] operator[=] identifier[SecurityActions] operator[SEP] identifier[currentAccessAuditContext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[accessContext] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[headers] operator[SEP] identifier[getDomainUUID] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[accessContext] operator[SEP] identifier[setDomainUuid] operator[SEP] identifier[headers] operator[SEP] identifier[getDomainUUID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[accessContext] operator[SEP] identifier[setDomainRollout] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[headers] operator[SEP] identifier[getAccessMechanism] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[accessContext] operator[SEP] identifier[setAccessMechanism] operator[SEP] identifier[headers] operator[SEP] identifier[getAccessMechanism] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[accessMechanism] operator[=] identifier[accessContext] operator[SEP] identifier[getAccessMechanism] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[accessMechanism] operator[!=] Other[null] operator[&&] identifier[bootingFlag] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[handleExternalRequestDuringBoot] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[responseStreams] operator[=] Other[null] operator[SEP] Keyword[final] identifier[Integer] identifier[operationID] operator[=] identifier[random] operator[SEP] identifier[nextInt] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[OperationContextImpl] identifier[context] operator[=] Keyword[new] identifier[OperationContextImpl] operator[SEP] identifier[operationID] , identifier[operation] operator[SEP] identifier[get] operator[SEP] identifier[OP] operator[SEP] operator[SEP] identifier[asString] operator[SEP] operator[SEP] , identifier[operation] operator[SEP] identifier[get] operator[SEP] identifier[OP_ADDR] operator[SEP] , Keyword[this] , identifier[processType] , identifier[runningModeControl] operator[SEP] identifier[getRunningMode] operator[SEP] operator[SEP] , identifier[headers] , identifier[handler] , identifier[attachments] , identifier[managementModel] operator[SEP] identifier[get] operator[SEP] operator[SEP] , identifier[originalResultTxControl] , identifier[processState] , identifier[auditLogger] , identifier[bootingFlag] operator[SEP] identifier[get] operator[SEP] operator[SEP] , identifier[hostServerGroupTracker] , identifier[accessContext] , identifier[notificationSupport] , literal[boolean] , identifier[extraValidationStepHandler] , identifier[partialModel] , identifier[securityIdentitySupplier] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[activeOperations] operator[SEP] identifier[putIfAbsent] operator[SEP] identifier[operationID] , identifier[context] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[CurrentOperationIdHolder] operator[SEP] identifier[setCurrentOperationID] operator[SEP] identifier[operationID] operator[SEP] operator[SEP] Keyword[boolean] identifier[shouldUnlock] operator[=] literal[boolean] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[attemptLock] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[controllerLock] operator[SEP] identifier[detectDeadlockAndGetLock] operator[SEP] identifier[operationID] operator[SEP] operator[SEP] { identifier[responseNode] operator[SEP] identifier[get] operator[SEP] identifier[OUTCOME] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[FAILED] operator[SEP] operator[SEP] identifier[responseNode] operator[SEP] identifier[get] operator[SEP] identifier[FAILURE_DESCRIPTION] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[ControllerLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[cannotGetControllerLock] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[OperationResponse] operator[SEP] identifier[Factory] operator[SEP] identifier[createSimple] operator[SEP] identifier[responseNode] operator[SEP] operator[SEP] } identifier[shouldUnlock] operator[=] literal[boolean] operator[SEP] } identifier[context] operator[SEP] identifier[addStep] operator[SEP] identifier[responseNode] , identifier[operation] , identifier[prepareStep] , identifier[OperationContext] operator[SEP] identifier[Stage] operator[SEP] identifier[MODEL] operator[SEP] operator[SEP] identifier[ControllerLogger] operator[SEP] identifier[MGMT_OP_LOGGER] operator[SEP] identifier[tracef] operator[SEP] literal[String] , identifier[operation] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[executeOperation] operator[SEP] operator[SEP] operator[SEP] identifier[responseStreams] operator[=] identifier[context] operator[SEP] identifier[getResponseStreams] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Error] identifier[e] operator[SEP] { Keyword[try] { identifier[controllerUnstable] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Error] identifier[ignored] operator[SEP] { } Keyword[throw] identifier[e] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] operator[!] identifier[responseNode] operator[SEP] identifier[hasDefined] operator[SEP] identifier[RESPONSE_HEADERS] operator[SEP] operator[||] operator[!] identifier[responseNode] operator[SEP] identifier[get] operator[SEP] identifier[RESPONSE_HEADERS] operator[SEP] operator[SEP] identifier[hasDefined] operator[SEP] identifier[PROCESS_STATE] operator[SEP] operator[SEP] { identifier[ControlledProcessState] operator[SEP] identifier[State] identifier[state] operator[=] identifier[processState] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[state] operator[SEP] { Keyword[case] identifier[RELOAD_REQUIRED] operator[:] Keyword[case] identifier[RESTART_REQUIRED] operator[:] identifier[responseNode] operator[SEP] identifier[get] operator[SEP] identifier[RESPONSE_HEADERS] , identifier[PROCESS_STATE] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[state] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[shouldUnlock] operator[SEP] { identifier[controllerLock] operator[SEP] identifier[unlock] operator[SEP] identifier[operationID] operator[SEP] operator[SEP] } identifier[activeOperations] operator[SEP] identifier[remove] operator[SEP] identifier[operationID] operator[SEP] operator[SEP] identifier[CurrentOperationIdHolder] operator[SEP] identifier[setCurrentOperationID] operator[SEP] Other[null] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[responseStreams] operator[==] Other[null] operator[||] identifier[responseStreams] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[OperationResponse] operator[SEP] identifier[Factory] operator[SEP] identifier[createSimple] operator[SEP] identifier[responseNode] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[OperationResponseImpl] operator[SEP] identifier[responseNode] , identifier[responseStreams] operator[SEP] operator[SEP] } }
void writeArrayItemStart() throws IOException { if (commaState.get(commaDepth)) { output.append(','); if (newLine.length() > 0) { output.append(' '); } } else { commaState.set(commaDepth); } }
class class_name[name] begin[{] method[writeArrayItemStart, return_type[void], modifier[default], parameter[]] begin[{] if[call[commaState.get, parameter[member[.commaDepth]]]] begin[{] call[output.append, parameter[literal[',']]] if[binary_operation[call[newLine.length, parameter[]], >, literal[0]]] begin[{] call[output.append, parameter[literal[' ']]] else begin[{] None end[}] else begin[{] call[commaState.set, parameter[member[.commaDepth]]] end[}] end[}] END[}]
Keyword[void] identifier[writeArrayItemStart] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[commaState] operator[SEP] identifier[get] operator[SEP] identifier[commaDepth] operator[SEP] operator[SEP] { identifier[output] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newLine] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[output] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[else] { identifier[commaState] operator[SEP] identifier[set] operator[SEP] identifier[commaDepth] operator[SEP] operator[SEP] } }