code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
public static String url(PMSession session, String url, Boolean confirm) {
return url(session, url, confirm, "javascript:");
} | class class_name[name] begin[{]
method[url, return_type[type[String]], modifier[public static], parameter[session, url, confirm]] begin[{]
return[call[.url, parameter[member[.session], member[.url], member[.confirm], literal["javascript:"]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[url] operator[SEP] identifier[PMSession] identifier[session] , identifier[String] identifier[url] , identifier[Boolean] identifier[confirm] operator[SEP] {
Keyword[return] identifier[url] operator[SEP] identifier[session] , identifier[url] , identifier[confirm] , literal[String] operator[SEP] operator[SEP]
}
|
public String[] getMealCache(Date dateStart, Date dateEnd) throws Exception
{
int iDays = (int)((dateEnd.getTime() - dateStart.getTime()) / Constants.KMS_IN_A_DAY) + 2;
if (iDays <= 0)
return null;
String[] rgstrMeals = new String[iDays];
Date date = new Date(dateStart.getTime());
for (int iDay = 0; iDay < iDays; iDay++)
{
rgstrMeals[iDay] = this.getRemoteMealDesc(date);
date.setTime(date.getTime() + Constants.KMS_IN_A_DAY);
}
return rgstrMeals;
} | class class_name[name] begin[{]
method[getMealCache, return_type[type[String]], modifier[public], parameter[dateStart, dateEnd]] begin[{]
local_variable[type[int], iDays]
if[binary_operation[member[.iDays], <=, literal[0]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[String], rgstrMeals]
local_variable[type[Date], date]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=rgstrMeals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=iDay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRemoteMealDesc, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=date, selectors=[], type_arguments=None), operandr=MemberReference(member=KMS_IN_A_DAY, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator=+)], member=setTime, postfix_operators=[], prefix_operators=[], qualifier=date, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=iDay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=iDays, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=iDay)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=iDay, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.rgstrMeals]]
end[}]
END[}] | Keyword[public] identifier[String] operator[SEP] operator[SEP] identifier[getMealCache] operator[SEP] identifier[Date] identifier[dateStart] , identifier[Date] identifier[dateEnd] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[int] identifier[iDays] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[dateEnd] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[-] identifier[dateStart] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[/] identifier[Constants] operator[SEP] identifier[KMS_IN_A_DAY] operator[SEP] operator[+] Other[2] operator[SEP] Keyword[if] operator[SEP] identifier[iDays] operator[<=] Other[0] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[rgstrMeals] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[iDays] operator[SEP] operator[SEP] identifier[Date] identifier[date] operator[=] Keyword[new] identifier[Date] operator[SEP] identifier[dateStart] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[iDay] operator[=] Other[0] operator[SEP] identifier[iDay] operator[<] identifier[iDays] operator[SEP] identifier[iDay] operator[++] operator[SEP] {
identifier[rgstrMeals] operator[SEP] identifier[iDay] operator[SEP] operator[=] Keyword[this] operator[SEP] identifier[getRemoteMealDesc] operator[SEP] identifier[date] operator[SEP] operator[SEP] identifier[date] operator[SEP] identifier[setTime] operator[SEP] identifier[date] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[+] identifier[Constants] operator[SEP] identifier[KMS_IN_A_DAY] operator[SEP] operator[SEP]
}
Keyword[return] identifier[rgstrMeals] operator[SEP]
}
|
public static <T, C> ObjectArrayTypeInfo<T, C> getInfoFor(Type type, TypeInformation<C> componentInfo) {
// generic array type e.g. for Tuples
if (type instanceof GenericArrayType) {
GenericArrayType genericArray = (GenericArrayType) type;
return new ObjectArrayTypeInfo<T, C>(type, genericArray.getGenericComponentType(), componentInfo);
}
// for tuples without generics (e.g. generated by the TypeInformation parser)
else if (type instanceof Class<?> && ((Class<?>) type).isArray() && Tuple.class.isAssignableFrom(((Class<?>) type).getComponentType())
&& type != Tuple.class) {
return new ObjectArrayTypeInfo<T, C>(type, ((Class<?>) type).getComponentType(), componentInfo);
}
return getInfoFor(type);
} | class class_name[name] begin[{]
method[getInfoFor, return_type[type[ObjectArrayTypeInfo]], modifier[public static], parameter[type, componentInfo]] begin[{]
if[binary_operation[member[.type], instanceof, type[GenericArrayType]]] begin[{]
local_variable[type[GenericArrayType], genericArray]
return[ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getGenericComponentType, postfix_operators=[], prefix_operators=[], qualifier=genericArray, selectors=[], type_arguments=None), MemberReference(member=componentInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=C, sub_type=None))], dimensions=None, name=ObjectArrayTypeInfo, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.type], instanceof, type[Class]], &&, 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))], &&, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[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))], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Tuple, sub_type=None))], &&, binary_operation[member[.type], !=, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Tuple, sub_type=None))]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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)), MemberReference(member=componentInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=C, sub_type=None))], dimensions=None, name=ObjectArrayTypeInfo, sub_type=None))]
else begin[{]
None
end[}]
end[}]
return[call[.getInfoFor, parameter[member[.type]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[C] operator[>] identifier[ObjectArrayTypeInfo] operator[<] identifier[T] , identifier[C] operator[>] identifier[getInfoFor] operator[SEP] identifier[Type] identifier[type] , identifier[TypeInformation] operator[<] identifier[C] operator[>] identifier[componentInfo] operator[SEP] {
Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[GenericArrayType] operator[SEP] {
identifier[GenericArrayType] identifier[genericArray] operator[=] operator[SEP] identifier[GenericArrayType] operator[SEP] identifier[type] operator[SEP] Keyword[return] Keyword[new] identifier[ObjectArrayTypeInfo] operator[<] identifier[T] , identifier[C] operator[>] operator[SEP] identifier[type] , identifier[genericArray] operator[SEP] identifier[getGenericComponentType] operator[SEP] operator[SEP] , identifier[componentInfo] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[Class] operator[<] operator[?] operator[>] operator[&&] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[&&] identifier[Tuple] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[type] operator[!=] identifier[Tuple] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] Keyword[new] identifier[ObjectArrayTypeInfo] operator[<] identifier[T] , identifier[C] operator[>] operator[SEP] identifier[type] , operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] , identifier[componentInfo] operator[SEP] operator[SEP]
}
Keyword[return] identifier[getInfoFor] operator[SEP] identifier[type] operator[SEP] operator[SEP]
}
|
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WCheckBox checkBox = (WCheckBox) component;
XmlStringBuilder xml = renderContext.getWriter();
boolean readOnly = checkBox.isReadOnly();
xml.appendTagOpen(TAG_NAME);
xml.appendAttribute("id", component.getId());
xml.appendOptionalAttribute("class", component.getHtmlClass());
xml.appendOptionalAttribute("track", component.isTracking(), "true");
xml.appendOptionalAttribute("hidden", checkBox.isHidden(), "true");
xml.appendOptionalAttribute("selected", checkBox.isSelected(), "true");
if (readOnly) {
xml.appendAttribute("readOnly", "true");
xml.appendEnd();
return;
}
WComponent submitControl = checkBox.getDefaultSubmitButton();
String submitControlId = submitControl == null ? null : submitControl.getId();
WComponentGroup<WCheckBox> group = checkBox.getGroup();
String groupName = group == null ? null : group.getId();
xml.appendOptionalAttribute("groupName", groupName);
xml.appendOptionalAttribute("disabled", checkBox.isDisabled(), "true");
xml.appendOptionalAttribute("required", checkBox.isMandatory(), "true");
xml.appendOptionalAttribute("submitOnChange", checkBox.isSubmitOnChange(), "true");
xml.appendOptionalAttribute("toolTip", checkBox.getToolTip());
xml.appendOptionalAttribute("accessibleText", checkBox.getAccessibleText());
xml.appendOptionalAttribute("buttonId", submitControlId);
List<Diagnostic> diags = checkBox.getDiagnostics(Diagnostic.ERROR);
if (diags == null || diags.isEmpty()) {
xml.appendEnd();
return;
}
xml.appendClose();
DiagnosticRenderUtil.renderDiagnostics(checkBox, renderContext);
xml.appendEndTag(TAG_NAME);
} | class class_name[name] begin[{]
method[doRender, return_type[void], modifier[public], parameter[component, renderContext]] begin[{]
local_variable[type[WCheckBox], checkBox]
local_variable[type[XmlStringBuilder], xml]
local_variable[type[boolean], readOnly]
call[xml.appendTagOpen, parameter[member[.TAG_NAME]]]
call[xml.appendAttribute, parameter[literal["id"], call[component.getId, parameter[]]]]
call[xml.appendOptionalAttribute, parameter[literal["class"], call[component.getHtmlClass, parameter[]]]]
call[xml.appendOptionalAttribute, parameter[literal["track"], call[component.isTracking, parameter[]], literal["true"]]]
call[xml.appendOptionalAttribute, parameter[literal["hidden"], call[checkBox.isHidden, parameter[]], literal["true"]]]
call[xml.appendOptionalAttribute, parameter[literal["selected"], call[checkBox.isSelected, parameter[]], literal["true"]]]
if[member[.readOnly]] begin[{]
call[xml.appendAttribute, parameter[literal["readOnly"], literal["true"]]]
call[xml.appendEnd, parameter[]]
return[None]
else begin[{]
None
end[}]
local_variable[type[WComponent], submitControl]
local_variable[type[String], submitControlId]
local_variable[type[WComponentGroup], group]
local_variable[type[String], groupName]
call[xml.appendOptionalAttribute, parameter[literal["groupName"], member[.groupName]]]
call[xml.appendOptionalAttribute, parameter[literal["disabled"], call[checkBox.isDisabled, parameter[]], literal["true"]]]
call[xml.appendOptionalAttribute, parameter[literal["required"], call[checkBox.isMandatory, parameter[]], literal["true"]]]
call[xml.appendOptionalAttribute, parameter[literal["submitOnChange"], call[checkBox.isSubmitOnChange, parameter[]], literal["true"]]]
call[xml.appendOptionalAttribute, parameter[literal["toolTip"], call[checkBox.getToolTip, parameter[]]]]
call[xml.appendOptionalAttribute, parameter[literal["accessibleText"], call[checkBox.getAccessibleText, parameter[]]]]
call[xml.appendOptionalAttribute, parameter[literal["buttonId"], member[.submitControlId]]]
local_variable[type[List], diags]
if[binary_operation[binary_operation[member[.diags], ==, literal[null]], ||, call[diags.isEmpty, parameter[]]]] begin[{]
call[xml.appendEnd, parameter[]]
return[None]
else begin[{]
None
end[}]
call[xml.appendClose, parameter[]]
call[DiagnosticRenderUtil.renderDiagnostics, parameter[member[.checkBox], member[.renderContext]]]
call[xml.appendEndTag, parameter[member[.TAG_NAME]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doRender] operator[SEP] Keyword[final] identifier[WComponent] identifier[component] , Keyword[final] identifier[WebXmlRenderContext] identifier[renderContext] operator[SEP] {
identifier[WCheckBox] identifier[checkBox] operator[=] operator[SEP] identifier[WCheckBox] operator[SEP] identifier[component] operator[SEP] identifier[XmlStringBuilder] identifier[xml] operator[=] identifier[renderContext] operator[SEP] identifier[getWriter] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[readOnly] operator[=] identifier[checkBox] operator[SEP] identifier[isReadOnly] operator[SEP] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendTagOpen] operator[SEP] identifier[TAG_NAME] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendAttribute] operator[SEP] literal[String] , identifier[component] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendOptionalAttribute] operator[SEP] literal[String] , identifier[component] operator[SEP] identifier[getHtmlClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendOptionalAttribute] operator[SEP] literal[String] , identifier[component] operator[SEP] identifier[isTracking] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendOptionalAttribute] operator[SEP] literal[String] , identifier[checkBox] operator[SEP] identifier[isHidden] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendOptionalAttribute] operator[SEP] literal[String] , identifier[checkBox] operator[SEP] identifier[isSelected] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[readOnly] operator[SEP] {
identifier[xml] operator[SEP] identifier[appendAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendEnd] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[WComponent] identifier[submitControl] operator[=] identifier[checkBox] operator[SEP] identifier[getDefaultSubmitButton] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[submitControlId] operator[=] identifier[submitControl] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[submitControl] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[WComponentGroup] operator[<] identifier[WCheckBox] operator[>] identifier[group] operator[=] identifier[checkBox] operator[SEP] identifier[getGroup] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[groupName] operator[=] identifier[group] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[group] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendOptionalAttribute] operator[SEP] literal[String] , identifier[groupName] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendOptionalAttribute] operator[SEP] literal[String] , identifier[checkBox] operator[SEP] identifier[isDisabled] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendOptionalAttribute] operator[SEP] literal[String] , identifier[checkBox] operator[SEP] identifier[isMandatory] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendOptionalAttribute] operator[SEP] literal[String] , identifier[checkBox] operator[SEP] identifier[isSubmitOnChange] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendOptionalAttribute] operator[SEP] literal[String] , identifier[checkBox] operator[SEP] identifier[getToolTip] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendOptionalAttribute] operator[SEP] literal[String] , identifier[checkBox] operator[SEP] identifier[getAccessibleText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendOptionalAttribute] operator[SEP] literal[String] , identifier[submitControlId] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Diagnostic] operator[>] identifier[diags] operator[=] identifier[checkBox] operator[SEP] identifier[getDiagnostics] operator[SEP] identifier[Diagnostic] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[diags] operator[==] Other[null] operator[||] identifier[diags] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[xml] operator[SEP] identifier[appendEnd] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[xml] operator[SEP] identifier[appendClose] operator[SEP] operator[SEP] operator[SEP] identifier[DiagnosticRenderUtil] operator[SEP] identifier[renderDiagnostics] operator[SEP] identifier[checkBox] , identifier[renderContext] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[appendEndTag] operator[SEP] identifier[TAG_NAME] operator[SEP] operator[SEP]
}
|
public byte[] join(Map<Integer, byte[]> parts) {
checkArgument(parts.size() > 0, "No parts provided");
final int[] lengths = parts.values().stream().mapToInt(v -> v.length).distinct().toArray();
checkArgument(lengths.length == 1, "Varying lengths of part values");
final byte[] secret = new byte[lengths[0]];
for (int i = 0; i < secret.length; i++) {
final byte[][] points = new byte[parts.size()][2];
int j = 0;
for (Map.Entry<Integer, byte[]> part : parts.entrySet()) {
points[j][0] = part.getKey().byteValue();
points[j][1] = part.getValue()[i];
j++;
}
secret[i] = GF256.interpolate(points);
}
return secret;
} | class class_name[name] begin[{]
method[join, return_type[type[byte]], modifier[public], parameter[parts]] begin[{]
call[.checkArgument, parameter[binary_operation[call[parts.size, parameter[]], >, literal[0]], literal["No parts provided"]]]
local_variable[type[int], lengths]
call[.checkArgument, parameter[binary_operation[member[lengths.length], ==, literal[1]], literal["Varying lengths of part values"]]]
local_variable[type[byte], secret]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=parts, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=points)], modifiers={'final'}, type=BasicType(dimensions=[None, None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=points, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=part, selectors=[MethodInvocation(arguments=[], member=byteValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=points, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=part, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=parts, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=part)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=BasicType(dimensions=[None], name=byte))], dimensions=None, name=Entry, sub_type=None)))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=secret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=points, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=interpolate, postfix_operators=[], prefix_operators=[], qualifier=GF256, 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=secret, 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[.secret]]
end[}]
END[}] | Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[join] operator[SEP] identifier[Map] operator[<] identifier[Integer] , Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[parts] operator[SEP] {
identifier[checkArgument] operator[SEP] identifier[parts] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] , literal[String] operator[SEP] operator[SEP] Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[lengths] operator[=] identifier[parts] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[mapToInt] operator[SEP] identifier[v] operator[->] identifier[v] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[distinct] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] identifier[lengths] operator[SEP] identifier[length] operator[==] Other[1] , literal[String] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[secret] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[lengths] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[secret] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[final] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[points] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[parts] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Integer] , Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[part] operator[:] identifier[parts] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[points] operator[SEP] identifier[j] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[=] identifier[part] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[byteValue] operator[SEP] operator[SEP] operator[SEP] identifier[points] operator[SEP] identifier[j] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[=] identifier[part] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP]
}
identifier[secret] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[GF256] operator[SEP] identifier[interpolate] operator[SEP] identifier[points] operator[SEP] operator[SEP]
}
Keyword[return] identifier[secret] operator[SEP]
}
|
public static Option[] combine( final Option[] options1,
final Option... options2 )
{
int size1 = 0;
if( options1 != null && options1.length > 0 )
{
size1 += options1.length;
}
int size2 = 0;
if( options2 != null && options2.length > 0 )
{
size2 += options2.length;
}
final Option[] combined = new Option[size1 + size2];
if( size1 > 0 )
{
System.arraycopy( options1, 0, combined, 0, size1 );
}
if( size2 > 0 )
{
System.arraycopy( options2, 0, combined, size1, size2 );
}
return combined;
} | class class_name[name] begin[{]
method[combine, return_type[type[Option]], modifier[public static], parameter[options1, options2]] begin[{]
local_variable[type[int], size1]
if[binary_operation[binary_operation[member[.options1], !=, literal[null]], &&, binary_operation[member[options1.length], >, literal[0]]]] begin[{]
assign[member[.size1], member[options1.length]]
else begin[{]
None
end[}]
local_variable[type[int], size2]
if[binary_operation[binary_operation[member[.options2], !=, literal[null]], &&, binary_operation[member[options2.length], >, literal[0]]]] begin[{]
assign[member[.size2], member[options2.length]]
else begin[{]
None
end[}]
local_variable[type[Option], combined]
if[binary_operation[member[.size1], >, literal[0]]] begin[{]
call[System.arraycopy, parameter[member[.options1], literal[0], member[.combined], literal[0], member[.size1]]]
else begin[{]
None
end[}]
if[binary_operation[member[.size2], >, literal[0]]] begin[{]
call[System.arraycopy, parameter[member[.options2], literal[0], member[.combined], member[.size1], member[.size2]]]
else begin[{]
None
end[}]
return[member[.combined]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Option] operator[SEP] operator[SEP] identifier[combine] operator[SEP] Keyword[final] identifier[Option] operator[SEP] operator[SEP] identifier[options1] , Keyword[final] identifier[Option] operator[...] identifier[options2] operator[SEP] {
Keyword[int] identifier[size1] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[options1] operator[!=] Other[null] operator[&&] identifier[options1] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
identifier[size1] operator[+=] identifier[options1] operator[SEP] identifier[length] operator[SEP]
}
Keyword[int] identifier[size2] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[options2] operator[!=] Other[null] operator[&&] identifier[options2] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
identifier[size2] operator[+=] identifier[options2] operator[SEP] identifier[length] operator[SEP]
}
Keyword[final] identifier[Option] operator[SEP] operator[SEP] identifier[combined] operator[=] Keyword[new] identifier[Option] operator[SEP] identifier[size1] operator[+] identifier[size2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size1] operator[>] Other[0] operator[SEP] {
identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[options1] , Other[0] , identifier[combined] , Other[0] , identifier[size1] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[size2] operator[>] Other[0] operator[SEP] {
identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[options2] , Other[0] , identifier[combined] , identifier[size1] , identifier[size2] operator[SEP] operator[SEP]
}
Keyword[return] identifier[combined] operator[SEP]
}
|
@PostAuthorize("hasRole(@configHolder.getSuperAdminRoleName()) or hasPermission(#accountName, 'READ')")
@Transactional(readOnly = true)
public E findByAccountName(String accountName) {
return dao.findByAccountName(accountName);
} | class class_name[name] begin[{]
method[findByAccountName, return_type[type[E]], modifier[public], parameter[accountName]] begin[{]
return[call[dao.findByAccountName, parameter[member[.accountName]]]]
end[}]
END[}] | annotation[@] identifier[PostAuthorize] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Transactional] operator[SEP] identifier[readOnly] operator[=] literal[boolean] operator[SEP] Keyword[public] identifier[E] identifier[findByAccountName] operator[SEP] identifier[String] identifier[accountName] operator[SEP] {
Keyword[return] identifier[dao] operator[SEP] identifier[findByAccountName] operator[SEP] identifier[accountName] operator[SEP] operator[SEP]
}
|
public static PropertyDescriptor getPropertyDescriptor(Class<?> clazz, final String fieldName) throws BeanException {
return getPropertyDescriptor(clazz, fieldName, false);
} | class class_name[name] begin[{]
method[getPropertyDescriptor, return_type[type[PropertyDescriptor]], modifier[public static], parameter[clazz, fieldName]] begin[{]
return[call[.getPropertyDescriptor, parameter[member[.clazz], member[.fieldName], literal[false]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[PropertyDescriptor] identifier[getPropertyDescriptor] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , Keyword[final] identifier[String] identifier[fieldName] operator[SEP] Keyword[throws] identifier[BeanException] {
Keyword[return] identifier[getPropertyDescriptor] operator[SEP] identifier[clazz] , identifier[fieldName] , literal[boolean] operator[SEP] operator[SEP]
}
|
public boolean getBooleanProperty(String key, boolean defaultValue) {
final String value = properties.getProperty(key, String.valueOf(defaultValue));
return Boolean.valueOf(value);
} | class class_name[name] begin[{]
method[getBooleanProperty, return_type[type[boolean]], modifier[public], parameter[key, defaultValue]] begin[{]
local_variable[type[String], value]
return[call[Boolean.valueOf, parameter[member[.value]]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[getBooleanProperty] operator[SEP] identifier[String] identifier[key] , Keyword[boolean] identifier[defaultValue] operator[SEP] {
Keyword[final] identifier[String] identifier[value] operator[=] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[key] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[defaultValue] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
|
public Map<String, Object> getParams() {
return (null == params) ? Conditions.getParamMap(conditions) : CollectUtils.newHashMap(params);
} | class class_name[name] begin[{]
method[getParams, return_type[type[Map]], modifier[public], parameter[]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newHashMap, postfix_operators=[], prefix_operators=[], qualifier=CollectUtils, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=conditions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParamMap, postfix_operators=[], prefix_operators=[], qualifier=Conditions, selectors=[], type_arguments=None))]
end[}]
END[}] | Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[getParams] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] Other[null] operator[==] identifier[params] operator[SEP] operator[?] identifier[Conditions] operator[SEP] identifier[getParamMap] operator[SEP] identifier[conditions] operator[SEP] operator[:] identifier[CollectUtils] operator[SEP] identifier[newHashMap] operator[SEP] identifier[params] operator[SEP] operator[SEP]
}
|
@Override
public void setProperty(String name, Object value) {
session.setProperty(name, value);
} | class class_name[name] begin[{]
method[setProperty, return_type[void], modifier[public], parameter[name, value]] begin[{]
call[session.setProperty, parameter[member[.name], member[.value]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setProperty] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[value] operator[SEP] {
identifier[session] operator[SEP] identifier[setProperty] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP]
}
|
private Cipher getCipher(int mode) throws InvalidKeyException, InvalidAlgorithmParameterException,
UnsupportedEncodingException, NoSuchAlgorithmException, NoSuchPaddingException {
Cipher c = Cipher.getInstance(ALGORYITHM);
byte[] iv = CoreConstants.IV.getBytes(CoreConstants.ENCODE_UTF8);
c.init(mode, cryptKey, new IvParameterSpec(iv));
return c;
} | class class_name[name] begin[{]
method[getCipher, return_type[type[Cipher]], modifier[private], parameter[mode]] begin[{]
local_variable[type[Cipher], c]
local_variable[type[byte], iv]
call[c.init, parameter[member[.mode], member[.cryptKey], ClassCreator(arguments=[MemberReference(member=iv, 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=IvParameterSpec, sub_type=None))]]
return[member[.c]]
end[}]
END[}] | Keyword[private] identifier[Cipher] identifier[getCipher] operator[SEP] Keyword[int] identifier[mode] operator[SEP] Keyword[throws] identifier[InvalidKeyException] , identifier[InvalidAlgorithmParameterException] , identifier[UnsupportedEncodingException] , identifier[NoSuchAlgorithmException] , identifier[NoSuchPaddingException] {
identifier[Cipher] identifier[c] operator[=] identifier[Cipher] operator[SEP] identifier[getInstance] operator[SEP] identifier[ALGORYITHM] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[iv] operator[=] identifier[CoreConstants] operator[SEP] identifier[IV] operator[SEP] identifier[getBytes] operator[SEP] identifier[CoreConstants] operator[SEP] identifier[ENCODE_UTF8] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[init] operator[SEP] identifier[mode] , identifier[cryptKey] , Keyword[new] identifier[IvParameterSpec] operator[SEP] identifier[iv] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[c] operator[SEP]
}
|
protected void response(int code, List<Object> data)
{
response(code, JSONWriter.list2JsonString(data));
} | class class_name[name] begin[{]
method[response, return_type[void], modifier[protected], parameter[code, data]] begin[{]
call[.response, parameter[member[.code], call[JSONWriter.list2JsonString, parameter[member[.data]]]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[response] operator[SEP] Keyword[int] identifier[code] , identifier[List] operator[<] identifier[Object] operator[>] identifier[data] operator[SEP] {
identifier[response] operator[SEP] identifier[code] , identifier[JSONWriter] operator[SEP] identifier[list2JsonString] operator[SEP] identifier[data] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setupPubsub() throws IOException {
ExamplePubsubTopicAndSubscriptionOptions pubsubOptions =
options.as(ExamplePubsubTopicAndSubscriptionOptions.class);
if (!pubsubOptions.getPubsubTopic().isEmpty()) {
pendingMessages.add("**********************Set Up Pubsub************************");
setupPubsubTopic(pubsubOptions.getPubsubTopic());
pendingMessages.add("The Pub/Sub topic has been set up for this example: "
+ pubsubOptions.getPubsubTopic());
if (!pubsubOptions.getPubsubSubscription().isEmpty()) {
setupPubsubSubscription(
pubsubOptions.getPubsubTopic(), pubsubOptions.getPubsubSubscription());
pendingMessages.add("The Pub/Sub subscription has been set up for this example: "
+ pubsubOptions.getPubsubSubscription());
}
}
} | class class_name[name] begin[{]
method[setupPubsub, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[ExamplePubsubTopicAndSubscriptionOptions], pubsubOptions]
if[call[pubsubOptions.getPubsubTopic, parameter[]]] begin[{]
call[pendingMessages.add, parameter[literal["**********************Set Up Pubsub************************"]]]
call[.setupPubsubTopic, parameter[call[pubsubOptions.getPubsubTopic, parameter[]]]]
call[pendingMessages.add, parameter[binary_operation[literal["The Pub/Sub topic has been set up for this example: "], +, call[pubsubOptions.getPubsubTopic, parameter[]]]]]
if[call[pubsubOptions.getPubsubSubscription, parameter[]]] begin[{]
call[.setupPubsubSubscription, parameter[call[pubsubOptions.getPubsubTopic, parameter[]], call[pubsubOptions.getPubsubSubscription, parameter[]]]]
call[pendingMessages.add, parameter[binary_operation[literal["The Pub/Sub subscription has been set up for this example: "], +, call[pubsubOptions.getPubsubSubscription, parameter[]]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setupPubsub] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[ExamplePubsubTopicAndSubscriptionOptions] identifier[pubsubOptions] operator[=] identifier[options] operator[SEP] identifier[as] operator[SEP] identifier[ExamplePubsubTopicAndSubscriptionOptions] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[pubsubOptions] operator[SEP] identifier[getPubsubTopic] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[pendingMessages] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[setupPubsubTopic] operator[SEP] identifier[pubsubOptions] operator[SEP] identifier[getPubsubTopic] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pendingMessages] operator[SEP] identifier[add] operator[SEP] literal[String] operator[+] identifier[pubsubOptions] operator[SEP] identifier[getPubsubTopic] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[pubsubOptions] operator[SEP] identifier[getPubsubSubscription] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[setupPubsubSubscription] operator[SEP] identifier[pubsubOptions] operator[SEP] identifier[getPubsubTopic] operator[SEP] operator[SEP] , identifier[pubsubOptions] operator[SEP] identifier[getPubsubSubscription] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pendingMessages] operator[SEP] identifier[add] operator[SEP] literal[String] operator[+] identifier[pubsubOptions] operator[SEP] identifier[getPubsubSubscription] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
protected void initializeVariables(ExecutionEntity subProcessInstance, Map<String,Object> variables) {
subProcessInstance.setVariables(variables);
} | class class_name[name] begin[{]
method[initializeVariables, return_type[void], modifier[protected], parameter[subProcessInstance, variables]] begin[{]
call[subProcessInstance.setVariables, parameter[member[.variables]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[initializeVariables] operator[SEP] identifier[ExecutionEntity] identifier[subProcessInstance] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[variables] operator[SEP] {
identifier[subProcessInstance] operator[SEP] identifier[setVariables] operator[SEP] identifier[variables] operator[SEP] operator[SEP]
}
|
@Override
public ISBNParsedResult parse(Result result) {
BarcodeFormat format = result.getBarcodeFormat();
if (format != BarcodeFormat.EAN_13) {
return null;
}
String rawText = getMassagedText(result);
int length = rawText.length();
if (length != 13) {
return null;
}
if (!rawText.startsWith("978") && !rawText.startsWith("979")) {
return null;
}
return new ISBNParsedResult(rawText);
} | class class_name[name] begin[{]
method[parse, return_type[type[ISBNParsedResult]], modifier[public], parameter[result]] begin[{]
local_variable[type[BarcodeFormat], format]
if[binary_operation[member[.format], !=, member[BarcodeFormat.EAN_13]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[String], rawText]
local_variable[type[int], length]
if[binary_operation[member[.length], !=, literal[13]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[call[rawText.startsWith, parameter[literal["978"]]], &&, call[rawText.startsWith, parameter[literal["979"]]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=rawText, 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=ISBNParsedResult, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ISBNParsedResult] identifier[parse] operator[SEP] identifier[Result] identifier[result] operator[SEP] {
identifier[BarcodeFormat] identifier[format] operator[=] identifier[result] operator[SEP] identifier[getBarcodeFormat] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[format] operator[!=] identifier[BarcodeFormat] operator[SEP] identifier[EAN_13] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[String] identifier[rawText] operator[=] identifier[getMassagedText] operator[SEP] identifier[result] operator[SEP] operator[SEP] Keyword[int] identifier[length] operator[=] identifier[rawText] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[length] operator[!=] Other[13] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[rawText] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[rawText] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[return] Keyword[new] identifier[ISBNParsedResult] operator[SEP] identifier[rawText] operator[SEP] operator[SEP]
}
|
protected final Path pathFrom( Path parentPath,
String childPath ) {
Path parent = pathFactory().create(parentPath);
return pathFactory().create(parent, childPath);
} | class class_name[name] begin[{]
method[pathFrom, return_type[type[Path]], modifier[final protected], parameter[parentPath, childPath]] begin[{]
local_variable[type[Path], parent]
return[call[.pathFactory, parameter[]]]
end[}]
END[}] | Keyword[protected] Keyword[final] identifier[Path] identifier[pathFrom] operator[SEP] identifier[Path] identifier[parentPath] , identifier[String] identifier[childPath] operator[SEP] {
identifier[Path] identifier[parent] operator[=] identifier[pathFactory] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] identifier[parentPath] operator[SEP] operator[SEP] Keyword[return] identifier[pathFactory] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] identifier[parent] , identifier[childPath] operator[SEP] operator[SEP]
}
|
@Override
public void addTag(String tagName, int value, Map attributes)
{
addTag(tagName, String.valueOf(value), attributes);
} | class class_name[name] begin[{]
method[addTag, return_type[void], modifier[public], parameter[tagName, value, attributes]] begin[{]
call[.addTag, parameter[member[.tagName], call[String.valueOf, parameter[member[.value]]], member[.attributes]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[addTag] operator[SEP] identifier[String] identifier[tagName] , Keyword[int] identifier[value] , identifier[Map] identifier[attributes] operator[SEP] {
identifier[addTag] operator[SEP] identifier[tagName] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] , identifier[attributes] operator[SEP] operator[SEP]
}
|
@Override
public MapService createMapService() {
NodeEngine nodeEngine = getNodeEngine();
MapServiceContext mapServiceContext = getMapServiceContext();
ManagedService managedService = createManagedService();
CountingMigrationAwareService migrationAwareService = createMigrationAwareService();
TransactionalService transactionalService = createTransactionalService();
RemoteService remoteService = createRemoteService();
EventPublishingService eventPublishingService = createEventPublishingService();
PostJoinAwareService postJoinAwareService = createPostJoinAwareService();
SplitBrainHandlerService splitBrainHandlerService = createSplitBrainHandlerService();
ReplicationSupportingService replicationSupportingService = createReplicationSupportingService();
StatisticsAwareService statisticsAwareService = createStatisticsAwareService();
PartitionAwareService partitionAwareService = createPartitionAwareService();
MapQuorumAwareService quorumAwareService = createQuorumAwareService();
ClientAwareService clientAwareService = createClientAwareService();
checkNotNull(nodeEngine, "nodeEngine should not be null");
checkNotNull(mapServiceContext, "mapServiceContext should not be null");
checkNotNull(managedService, "managedService should not be null");
checkNotNull(migrationAwareService, "migrationAwareService should not be null");
checkNotNull(transactionalService, "transactionalService should not be null");
checkNotNull(remoteService, "remoteService should not be null");
checkNotNull(eventPublishingService, "eventPublishingService should not be null");
checkNotNull(postJoinAwareService, "postJoinAwareService should not be null");
checkNotNull(splitBrainHandlerService, "splitBrainHandlerService should not be null");
checkNotNull(replicationSupportingService, "replicationSupportingService should not be null");
checkNotNull(statisticsAwareService, "statisticsAwareService should not be null");
checkNotNull(partitionAwareService, "partitionAwareService should not be null");
checkNotNull(quorumAwareService, "quorumAwareService should not be null");
checkNotNull(clientAwareService, "clientAwareService should not be null");
MapService mapService = new MapService();
mapService.managedService = managedService;
mapService.migrationAwareService = migrationAwareService;
mapService.transactionalService = transactionalService;
mapService.remoteService = remoteService;
mapService.eventPublishingService = eventPublishingService;
mapService.postJoinAwareService = postJoinAwareService;
mapService.splitBrainHandlerService = splitBrainHandlerService;
mapService.replicationSupportingService = replicationSupportingService;
mapService.statisticsAwareService = statisticsAwareService;
mapService.mapServiceContext = mapServiceContext;
mapService.partitionAwareService = partitionAwareService;
mapService.quorumAwareService = quorumAwareService;
mapService.clientAwareService = clientAwareService;
mapServiceContext.setService(mapService);
return mapService;
} | class class_name[name] begin[{]
method[createMapService, return_type[type[MapService]], modifier[public], parameter[]] begin[{]
local_variable[type[NodeEngine], nodeEngine]
local_variable[type[MapServiceContext], mapServiceContext]
local_variable[type[ManagedService], managedService]
local_variable[type[CountingMigrationAwareService], migrationAwareService]
local_variable[type[TransactionalService], transactionalService]
local_variable[type[RemoteService], remoteService]
local_variable[type[EventPublishingService], eventPublishingService]
local_variable[type[PostJoinAwareService], postJoinAwareService]
local_variable[type[SplitBrainHandlerService], splitBrainHandlerService]
local_variable[type[ReplicationSupportingService], replicationSupportingService]
local_variable[type[StatisticsAwareService], statisticsAwareService]
local_variable[type[PartitionAwareService], partitionAwareService]
local_variable[type[MapQuorumAwareService], quorumAwareService]
local_variable[type[ClientAwareService], clientAwareService]
call[.checkNotNull, parameter[member[.nodeEngine], literal["nodeEngine should not be null"]]]
call[.checkNotNull, parameter[member[.mapServiceContext], literal["mapServiceContext should not be null"]]]
call[.checkNotNull, parameter[member[.managedService], literal["managedService should not be null"]]]
call[.checkNotNull, parameter[member[.migrationAwareService], literal["migrationAwareService should not be null"]]]
call[.checkNotNull, parameter[member[.transactionalService], literal["transactionalService should not be null"]]]
call[.checkNotNull, parameter[member[.remoteService], literal["remoteService should not be null"]]]
call[.checkNotNull, parameter[member[.eventPublishingService], literal["eventPublishingService should not be null"]]]
call[.checkNotNull, parameter[member[.postJoinAwareService], literal["postJoinAwareService should not be null"]]]
call[.checkNotNull, parameter[member[.splitBrainHandlerService], literal["splitBrainHandlerService should not be null"]]]
call[.checkNotNull, parameter[member[.replicationSupportingService], literal["replicationSupportingService should not be null"]]]
call[.checkNotNull, parameter[member[.statisticsAwareService], literal["statisticsAwareService should not be null"]]]
call[.checkNotNull, parameter[member[.partitionAwareService], literal["partitionAwareService should not be null"]]]
call[.checkNotNull, parameter[member[.quorumAwareService], literal["quorumAwareService should not be null"]]]
call[.checkNotNull, parameter[member[.clientAwareService], literal["clientAwareService should not be null"]]]
local_variable[type[MapService], mapService]
assign[member[mapService.managedService], member[.managedService]]
assign[member[mapService.migrationAwareService], member[.migrationAwareService]]
assign[member[mapService.transactionalService], member[.transactionalService]]
assign[member[mapService.remoteService], member[.remoteService]]
assign[member[mapService.eventPublishingService], member[.eventPublishingService]]
assign[member[mapService.postJoinAwareService], member[.postJoinAwareService]]
assign[member[mapService.splitBrainHandlerService], member[.splitBrainHandlerService]]
assign[member[mapService.replicationSupportingService], member[.replicationSupportingService]]
assign[member[mapService.statisticsAwareService], member[.statisticsAwareService]]
assign[member[mapService.mapServiceContext], member[.mapServiceContext]]
assign[member[mapService.partitionAwareService], member[.partitionAwareService]]
assign[member[mapService.quorumAwareService], member[.quorumAwareService]]
assign[member[mapService.clientAwareService], member[.clientAwareService]]
call[mapServiceContext.setService, parameter[member[.mapService]]]
return[member[.mapService]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[MapService] identifier[createMapService] operator[SEP] operator[SEP] {
identifier[NodeEngine] identifier[nodeEngine] operator[=] identifier[getNodeEngine] operator[SEP] operator[SEP] operator[SEP] identifier[MapServiceContext] identifier[mapServiceContext] operator[=] identifier[getMapServiceContext] operator[SEP] operator[SEP] operator[SEP] identifier[ManagedService] identifier[managedService] operator[=] identifier[createManagedService] operator[SEP] operator[SEP] operator[SEP] identifier[CountingMigrationAwareService] identifier[migrationAwareService] operator[=] identifier[createMigrationAwareService] operator[SEP] operator[SEP] operator[SEP] identifier[TransactionalService] identifier[transactionalService] operator[=] identifier[createTransactionalService] operator[SEP] operator[SEP] operator[SEP] identifier[RemoteService] identifier[remoteService] operator[=] identifier[createRemoteService] operator[SEP] operator[SEP] operator[SEP] identifier[EventPublishingService] identifier[eventPublishingService] operator[=] identifier[createEventPublishingService] operator[SEP] operator[SEP] operator[SEP] identifier[PostJoinAwareService] identifier[postJoinAwareService] operator[=] identifier[createPostJoinAwareService] operator[SEP] operator[SEP] operator[SEP] identifier[SplitBrainHandlerService] identifier[splitBrainHandlerService] operator[=] identifier[createSplitBrainHandlerService] operator[SEP] operator[SEP] operator[SEP] identifier[ReplicationSupportingService] identifier[replicationSupportingService] operator[=] identifier[createReplicationSupportingService] operator[SEP] operator[SEP] operator[SEP] identifier[StatisticsAwareService] identifier[statisticsAwareService] operator[=] identifier[createStatisticsAwareService] operator[SEP] operator[SEP] operator[SEP] identifier[PartitionAwareService] identifier[partitionAwareService] operator[=] identifier[createPartitionAwareService] operator[SEP] operator[SEP] operator[SEP] identifier[MapQuorumAwareService] identifier[quorumAwareService] operator[=] identifier[createQuorumAwareService] operator[SEP] operator[SEP] operator[SEP] identifier[ClientAwareService] identifier[clientAwareService] operator[=] identifier[createClientAwareService] operator[SEP] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[nodeEngine] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[mapServiceContext] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[managedService] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[migrationAwareService] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[transactionalService] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[remoteService] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[eventPublishingService] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[postJoinAwareService] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[splitBrainHandlerService] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[replicationSupportingService] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[statisticsAwareService] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[partitionAwareService] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[quorumAwareService] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[clientAwareService] , literal[String] operator[SEP] operator[SEP] identifier[MapService] identifier[mapService] operator[=] Keyword[new] identifier[MapService] operator[SEP] operator[SEP] operator[SEP] identifier[mapService] operator[SEP] identifier[managedService] operator[=] identifier[managedService] operator[SEP] identifier[mapService] operator[SEP] identifier[migrationAwareService] operator[=] identifier[migrationAwareService] operator[SEP] identifier[mapService] operator[SEP] identifier[transactionalService] operator[=] identifier[transactionalService] operator[SEP] identifier[mapService] operator[SEP] identifier[remoteService] operator[=] identifier[remoteService] operator[SEP] identifier[mapService] operator[SEP] identifier[eventPublishingService] operator[=] identifier[eventPublishingService] operator[SEP] identifier[mapService] operator[SEP] identifier[postJoinAwareService] operator[=] identifier[postJoinAwareService] operator[SEP] identifier[mapService] operator[SEP] identifier[splitBrainHandlerService] operator[=] identifier[splitBrainHandlerService] operator[SEP] identifier[mapService] operator[SEP] identifier[replicationSupportingService] operator[=] identifier[replicationSupportingService] operator[SEP] identifier[mapService] operator[SEP] identifier[statisticsAwareService] operator[=] identifier[statisticsAwareService] operator[SEP] identifier[mapService] operator[SEP] identifier[mapServiceContext] operator[=] identifier[mapServiceContext] operator[SEP] identifier[mapService] operator[SEP] identifier[partitionAwareService] operator[=] identifier[partitionAwareService] operator[SEP] identifier[mapService] operator[SEP] identifier[quorumAwareService] operator[=] identifier[quorumAwareService] operator[SEP] identifier[mapService] operator[SEP] identifier[clientAwareService] operator[=] identifier[clientAwareService] operator[SEP] identifier[mapServiceContext] operator[SEP] identifier[setService] operator[SEP] identifier[mapService] operator[SEP] operator[SEP] Keyword[return] identifier[mapService] operator[SEP]
}
|
protected void addDescription(ClassDoc cd, Content dlTree, SearchIndexItem si) {
Content link = getLink(new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.INDEX, cd).strong(true));
si.setContainingPackage(utils.getPackageName(cd.containingPackage()));
si.setLabel(cd.typeName());
si.setCategory(getResource("doclet.Types").toString());
Content dt = HtmlTree.DT(link);
dt.addContent(" - ");
addClassInfo(cd, dt);
dlTree.addContent(dt);
Content dd = new HtmlTree(HtmlTag.DD);
addComment(cd, dd);
dlTree.addContent(dd);
} | class class_name[name] begin[{]
method[addDescription, return_type[void], modifier[protected], parameter[cd, dlTree, si]] begin[{]
local_variable[type[Content], link]
call[si.setContainingPackage, parameter[call[utils.getPackageName, parameter[call[cd.containingPackage, parameter[]]]]]]
call[si.setLabel, parameter[call[cd.typeName, parameter[]]]]
call[si.setCategory, parameter[call[.getResource, parameter[literal["doclet.Types"]]]]]
local_variable[type[Content], dt]
call[dt.addContent, parameter[literal[" - "]]]
call[.addClassInfo, parameter[member[.cd], member[.dt]]]
call[dlTree.addContent, parameter[member[.dt]]]
local_variable[type[Content], dd]
call[.addComment, parameter[member[.cd], member[.dd]]]
call[dlTree.addContent, parameter[member[.dd]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[addDescription] operator[SEP] identifier[ClassDoc] identifier[cd] , identifier[Content] identifier[dlTree] , identifier[SearchIndexItem] identifier[si] operator[SEP] {
identifier[Content] identifier[link] operator[=] identifier[getLink] operator[SEP] Keyword[new] identifier[LinkInfoImpl] operator[SEP] identifier[configuration] , identifier[LinkInfoImpl] operator[SEP] identifier[Kind] operator[SEP] identifier[INDEX] , identifier[cd] operator[SEP] operator[SEP] identifier[strong] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[si] operator[SEP] identifier[setContainingPackage] operator[SEP] identifier[utils] operator[SEP] identifier[getPackageName] operator[SEP] identifier[cd] operator[SEP] identifier[containingPackage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[si] operator[SEP] identifier[setLabel] operator[SEP] identifier[cd] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[si] operator[SEP] identifier[setCategory] operator[SEP] identifier[getResource] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Content] identifier[dt] operator[=] identifier[HtmlTree] operator[SEP] identifier[DT] operator[SEP] identifier[link] operator[SEP] operator[SEP] identifier[dt] operator[SEP] identifier[addContent] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[addClassInfo] operator[SEP] identifier[cd] , identifier[dt] operator[SEP] operator[SEP] identifier[dlTree] operator[SEP] identifier[addContent] operator[SEP] identifier[dt] operator[SEP] operator[SEP] identifier[Content] identifier[dd] operator[=] Keyword[new] identifier[HtmlTree] operator[SEP] identifier[HtmlTag] operator[SEP] identifier[DD] operator[SEP] operator[SEP] identifier[addComment] operator[SEP] identifier[cd] , identifier[dd] operator[SEP] operator[SEP] identifier[dlTree] operator[SEP] identifier[addContent] operator[SEP] identifier[dd] operator[SEP] operator[SEP]
}
|
static Object getMemento(LifecycleModuleBuilder source) throws Exception {
Field sessionScopeFiled = source.getClass().getDeclaredField("sessionScope");
sessionScopeFiled.setAccessible(true);
Object sessionScope = sessionScopeFiled.get(source);
Method mementoMethod = sessionScope.getClass().getDeclaredMethod("memento");
mementoMethod.setAccessible(true);
return mementoMethod.invoke(sessionScope);
} | class class_name[name] begin[{]
method[getMemento, return_type[type[Object]], modifier[static], parameter[source]] begin[{]
local_variable[type[Field], sessionScopeFiled]
call[sessionScopeFiled.setAccessible, parameter[literal[true]]]
local_variable[type[Object], sessionScope]
local_variable[type[Method], mementoMethod]
call[mementoMethod.setAccessible, parameter[literal[true]]]
return[call[mementoMethod.invoke, parameter[member[.sessionScope]]]]
end[}]
END[}] | Keyword[static] identifier[Object] identifier[getMemento] operator[SEP] identifier[LifecycleModuleBuilder] identifier[source] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[Field] identifier[sessionScopeFiled] operator[=] identifier[source] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getDeclaredField] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sessionScopeFiled] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[Object] identifier[sessionScope] operator[=] identifier[sessionScopeFiled] operator[SEP] identifier[get] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[Method] identifier[mementoMethod] operator[=] identifier[sessionScope] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getDeclaredMethod] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mementoMethod] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[mementoMethod] operator[SEP] identifier[invoke] operator[SEP] identifier[sessionScope] operator[SEP] operator[SEP]
}
|
public synchronized static ServiceFactory getInstance(Class<?> aClass, String configurationPath)
{
if(configurationPath == null)
{
configurationPath = "";
}
if (instances.get(configurationPath) == null)
{
instances.put(configurationPath, createServiceFactory(aClass,configurationPath));
}
return (ServiceFactory)instances.get(configurationPath);
} | class class_name[name] begin[{]
method[getInstance, return_type[type[ServiceFactory]], modifier[synchronized public static], parameter[aClass, configurationPath]] begin[{]
if[binary_operation[member[.configurationPath], ==, literal[null]]] begin[{]
assign[member[.configurationPath], literal[""]]
else begin[{]
None
end[}]
if[binary_operation[call[instances.get, parameter[member[.configurationPath]]], ==, literal[null]]] begin[{]
call[instances.put, parameter[member[.configurationPath], call[.createServiceFactory, parameter[member[.aClass], member[.configurationPath]]]]]
else begin[{]
None
end[}]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=configurationPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=instances, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ServiceFactory, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[static] identifier[ServiceFactory] identifier[getInstance] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[aClass] , identifier[String] identifier[configurationPath] operator[SEP] {
Keyword[if] operator[SEP] identifier[configurationPath] operator[==] Other[null] operator[SEP] {
identifier[configurationPath] operator[=] literal[String] operator[SEP]
}
Keyword[if] operator[SEP] identifier[instances] operator[SEP] identifier[get] operator[SEP] identifier[configurationPath] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[instances] operator[SEP] identifier[put] operator[SEP] identifier[configurationPath] , identifier[createServiceFactory] operator[SEP] identifier[aClass] , identifier[configurationPath] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] identifier[ServiceFactory] operator[SEP] identifier[instances] operator[SEP] identifier[get] operator[SEP] identifier[configurationPath] operator[SEP] operator[SEP]
}
|
public RemoteUpdateResult updateMany(final Bson filter, final Bson update) {
return updateMany(filter, update, new RemoteUpdateOptions());
} | class class_name[name] begin[{]
method[updateMany, return_type[type[RemoteUpdateResult]], modifier[public], parameter[filter, update]] begin[{]
return[call[.updateMany, parameter[member[.filter], member[.update], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RemoteUpdateOptions, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[RemoteUpdateResult] identifier[updateMany] operator[SEP] Keyword[final] identifier[Bson] identifier[filter] , Keyword[final] identifier[Bson] identifier[update] operator[SEP] {
Keyword[return] identifier[updateMany] operator[SEP] identifier[filter] , identifier[update] , Keyword[new] identifier[RemoteUpdateOptions] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private void matchParentCommand(final List<ConfigCommand> commandList) {
if (commandList == null) {
return;
}
for (int i = 0; i < commandList.size(); i++) {
ConfigCommand child = commandList.get(i);
if (!child.getCommandTypeName().equalsIgnoreCase(TieConstants.COMMAND_FORM)) {
setParentForChildCommand(commandList, i, child);
}
}
} | class class_name[name] begin[{]
method[matchParentCommand, return_type[void], modifier[private], parameter[commandList]] begin[{]
if[binary_operation[member[.commandList], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=commandList, selectors=[], type_arguments=None), name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConfigCommand, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getCommandTypeName, postfix_operators=[], prefix_operators=['!'], qualifier=child, selectors=[MethodInvocation(arguments=[MemberReference(member=COMMAND_FORM, postfix_operators=[], prefix_operators=[], qualifier=TieConstants, selectors=[])], member=equalsIgnoreCase, 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=[MemberReference(member=commandList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setParentForChildCommand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=commandList, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[matchParentCommand] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[ConfigCommand] operator[>] identifier[commandList] operator[SEP] {
Keyword[if] operator[SEP] identifier[commandList] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[commandList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[ConfigCommand] identifier[child] operator[=] identifier[commandList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[child] operator[SEP] identifier[getCommandTypeName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[TieConstants] operator[SEP] identifier[COMMAND_FORM] operator[SEP] operator[SEP] {
identifier[setParentForChildCommand] operator[SEP] identifier[commandList] , identifier[i] , identifier[child] operator[SEP] operator[SEP]
}
}
}
|
public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
throw SQLError.noSupport();
} | class class_name[name] begin[{]
method[getObject, return_type[type[T]], modifier[public], parameter[columnIndex, type]] begin[{]
ThrowStatement(expression=MethodInvocation(arguments=[], member=noSupport, postfix_operators=[], prefix_operators=[], qualifier=SQLError, selectors=[], type_arguments=None), label=None)
end[}]
END[}] | Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[getObject] operator[SEP] Keyword[int] identifier[columnIndex] , identifier[Class] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] Keyword[throws] identifier[SQLException] {
Keyword[throw] identifier[SQLError] operator[SEP] identifier[noSupport] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Ticker adaptTicker(CryptonitTicker cryptonitTicker, CurrencyPair currencyPair) {
BigDecimal open = cryptonitTicker.getOpen();
BigDecimal last = cryptonitTicker.getLast();
BigDecimal bid = cryptonitTicker.getBid();
BigDecimal ask = cryptonitTicker.getAsk();
BigDecimal high = cryptonitTicker.getHigh();
BigDecimal low = cryptonitTicker.getLow();
BigDecimal vwap = cryptonitTicker.getVwap();
BigDecimal volume = cryptonitTicker.getVolume();
Date timestamp = new Date(cryptonitTicker.getTimestamp() * 1000L);
return new Ticker.Builder()
.currencyPair(currencyPair)
.open(open)
.last(last)
.bid(bid)
.ask(ask)
.high(high)
.low(low)
.vwap(vwap)
.volume(volume)
.timestamp(timestamp)
.build();
} | class class_name[name] begin[{]
method[adaptTicker, return_type[type[Ticker]], modifier[public static], parameter[cryptonitTicker, currencyPair]] begin[{]
local_variable[type[BigDecimal], open]
local_variable[type[BigDecimal], last]
local_variable[type[BigDecimal], bid]
local_variable[type[BigDecimal], ask]
local_variable[type[BigDecimal], high]
local_variable[type[BigDecimal], low]
local_variable[type[BigDecimal], vwap]
local_variable[type[BigDecimal], volume]
local_variable[type[Date], timestamp]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=currencyPair, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=currencyPair, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=open, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=last, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=last, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=bid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=bid, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ask, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=high, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=high, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=low, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=low, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=vwap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vwap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=volume, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=volume, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=timestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=timestamp, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Ticker, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None)))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Ticker] identifier[adaptTicker] operator[SEP] identifier[CryptonitTicker] identifier[cryptonitTicker] , identifier[CurrencyPair] identifier[currencyPair] operator[SEP] {
identifier[BigDecimal] identifier[open] operator[=] identifier[cryptonitTicker] operator[SEP] identifier[getOpen] operator[SEP] operator[SEP] operator[SEP] identifier[BigDecimal] identifier[last] operator[=] identifier[cryptonitTicker] operator[SEP] identifier[getLast] operator[SEP] operator[SEP] operator[SEP] identifier[BigDecimal] identifier[bid] operator[=] identifier[cryptonitTicker] operator[SEP] identifier[getBid] operator[SEP] operator[SEP] operator[SEP] identifier[BigDecimal] identifier[ask] operator[=] identifier[cryptonitTicker] operator[SEP] identifier[getAsk] operator[SEP] operator[SEP] operator[SEP] identifier[BigDecimal] identifier[high] operator[=] identifier[cryptonitTicker] operator[SEP] identifier[getHigh] operator[SEP] operator[SEP] operator[SEP] identifier[BigDecimal] identifier[low] operator[=] identifier[cryptonitTicker] operator[SEP] identifier[getLow] operator[SEP] operator[SEP] operator[SEP] identifier[BigDecimal] identifier[vwap] operator[=] identifier[cryptonitTicker] operator[SEP] identifier[getVwap] operator[SEP] operator[SEP] operator[SEP] identifier[BigDecimal] identifier[volume] operator[=] identifier[cryptonitTicker] operator[SEP] identifier[getVolume] operator[SEP] operator[SEP] operator[SEP] identifier[Date] identifier[timestamp] operator[=] Keyword[new] identifier[Date] operator[SEP] identifier[cryptonitTicker] operator[SEP] identifier[getTimestamp] operator[SEP] operator[SEP] operator[*] Other[1000L] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Ticker] operator[SEP] identifier[Builder] operator[SEP] operator[SEP] operator[SEP] identifier[currencyPair] operator[SEP] identifier[currencyPair] operator[SEP] operator[SEP] identifier[open] operator[SEP] identifier[open] operator[SEP] operator[SEP] identifier[last] operator[SEP] identifier[last] operator[SEP] operator[SEP] identifier[bid] operator[SEP] identifier[bid] operator[SEP] operator[SEP] identifier[ask] operator[SEP] identifier[ask] operator[SEP] operator[SEP] identifier[high] operator[SEP] identifier[high] operator[SEP] operator[SEP] identifier[low] operator[SEP] identifier[low] operator[SEP] operator[SEP] identifier[vwap] operator[SEP] identifier[vwap] operator[SEP] operator[SEP] identifier[volume] operator[SEP] identifier[volume] operator[SEP] operator[SEP] identifier[timestamp] operator[SEP] identifier[timestamp] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
private static Partition createListSubPartition(SqlgGraph sqlgGraph, Partition parentPartition, String name, String in) {
Preconditions.checkArgument(!parentPartition.getAbstractLabel().getSchema().isSqlgSchema(), "createPartition may not be called for \"%s\"", Topology.SQLG_SCHEMA);
Partition partition = new Partition(sqlgGraph, parentPartition, name, in, PartitionType.NONE, null);
partition.createListPartitionOnDb();
TopologyManager.addSubPartition(sqlgGraph, partition);
partition.committed = false;
return partition;
} | class class_name[name] begin[{]
method[createListSubPartition, return_type[type[Partition]], modifier[private static], parameter[sqlgGraph, parentPartition, name, in]] begin[{]
call[Preconditions.checkArgument, parameter[call[parentPartition.getAbstractLabel, parameter[]], literal["createPartition may not be called for \"%s\""], member[Topology.SQLG_SCHEMA]]]
local_variable[type[Partition], partition]
call[partition.createListPartitionOnDb, parameter[]]
call[TopologyManager.addSubPartition, parameter[member[.sqlgGraph], member[.partition]]]
assign[member[partition.committed], literal[false]]
return[member[.partition]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Partition] identifier[createListSubPartition] operator[SEP] identifier[SqlgGraph] identifier[sqlgGraph] , identifier[Partition] identifier[parentPartition] , identifier[String] identifier[name] , identifier[String] identifier[in] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] operator[!] identifier[parentPartition] operator[SEP] identifier[getAbstractLabel] operator[SEP] operator[SEP] operator[SEP] identifier[getSchema] operator[SEP] operator[SEP] operator[SEP] identifier[isSqlgSchema] operator[SEP] operator[SEP] , literal[String] , identifier[Topology] operator[SEP] identifier[SQLG_SCHEMA] operator[SEP] operator[SEP] identifier[Partition] identifier[partition] operator[=] Keyword[new] identifier[Partition] operator[SEP] identifier[sqlgGraph] , identifier[parentPartition] , identifier[name] , identifier[in] , identifier[PartitionType] operator[SEP] identifier[NONE] , Other[null] operator[SEP] operator[SEP] identifier[partition] operator[SEP] identifier[createListPartitionOnDb] operator[SEP] operator[SEP] operator[SEP] identifier[TopologyManager] operator[SEP] identifier[addSubPartition] operator[SEP] identifier[sqlgGraph] , identifier[partition] operator[SEP] operator[SEP] identifier[partition] operator[SEP] identifier[committed] operator[=] literal[boolean] operator[SEP] Keyword[return] identifier[partition] operator[SEP]
}
|
public DescribeClientVpnEndpointsResult withClientVpnEndpoints(ClientVpnEndpoint... clientVpnEndpoints) {
if (this.clientVpnEndpoints == null) {
setClientVpnEndpoints(new com.amazonaws.internal.SdkInternalList<ClientVpnEndpoint>(clientVpnEndpoints.length));
}
for (ClientVpnEndpoint ele : clientVpnEndpoints) {
this.clientVpnEndpoints.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withClientVpnEndpoints, return_type[type[DescribeClientVpnEndpointsResult]], modifier[public], parameter[clientVpnEndpoints]] begin[{]
if[binary_operation[THIS[member[None.clientVpnEndpoints]], ==, literal[null]]] begin[{]
call[.setClientVpnEndpoints, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=clientVpnEndpoints, 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=ClientVpnEndpoint, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=clientVpnEndpoints, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=clientVpnEndpoints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClientVpnEndpoint, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[DescribeClientVpnEndpointsResult] identifier[withClientVpnEndpoints] operator[SEP] identifier[ClientVpnEndpoint] operator[...] identifier[clientVpnEndpoints] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[clientVpnEndpoints] operator[==] Other[null] operator[SEP] {
identifier[setClientVpnEndpoints] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[ClientVpnEndpoint] operator[>] operator[SEP] identifier[clientVpnEndpoints] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[ClientVpnEndpoint] identifier[ele] operator[:] identifier[clientVpnEndpoints] operator[SEP] {
Keyword[this] operator[SEP] identifier[clientVpnEndpoints] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public void execute() {
if (needsExecution()) {
log.trace("Executing round: {}", pending);
Result<Map<com.google.cloud.datastore.Key, Entity>> fetched = fetchPending();
translated = loadEngine.translate(fetched);
// If we're in a transaction (and beyond the first round), force all subsequent rounds to complete.
// This effectively means that only the first round can be asynchronous; all other rounds are
// materialized immediately. The reason for this is that there are some nasty edge cases with @Load
// annotations in transactions getting called after the transaction closes. This is possibly not the
// best solution to the problem, but it solves the problem now.
if (loadEngine.ofy.getTransaction() != null && depth > 0)
translated.now();
}
} | class class_name[name] begin[{]
method[execute, return_type[void], modifier[public], parameter[]] begin[{]
if[call[.needsExecution, parameter[]]] begin[{]
call[log.trace, parameter[literal["Executing round: {}"], member[.pending]]]
local_variable[type[Result], fetched]
assign[member[.translated], call[loadEngine.translate, parameter[member[.fetched]]]]
if[binary_operation[binary_operation[call[loadEngine.ofy.getTransaction, parameter[]], !=, literal[null]], &&, binary_operation[member[.depth], >, literal[0]]]] begin[{]
call[translated.now, parameter[]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[execute] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[needsExecution] operator[SEP] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[pending] operator[SEP] operator[SEP] identifier[Result] operator[<] identifier[Map] operator[<] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[cloud] operator[SEP] identifier[datastore] operator[SEP] identifier[Key] , identifier[Entity] operator[>] operator[>] identifier[fetched] operator[=] identifier[fetchPending] operator[SEP] operator[SEP] operator[SEP] identifier[translated] operator[=] identifier[loadEngine] operator[SEP] identifier[translate] operator[SEP] identifier[fetched] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[loadEngine] operator[SEP] identifier[ofy] operator[SEP] identifier[getTransaction] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[depth] operator[>] Other[0] operator[SEP] identifier[translated] operator[SEP] identifier[now] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public synchronized boolean flush() {
if (!validState) {
throw new InvalidStateException();
}
try {
flushBuffer();
return true;
} catch (Exception e) {
log.error("Exception in flush()", e);
}
return false;
} | class class_name[name] begin[{]
method[flush, return_type[type[boolean]], modifier[synchronized public], parameter[]] begin[{]
if[member[.validState]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=flushBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception in flush()"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[boolean] identifier[flush] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[validState] operator[SEP] {
Keyword[throw] Keyword[new] identifier[InvalidStateException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[flushBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static int numberOfFreeParameters(Relation<? extends NumberVector> relation, Clustering<? extends MeanModel> clustering) {
// number of clusters
int m = clustering.getAllClusters().size(); // num_ctrs
// dimensionality of data points
int dim = RelationUtil.dimensionality(relation); // num_dims
// number of free parameters
return (m - 1) + m * dim + m;
} | class class_name[name] begin[{]
method[numberOfFreeParameters, return_type[type[int]], modifier[public static], parameter[relation, clustering]] begin[{]
local_variable[type[int], m]
local_variable[type[int], dim]
return[binary_operation[binary_operation[binary_operation[member[.m], -, literal[1]], +, binary_operation[member[.m], *, member[.dim]]], +, member[.m]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[numberOfFreeParameters] operator[SEP] identifier[Relation] operator[<] operator[?] Keyword[extends] identifier[NumberVector] operator[>] identifier[relation] , identifier[Clustering] operator[<] operator[?] Keyword[extends] identifier[MeanModel] operator[>] identifier[clustering] operator[SEP] {
Keyword[int] identifier[m] operator[=] identifier[clustering] operator[SEP] identifier[getAllClusters] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[dim] operator[=] identifier[RelationUtil] operator[SEP] identifier[dimensionality] operator[SEP] identifier[relation] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[m] operator[-] Other[1] operator[SEP] operator[+] identifier[m] operator[*] identifier[dim] operator[+] identifier[m] operator[SEP]
}
|
public static Optional<JMProgressiveManager<Path, Path>>
copyFilePathListAsync(List<Path> filePathList,
Path destinationDirPath, CopyOption... options) {
return operateBulk(filePathList, destinationDirPath,
sourcePath -> Optional.ofNullable(
copy(sourcePath, destinationDirPath, options)));
} | class class_name[name] begin[{]
method[copyFilePathListAsync, return_type[type[Optional]], modifier[public static], parameter[filePathList, destinationDirPath, options]] begin[{]
return[call[.operateBulk, parameter[member[.filePathList], member[.destinationDirPath], LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=sourcePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=destinationDirPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=ofNullable, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None), parameters=[MemberReference(member=sourcePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Optional] operator[<] identifier[JMProgressiveManager] operator[<] identifier[Path] , identifier[Path] operator[>] operator[>] identifier[copyFilePathListAsync] operator[SEP] identifier[List] operator[<] identifier[Path] operator[>] identifier[filePathList] , identifier[Path] identifier[destinationDirPath] , identifier[CopyOption] operator[...] identifier[options] operator[SEP] {
Keyword[return] identifier[operateBulk] operator[SEP] identifier[filePathList] , identifier[destinationDirPath] , identifier[sourcePath] operator[->] identifier[Optional] operator[SEP] identifier[ofNullable] operator[SEP] identifier[copy] operator[SEP] identifier[sourcePath] , identifier[destinationDirPath] , identifier[options] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public Document read( InputStream stream ) throws IOException {
// Create an object so that this reader is thread safe ...
DocumentValueFactory valueFactory = VALUE_FACTORY;
Reader reader = new Reader(new BsonDataInput(new DataInputStream(stream)), valueFactory);
reader.startDocument();
return reader.endDocument();
} | class class_name[name] begin[{]
method[read, return_type[type[Document]], modifier[public], parameter[stream]] begin[{]
local_variable[type[DocumentValueFactory], valueFactory]
local_variable[type[Reader], reader]
call[reader.startDocument, parameter[]]
return[call[reader.endDocument, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[Document] identifier[read] operator[SEP] identifier[InputStream] identifier[stream] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[DocumentValueFactory] identifier[valueFactory] operator[=] identifier[VALUE_FACTORY] operator[SEP] identifier[Reader] identifier[reader] operator[=] Keyword[new] identifier[Reader] operator[SEP] Keyword[new] identifier[BsonDataInput] operator[SEP] Keyword[new] identifier[DataInputStream] operator[SEP] identifier[stream] operator[SEP] operator[SEP] , identifier[valueFactory] operator[SEP] operator[SEP] identifier[reader] operator[SEP] identifier[startDocument] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[reader] operator[SEP] identifier[endDocument] operator[SEP] operator[SEP] operator[SEP]
}
|
protected void processPOTopicBugLink(final POBuildData buildData, final SpecTopic specTopic,
final Map<String, TranslationDetails> translations) throws BuildProcessingException {
try {
final DocBookXMLPreProcessor preProcessor = buildData.getXMLPreProcessor();
final String bugLinkUrl = preProcessor.getBugLinkUrl(buildData, specTopic);
processPOBugLinks(buildData, preProcessor, bugLinkUrl, translations);
} catch (BugLinkException e) {
throw new BuildProcessingException(e);
} catch (Exception e) {
throw new BuildProcessingException("Failed to insert Bug Links into the DOM Document", e);
}
} | class class_name[name] begin[{]
method[processPOTopicBugLink, return_type[void], modifier[protected], parameter[buildData, specTopic, translations]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getXMLPreProcessor, postfix_operators=[], prefix_operators=[], qualifier=buildData, selectors=[], type_arguments=None), name=preProcessor)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=DocBookXMLPreProcessor, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=buildData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=specTopic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBugLinkUrl, postfix_operators=[], prefix_operators=[], qualifier=preProcessor, selectors=[], type_arguments=None), name=bugLinkUrl)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buildData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=preProcessor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bugLinkUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=translations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processPOBugLinks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BuildProcessingException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['BugLinkException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to insert Bug Links into the DOM Document"), 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=BuildProcessingException, 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[protected] Keyword[void] identifier[processPOTopicBugLink] operator[SEP] Keyword[final] identifier[POBuildData] identifier[buildData] , Keyword[final] identifier[SpecTopic] identifier[specTopic] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[TranslationDetails] operator[>] identifier[translations] operator[SEP] Keyword[throws] identifier[BuildProcessingException] {
Keyword[try] {
Keyword[final] identifier[DocBookXMLPreProcessor] identifier[preProcessor] operator[=] identifier[buildData] operator[SEP] identifier[getXMLPreProcessor] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[bugLinkUrl] operator[=] identifier[preProcessor] operator[SEP] identifier[getBugLinkUrl] operator[SEP] identifier[buildData] , identifier[specTopic] operator[SEP] operator[SEP] identifier[processPOBugLinks] operator[SEP] identifier[buildData] , identifier[preProcessor] , identifier[bugLinkUrl] , identifier[translations] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[BugLinkException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[BuildProcessingException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[BuildProcessingException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void startMethod(String methodName, String type, short flags) {
short methodNameIndex = itsConstantPool.addUtf8(methodName);
short typeIndex = itsConstantPool.addUtf8(type);
itsCurrentMethod = new ClassFileMethod(methodName, methodNameIndex,
type, typeIndex, flags);
itsJumpFroms = new UintMap();
itsMethods.add(itsCurrentMethod);
addSuperBlockStart(0);
} | class class_name[name] begin[{]
method[startMethod, return_type[void], modifier[public], parameter[methodName, type, flags]] begin[{]
local_variable[type[short], methodNameIndex]
local_variable[type[short], typeIndex]
assign[member[.itsCurrentMethod], ClassCreator(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=methodNameIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=typeIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=flags, 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=ClassFileMethod, sub_type=None))]
assign[member[.itsJumpFroms], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UintMap, sub_type=None))]
call[itsMethods.add, parameter[member[.itsCurrentMethod]]]
call[.addSuperBlockStart, parameter[literal[0]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[startMethod] operator[SEP] identifier[String] identifier[methodName] , identifier[String] identifier[type] , Keyword[short] identifier[flags] operator[SEP] {
Keyword[short] identifier[methodNameIndex] operator[=] identifier[itsConstantPool] operator[SEP] identifier[addUtf8] operator[SEP] identifier[methodName] operator[SEP] operator[SEP] Keyword[short] identifier[typeIndex] operator[=] identifier[itsConstantPool] operator[SEP] identifier[addUtf8] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[itsCurrentMethod] operator[=] Keyword[new] identifier[ClassFileMethod] operator[SEP] identifier[methodName] , identifier[methodNameIndex] , identifier[type] , identifier[typeIndex] , identifier[flags] operator[SEP] operator[SEP] identifier[itsJumpFroms] operator[=] Keyword[new] identifier[UintMap] operator[SEP] operator[SEP] operator[SEP] identifier[itsMethods] operator[SEP] identifier[add] operator[SEP] identifier[itsCurrentMethod] operator[SEP] operator[SEP] identifier[addSuperBlockStart] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
|
@Override
public Map<String, List<Object>> getPersonAttributesFromMultivaluedAttributes(final Map<String, List<Object>> attributes) {
throw new UnsupportedOperationException();
} | class class_name[name] begin[{]
method[getPersonAttributesFromMultivaluedAttributes, return_type[type[Map]], modifier[public], parameter[attributes]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[Object] operator[>] operator[>] identifier[getPersonAttributesFromMultivaluedAttributes] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[Object] operator[>] operator[>] identifier[attributes] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public ConnectFuture connect(IoSessionInitializer<? extends ConnectFuture> sessionInitializer) {
SocketAddress defaultRemoteAddress = getDefaultRemoteAddress();
if (defaultRemoteAddress == null) {
throw new IllegalStateException("defaultRemoteAddress is not set.");
}
return connect(defaultRemoteAddress, null, sessionInitializer);
} | class class_name[name] begin[{]
method[connect, return_type[type[ConnectFuture]], modifier[public], parameter[sessionInitializer]] begin[{]
local_variable[type[SocketAddress], defaultRemoteAddress]
if[binary_operation[member[.defaultRemoteAddress], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="defaultRemoteAddress is not set.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[.connect, parameter[member[.defaultRemoteAddress], literal[null], member[.sessionInitializer]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ConnectFuture] identifier[connect] operator[SEP] identifier[IoSessionInitializer] operator[<] operator[?] Keyword[extends] identifier[ConnectFuture] operator[>] identifier[sessionInitializer] operator[SEP] {
identifier[SocketAddress] identifier[defaultRemoteAddress] operator[=] identifier[getDefaultRemoteAddress] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[defaultRemoteAddress] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[connect] operator[SEP] identifier[defaultRemoteAddress] , Other[null] , identifier[sessionInitializer] operator[SEP] operator[SEP]
}
|
private Stat createStat(final WComponent comp) {
Stat stat = new Stat();
stat.setClassName(comp.getClass().getName());
stat.setName(comp.getId());
if (stat.getName() == null) {
stat.setName("Unknown");
}
if (comp instanceof AbstractWComponent) {
Object obj = AbstractWComponent.replaceWComponent((AbstractWComponent) comp);
if (obj instanceof AbstractWComponent.WComponentRef) {
stat.setRef(obj.toString());
}
}
ComponentModel model = (ComponentModel) uic.getModel(comp);
stat.setModelState(Stat.MDL_NONE);
if (model != null) {
if (comp.isDefaultState()) {
stat.setModelState(Stat.MDL_DEFAULT);
} else {
addSerializationStat(model, stat);
}
}
return stat;
} | class class_name[name] begin[{]
method[createStat, return_type[type[Stat]], modifier[private], parameter[comp]] begin[{]
local_variable[type[Stat], stat]
call[stat.setClassName, parameter[call[comp.getClass, parameter[]]]]
call[stat.setName, parameter[call[comp.getId, parameter[]]]]
if[binary_operation[call[stat.getName, parameter[]], ==, literal[null]]] begin[{]
call[stat.setName, parameter[literal["Unknown"]]]
else begin[{]
None
end[}]
if[binary_operation[member[.comp], instanceof, type[AbstractWComponent]]] begin[{]
local_variable[type[Object], obj]
if[binary_operation[member[.obj], instanceof, type[AbstractWComponent]]] begin[{]
call[stat.setRef, parameter[call[obj.toString, parameter[]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[ComponentModel], model]
call[stat.setModelState, parameter[member[Stat.MDL_NONE]]]
if[binary_operation[member[.model], !=, literal[null]]] begin[{]
if[call[comp.isDefaultState, parameter[]]] begin[{]
call[stat.setModelState, parameter[member[Stat.MDL_DEFAULT]]]
else begin[{]
call[.addSerializationStat, parameter[member[.model], member[.stat]]]
end[}]
else begin[{]
None
end[}]
return[member[.stat]]
end[}]
END[}] | Keyword[private] identifier[Stat] identifier[createStat] operator[SEP] Keyword[final] identifier[WComponent] identifier[comp] operator[SEP] {
identifier[Stat] identifier[stat] operator[=] Keyword[new] identifier[Stat] operator[SEP] operator[SEP] operator[SEP] identifier[stat] operator[SEP] identifier[setClassName] operator[SEP] identifier[comp] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stat] operator[SEP] identifier[setName] operator[SEP] identifier[comp] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stat] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[stat] operator[SEP] identifier[setName] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[comp] Keyword[instanceof] identifier[AbstractWComponent] operator[SEP] {
identifier[Object] identifier[obj] operator[=] identifier[AbstractWComponent] operator[SEP] identifier[replaceWComponent] operator[SEP] operator[SEP] identifier[AbstractWComponent] operator[SEP] identifier[comp] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[AbstractWComponent] operator[SEP] identifier[WComponentRef] operator[SEP] {
identifier[stat] operator[SEP] identifier[setRef] operator[SEP] identifier[obj] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[ComponentModel] identifier[model] operator[=] operator[SEP] identifier[ComponentModel] operator[SEP] identifier[uic] operator[SEP] identifier[getModel] operator[SEP] identifier[comp] operator[SEP] operator[SEP] identifier[stat] operator[SEP] identifier[setModelState] operator[SEP] identifier[Stat] operator[SEP] identifier[MDL_NONE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[model] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[comp] operator[SEP] identifier[isDefaultState] operator[SEP] operator[SEP] operator[SEP] {
identifier[stat] operator[SEP] identifier[setModelState] operator[SEP] identifier[Stat] operator[SEP] identifier[MDL_DEFAULT] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[addSerializationStat] operator[SEP] identifier[model] , identifier[stat] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[stat] operator[SEP]
}
|
public TransformersSubRegistration getDomainRegistration(final ModelVersionRange range) {
final PathAddress address = PathAddress.EMPTY_ADDRESS;
return new TransformersSubRegistrationImpl(range, domain, address);
} | class class_name[name] begin[{]
method[getDomainRegistration, return_type[type[TransformersSubRegistration]], modifier[public], parameter[range]] begin[{]
local_variable[type[PathAddress], address]
return[ClassCreator(arguments=[MemberReference(member=range, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=domain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=address, 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=TransformersSubRegistrationImpl, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[TransformersSubRegistration] identifier[getDomainRegistration] operator[SEP] Keyword[final] identifier[ModelVersionRange] identifier[range] operator[SEP] {
Keyword[final] identifier[PathAddress] identifier[address] operator[=] identifier[PathAddress] operator[SEP] identifier[EMPTY_ADDRESS] operator[SEP] Keyword[return] Keyword[new] identifier[TransformersSubRegistrationImpl] operator[SEP] identifier[range] , identifier[domain] , identifier[address] operator[SEP] operator[SEP]
}
|
public static String getName() {
String secname = null;
WSCredential credential = getCallerWSCredential();
try {
if (credential != null && !credential.isUnauthenticated()) {
String realmSecname = credential.getRealmSecurityName();
if (realmSecname != null && !realmSecname.isEmpty()) {
secname = realmSecname.substring(realmSecname.lastIndexOf(REALM_SEPARATOR) + 1);
}
}
} catch (Exception e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Internal error: " + e);
}
return secname;
} | class class_name[name] begin[{]
method[getName, return_type[type[String]], modifier[public static], parameter[]] begin[{]
local_variable[type[String], secname]
local_variable[type[WSCredential], credential]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=credential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isUnauthenticated, postfix_operators=[], prefix_operators=['!'], qualifier=credential, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRealmSecurityName, postfix_operators=[], prefix_operators=[], qualifier=credential, selectors=[], type_arguments=None), name=realmSecname)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=realmSecname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=realmSecname, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=secname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=REALM_SEPARATOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lastIndexOf, postfix_operators=[], prefix_operators=[], qualifier=realmSecname, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=realmSecname, selectors=[], type_arguments=None)), label=None)]))]))], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Internal error: "), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
return[member[.secname]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getName] operator[SEP] operator[SEP] {
identifier[String] identifier[secname] operator[=] Other[null] operator[SEP] identifier[WSCredential] identifier[credential] operator[=] identifier[getCallerWSCredential] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[credential] operator[!=] Other[null] operator[&&] operator[!] identifier[credential] operator[SEP] identifier[isUnauthenticated] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[realmSecname] operator[=] identifier[credential] operator[SEP] identifier[getRealmSecurityName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[realmSecname] operator[!=] Other[null] operator[&&] operator[!] identifier[realmSecname] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[secname] operator[=] identifier[realmSecname] operator[SEP] identifier[substring] operator[SEP] identifier[realmSecname] operator[SEP] identifier[lastIndexOf] operator[SEP] identifier[REALM_SEPARATOR] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] 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[e] operator[SEP] operator[SEP]
}
Keyword[return] identifier[secname] operator[SEP]
}
|
public static JobRecord createRootJobRecord(Job<?> jobInstance, JobSetting[] settings) {
Key key = generateKey(null, DATA_STORE_KIND);
return new JobRecord(key, jobInstance, settings);
} | class class_name[name] begin[{]
method[createRootJobRecord, return_type[type[JobRecord]], modifier[public static], parameter[jobInstance, settings]] begin[{]
local_variable[type[Key], key]
return[ClassCreator(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jobInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=settings, 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=JobRecord, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[JobRecord] identifier[createRootJobRecord] operator[SEP] identifier[Job] operator[<] operator[?] operator[>] identifier[jobInstance] , identifier[JobSetting] operator[SEP] operator[SEP] identifier[settings] operator[SEP] {
identifier[Key] identifier[key] operator[=] identifier[generateKey] operator[SEP] Other[null] , identifier[DATA_STORE_KIND] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[JobRecord] operator[SEP] identifier[key] , identifier[jobInstance] , identifier[settings] operator[SEP] operator[SEP]
}
|
@Beta
public static <K, V> ImmutableListMultimap<K, V> copyOf(
Iterable<? extends Entry<? extends K, ? extends V>> entries) {
return new Builder<K, V>().putAll(entries).build();
} | class class_name[name] begin[{]
method[copyOf, return_type[type[ImmutableListMultimap]], modifier[public static], parameter[entries]] begin[{]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=entries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=Builder, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Beta] Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[ImmutableListMultimap] operator[<] identifier[K] , identifier[V] operator[>] identifier[copyOf] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[Entry] operator[<] operator[?] Keyword[extends] identifier[K] , operator[?] Keyword[extends] identifier[V] operator[>] operator[>] identifier[entries] operator[SEP] {
Keyword[return] Keyword[new] identifier[Builder] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[putAll] operator[SEP] identifier[entries] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String trimTrailingCharacter(final String str, final char trailingCharacter) {
if (!StringUtils.hasLength(str)) {
return str;
}
final StringBuilder sb = new StringBuilder(str);
while (sb.length() > 0 && sb.charAt(sb.length() - 1) == trailingCharacter) {
sb.deleteCharAt(sb.length() - 1);
}
return sb.toString();
} | class class_name[name] begin[{]
method[trimTrailingCharacter, return_type[type[String]], modifier[public static], parameter[str, trailingCharacter]] begin[{]
if[call[StringUtils.hasLength, parameter[member[.str]]]] begin[{]
return[member[.str]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], sb]
while[binary_operation[binary_operation[call[sb.length, parameter[]], >, literal[0]], &&, binary_operation[call[sb.charAt, parameter[binary_operation[call[sb.length, parameter[]], -, literal[1]]]], ==, member[.trailingCharacter]]]] begin[{]
call[sb.deleteCharAt, parameter[binary_operation[call[sb.length, parameter[]], -, literal[1]]]]
end[}]
return[call[sb.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[trimTrailingCharacter] operator[SEP] Keyword[final] identifier[String] identifier[str] , Keyword[final] Keyword[char] identifier[trailingCharacter] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[hasLength] operator[SEP] identifier[str] operator[SEP] operator[SEP] {
Keyword[return] identifier[str] operator[SEP]
}
Keyword[final] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[str] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] identifier[sb] operator[SEP] identifier[charAt] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[==] identifier[trailingCharacter] operator[SEP] {
identifier[sb] operator[SEP] identifier[deleteCharAt] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public EClass getIfcLayeredItem() {
if (ifcLayeredItemEClass == null) {
ifcLayeredItemEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(1137);
}
return ifcLayeredItemEClass;
} | class class_name[name] begin[{]
method[getIfcLayeredItem, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcLayeredItemEClass], ==, literal[null]]] begin[{]
assign[member[.ifcLayeredItemEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1137)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))]
else begin[{]
None
end[}]
return[member[.ifcLayeredItemEClass]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcLayeredItem] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcLayeredItemEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcLayeredItemEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[1137] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcLayeredItemEClass] operator[SEP]
}
|
@Override
public DeleteAccountSettingResult deleteAccountSetting(DeleteAccountSettingRequest request) {
request = beforeClientExecution(request);
return executeDeleteAccountSetting(request);
} | class class_name[name] begin[{]
method[deleteAccountSetting, return_type[type[DeleteAccountSettingResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeDeleteAccountSetting, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[DeleteAccountSettingResult] identifier[deleteAccountSetting] operator[SEP] identifier[DeleteAccountSettingRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDeleteAccountSetting] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public List<PackageFile> getPackageFiles(Object projectIdOrPath, Integer packageId) throws GitLabApiException {
return (getPackageFiles(projectIdOrPath, packageId, getDefaultPerPage()).all());
} | class class_name[name] begin[{]
method[getPackageFiles, return_type[type[List]], modifier[public], parameter[projectIdOrPath, packageId]] begin[{]
return[call[.getPackageFiles, parameter[member[.projectIdOrPath], member[.packageId], call[.getDefaultPerPage, parameter[]]]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[PackageFile] operator[>] identifier[getPackageFiles] operator[SEP] identifier[Object] identifier[projectIdOrPath] , identifier[Integer] identifier[packageId] operator[SEP] Keyword[throws] identifier[GitLabApiException] {
Keyword[return] operator[SEP] identifier[getPackageFiles] operator[SEP] identifier[projectIdOrPath] , identifier[packageId] , identifier[getDefaultPerPage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[all] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String escapeXml(final Object target) {
if (target == null) {
return null;
}
return HtmlEscape.escapeHtml4Xml(target.toString());
} | class class_name[name] begin[{]
method[escapeXml, return_type[type[String]], modifier[public static], parameter[target]] begin[{]
if[binary_operation[member[.target], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[call[HtmlEscape.escapeHtml4Xml, parameter[call[target.toString, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[escapeXml] operator[SEP] Keyword[final] identifier[Object] identifier[target] operator[SEP] {
Keyword[if] operator[SEP] identifier[target] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[return] identifier[HtmlEscape] operator[SEP] identifier[escapeHtml4Xml] operator[SEP] identifier[target] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public Observable<ServiceResponse<Evaluate>> evaluateUrlInputWithServiceResponseAsync(String contentType, BodyModelModel imageUrl, Boolean cacheImage) {
if (this.client.baseUrl() == null) {
throw new IllegalArgumentException("Parameter this.client.baseUrl() is required and cannot be null.");
}
if (contentType == null) {
throw new IllegalArgumentException("Parameter contentType is required and cannot be null.");
}
if (imageUrl == null) {
throw new IllegalArgumentException("Parameter imageUrl is required and cannot be null.");
}
Validator.validate(imageUrl);
String parameterizedHost = Joiner.on(", ").join("{baseUrl}", this.client.baseUrl());
return service.evaluateUrlInput(cacheImage, contentType, imageUrl, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Evaluate>>>() {
@Override
public Observable<ServiceResponse<Evaluate>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Evaluate> clientResponse = evaluateUrlInputDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} | class class_name[name] begin[{]
method[evaluateUrlInputWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[contentType, imageUrl, cacheImage]] begin[{]
if[binary_operation[THIS[member[None.client]call[None.baseUrl, parameter[]]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.baseUrl() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.contentType], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter contentType is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.imageUrl], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter imageUrl is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[Validator.validate, parameter[member[.imageUrl]]]
local_variable[type[String], parameterizedHost]
return[call[service.evaluateUrlInput, parameter[member[.cacheImage], member[.contentType], member[.imageUrl], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], member[.parameterizedHost], THIS[member[None.client]call[None.userAgent, parameter[]]]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Evaluate] operator[>] operator[>] identifier[evaluateUrlInputWithServiceResponseAsync] operator[SEP] identifier[String] identifier[contentType] , identifier[BodyModelModel] identifier[imageUrl] , identifier[Boolean] identifier[cacheImage] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[baseUrl] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[contentType] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[imageUrl] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[imageUrl] operator[SEP] operator[SEP] identifier[String] identifier[parameterizedHost] operator[=] identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[join] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[baseUrl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[evaluateUrlInput] operator[SEP] identifier[cacheImage] , identifier[contentType] , identifier[imageUrl] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , identifier[parameterizedHost] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Evaluate] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Evaluate] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] {
Keyword[try] {
identifier[ServiceResponse] operator[<] identifier[Evaluate] operator[>] identifier[clientResponse] operator[=] identifier[evaluateUrlInputDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
|
public static <T> T [] notNullNoNullValue (final T [] aValue, final String sName)
{
if (isEnabled ())
return notNullNoNullValue (aValue, () -> sName);
return aValue;
} | class class_name[name] begin[{]
method[notNullNoNullValue, return_type[type[T]], modifier[public static], parameter[aValue, sName]] begin[{]
if[call[.isEnabled, parameter[]]] begin[{]
return[call[.notNullNoNullValue, parameter[member[.aValue], LambdaExpression(body=MemberReference(member=sName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), parameters=[])]]]
else begin[{]
None
end[}]
return[member[.aValue]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] operator[SEP] operator[SEP] identifier[notNullNoNullValue] operator[SEP] Keyword[final] identifier[T] operator[SEP] operator[SEP] identifier[aValue] , Keyword[final] identifier[String] identifier[sName] operator[SEP] {
Keyword[if] operator[SEP] identifier[isEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[notNullNoNullValue] operator[SEP] identifier[aValue] , operator[SEP] operator[SEP] operator[->] identifier[sName] operator[SEP] operator[SEP] Keyword[return] identifier[aValue] operator[SEP]
}
|
public static void main(String[] argv) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
new ParticleEditor();
} catch (Exception e) {
Log.error(e);
}
} | class class_name[name] begin[{]
method[main, return_type[void], modifier[public static], parameter[argv]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSystemLookAndFeelClassName, postfix_operators=[], prefix_operators=[], qualifier=UIManager, selectors=[], type_arguments=None)], member=setLookAndFeel, postfix_operators=[], prefix_operators=[], qualifier=UIManager, selectors=[], type_arguments=None), label=None), StatementExpression(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParticleEditor, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[argv] operator[SEP] {
Keyword[try] {
identifier[UIManager] operator[SEP] identifier[setLookAndFeel] operator[SEP] identifier[UIManager] operator[SEP] identifier[getSystemLookAndFeelClassName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[new] identifier[ParticleEditor] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[Log] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
protected Set<QName> getProperties(HierarchicalProperty body)
{
HashSet<QName> properties = new HashSet<QName>();
HierarchicalProperty prop = body.getChild(new QName("DAV:", "prop"));
if (prop == null)
{
return properties;
}
for (int i = 0; i < prop.getChildren().size(); i++)
{
HierarchicalProperty property = prop.getChild(i);
properties.add(property.getName());
}
return properties;
} | class class_name[name] begin[{]
method[getProperties, return_type[type[Set]], modifier[protected], parameter[body]] begin[{]
local_variable[type[HashSet], properties]
local_variable[type[HierarchicalProperty], prop]
if[binary_operation[member[.prop], ==, literal[null]]] begin[{]
return[member[.properties]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getChild, postfix_operators=[], prefix_operators=[], qualifier=prop, selectors=[], type_arguments=None), name=property)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HierarchicalProperty, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=prop, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.properties]]
end[}]
END[}] | Keyword[protected] identifier[Set] operator[<] identifier[QName] operator[>] identifier[getProperties] operator[SEP] identifier[HierarchicalProperty] identifier[body] operator[SEP] {
identifier[HashSet] operator[<] identifier[QName] operator[>] identifier[properties] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[QName] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[HierarchicalProperty] identifier[prop] operator[=] identifier[body] operator[SEP] identifier[getChild] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prop] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[properties] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[prop] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[HierarchicalProperty] identifier[property] operator[=] identifier[prop] operator[SEP] identifier[getChild] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[add] operator[SEP] identifier[property] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[properties] operator[SEP]
}
|
protected void createLoginFormView(final Flow flow) {
val propertiesToBind = CollectionUtils.wrapList("username", "password", "source");
val binder = createStateBinderConfiguration(propertiesToBind);
casProperties.getView().getCustomLoginFormFields()
.forEach((field, props) -> {
val fieldName = String.format("customFields[%s]", field);
binder.addBinding(new BinderConfiguration.Binding(fieldName, props.getConverter(), props.isRequired()));
});
val state = createViewState(flow, CasWebflowConstants.STATE_ID_VIEW_LOGIN_FORM, "casLoginView", binder);
state.getRenderActionList().add(createEvaluateAction(CasWebflowConstants.ACTION_ID_RENDER_LOGIN_FORM));
createStateModelBinding(state, CasWebflowConstants.VAR_ID_CREDENTIAL, UsernamePasswordCredential.class);
val transition = createTransitionForState(state, CasWebflowConstants.TRANSITION_ID_SUBMIT, CasWebflowConstants.STATE_ID_REAL_SUBMIT);
val attributes = transition.getAttributes();
attributes.put("bind", Boolean.TRUE);
attributes.put("validate", Boolean.TRUE);
attributes.put("history", History.INVALIDATE);
} | class class_name[name] begin[{]
method[createLoginFormView, return_type[void], modifier[protected], parameter[flow]] begin[{]
local_variable[type[val], propertiesToBind]
local_variable[type[val], binder]
call[casProperties.getView, parameter[]]
local_variable[type[val], state]
call[state.getRenderActionList, parameter[]]
call[.createStateModelBinding, parameter[member[.state], member[CasWebflowConstants.VAR_ID_CREDENTIAL], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UsernamePasswordCredential, sub_type=None))]]
local_variable[type[val], transition]
local_variable[type[val], attributes]
call[attributes.put, parameter[literal["bind"], member[Boolean.TRUE]]]
call[attributes.put, parameter[literal["validate"], member[Boolean.TRUE]]]
call[attributes.put, parameter[literal["history"], member[History.INVALIDATE]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[createLoginFormView] operator[SEP] Keyword[final] identifier[Flow] identifier[flow] operator[SEP] {
identifier[val] identifier[propertiesToBind] operator[=] identifier[CollectionUtils] operator[SEP] identifier[wrapList] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[val] identifier[binder] operator[=] identifier[createStateBinderConfiguration] operator[SEP] identifier[propertiesToBind] operator[SEP] operator[SEP] identifier[casProperties] operator[SEP] identifier[getView] operator[SEP] operator[SEP] operator[SEP] identifier[getCustomLoginFormFields] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] operator[SEP] identifier[field] , identifier[props] operator[SEP] operator[->] {
identifier[val] identifier[fieldName] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[field] operator[SEP] operator[SEP] identifier[binder] operator[SEP] identifier[addBinding] operator[SEP] Keyword[new] identifier[BinderConfiguration] operator[SEP] identifier[Binding] operator[SEP] identifier[fieldName] , identifier[props] operator[SEP] identifier[getConverter] operator[SEP] operator[SEP] , identifier[props] operator[SEP] identifier[isRequired] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] identifier[val] identifier[state] operator[=] identifier[createViewState] operator[SEP] identifier[flow] , identifier[CasWebflowConstants] operator[SEP] identifier[STATE_ID_VIEW_LOGIN_FORM] , literal[String] , identifier[binder] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[getRenderActionList] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[createEvaluateAction] operator[SEP] identifier[CasWebflowConstants] operator[SEP] identifier[ACTION_ID_RENDER_LOGIN_FORM] operator[SEP] operator[SEP] operator[SEP] identifier[createStateModelBinding] operator[SEP] identifier[state] , identifier[CasWebflowConstants] operator[SEP] identifier[VAR_ID_CREDENTIAL] , identifier[UsernamePasswordCredential] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[val] identifier[transition] operator[=] identifier[createTransitionForState] operator[SEP] identifier[state] , identifier[CasWebflowConstants] operator[SEP] identifier[TRANSITION_ID_SUBMIT] , identifier[CasWebflowConstants] operator[SEP] identifier[STATE_ID_REAL_SUBMIT] operator[SEP] operator[SEP] identifier[val] identifier[attributes] operator[=] identifier[transition] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[History] operator[SEP] identifier[INVALIDATE] operator[SEP] operator[SEP]
}
|
public <R> JoinOperatorSetsBase<T, R> rightOuterJoin(DataSet<R> other) {
return new JoinOperatorSetsBase<>(this, other, JoinHint.OPTIMIZER_CHOOSES, JoinType.RIGHT_OUTER);
} | class class_name[name] begin[{]
method[rightOuterJoin, return_type[type[JoinOperatorSetsBase]], modifier[public], parameter[other]] begin[{]
return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=OPTIMIZER_CHOOSES, postfix_operators=[], prefix_operators=[], qualifier=JoinHint, selectors=[]), MemberReference(member=RIGHT_OUTER, postfix_operators=[], prefix_operators=[], qualifier=JoinType, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=JoinOperatorSetsBase, sub_type=None))]
end[}]
END[}] | Keyword[public] operator[<] identifier[R] operator[>] identifier[JoinOperatorSetsBase] operator[<] identifier[T] , identifier[R] operator[>] identifier[rightOuterJoin] operator[SEP] identifier[DataSet] operator[<] identifier[R] operator[>] identifier[other] operator[SEP] {
Keyword[return] Keyword[new] identifier[JoinOperatorSetsBase] operator[<] operator[>] operator[SEP] Keyword[this] , identifier[other] , identifier[JoinHint] operator[SEP] identifier[OPTIMIZER_CHOOSES] , identifier[JoinType] operator[SEP] identifier[RIGHT_OUTER] operator[SEP] operator[SEP]
}
|
public static DPTXlator createTranslator(int dataType) throws KNXException
{
final DPTID dpt = (DPTID) pt.get(new Integer(dataType));
if (dpt == null)
throw new KNXException("PDT not found");
final DPTXlator t =
TranslatorTypes.createTranslator(dpt.getMainNumber(), dpt.getDPT());
t.setAppendUnit(false);
return t;
} | class class_name[name] begin[{]
method[createTranslator, return_type[type[DPTXlator]], modifier[public static], parameter[dataType]] begin[{]
local_variable[type[DPTID], dpt]
if[binary_operation[member[.dpt], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PDT not found")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=KNXException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[DPTXlator], t]
call[t.setAppendUnit, parameter[literal[false]]]
return[member[.t]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[DPTXlator] identifier[createTranslator] operator[SEP] Keyword[int] identifier[dataType] operator[SEP] Keyword[throws] identifier[KNXException] {
Keyword[final] identifier[DPTID] identifier[dpt] operator[=] operator[SEP] identifier[DPTID] operator[SEP] identifier[pt] operator[SEP] identifier[get] operator[SEP] Keyword[new] identifier[Integer] operator[SEP] identifier[dataType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dpt] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[KNXException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[DPTXlator] identifier[t] operator[=] identifier[TranslatorTypes] operator[SEP] identifier[createTranslator] operator[SEP] identifier[dpt] operator[SEP] identifier[getMainNumber] operator[SEP] operator[SEP] , identifier[dpt] operator[SEP] identifier[getDPT] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[t] operator[SEP] identifier[setAppendUnit] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[t] operator[SEP]
}
|
public Size compSize(Size size, int comp) {
if (compWidth[comp] == 0 && compHeight[comp] == 0)
return size;
return new Size(size.getWidth() >> compWidth[comp], size.getHeight() >> compHeight[comp]);
} | class class_name[name] begin[{]
method[compSize, return_type[type[Size]], modifier[public], parameter[size, comp]] begin[{]
if[binary_operation[binary_operation[member[.compWidth], ==, literal[0]], &&, binary_operation[member[.compHeight], ==, literal[0]]]] begin[{]
return[member[.size]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=size, selectors=[], type_arguments=None), operandr=MemberReference(member=compWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=comp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=>>), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=size, selectors=[], type_arguments=None), operandr=MemberReference(member=compHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=comp, 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=Size, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[Size] identifier[compSize] operator[SEP] identifier[Size] identifier[size] , Keyword[int] identifier[comp] operator[SEP] {
Keyword[if] operator[SEP] identifier[compWidth] operator[SEP] identifier[comp] operator[SEP] operator[==] Other[0] operator[&&] identifier[compHeight] operator[SEP] identifier[comp] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[return] identifier[size] operator[SEP] Keyword[return] Keyword[new] identifier[Size] operator[SEP] identifier[size] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[>] operator[>] identifier[compWidth] operator[SEP] identifier[comp] operator[SEP] , identifier[size] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[>] operator[>] identifier[compHeight] operator[SEP] identifier[comp] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public StopRelationalDatabaseResult stopRelationalDatabase(StopRelationalDatabaseRequest request) {
request = beforeClientExecution(request);
return executeStopRelationalDatabase(request);
} | class class_name[name] begin[{]
method[stopRelationalDatabase, return_type[type[StopRelationalDatabaseResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeStopRelationalDatabase, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[StopRelationalDatabaseResult] identifier[stopRelationalDatabase] operator[SEP] identifier[StopRelationalDatabaseRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeStopRelationalDatabase] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public AttributeDescr attribute(AttributeSupportBuilder<?> as) {
AttributeDescr attribute = null;
try {
if (state.backtracking == 0 && input.LA(1) != DRL6Lexer.EOF) {
helper.emit(Location.LOCATION_RULE_HEADER_KEYWORD);
}
if (helper.validateIdentifierKey(DroolsSoftKeywords.SALIENCE)) {
attribute = salience(as);
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.ENABLED)) {
attribute = enabled(as);
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.NO) &&
helper.validateLT(2,
"-") &&
helper.validateLT(3,
DroolsSoftKeywords.LOOP)) {
attribute = booleanAttribute(as,
new String[]{DroolsSoftKeywords.NO, "-", DroolsSoftKeywords.LOOP});
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.AUTO) &&
helper.validateLT(2,
"-") &&
helper.validateLT(3,
DroolsSoftKeywords.FOCUS)) {
attribute = booleanAttribute(as,
new String[]{DroolsSoftKeywords.AUTO, "-", DroolsSoftKeywords.FOCUS});
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.LOCK) &&
helper.validateLT(2,
"-") &&
helper.validateLT(3,
DroolsSoftKeywords.ON) &&
helper.validateLT(4,
"-") &&
helper.validateLT(5,
DroolsSoftKeywords.ACTIVE)) {
attribute = booleanAttribute(as,
new String[]{DroolsSoftKeywords.LOCK, "-", DroolsSoftKeywords.ON, "-", DroolsSoftKeywords.ACTIVE});
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.REFRACT)) {
attribute = booleanAttribute(as,
new String[]{DroolsSoftKeywords.REFRACT});
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.DIRECT)) {
attribute = booleanAttribute(as,
new String[]{DroolsSoftKeywords.DIRECT});
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.AGENDA) &&
helper.validateLT(2,
"-") &&
helper.validateLT(3,
DroolsSoftKeywords.GROUP)) {
attribute = stringAttribute(as,
new String[]{DroolsSoftKeywords.AGENDA, "-", DroolsSoftKeywords.GROUP});
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.ACTIVATION) &&
helper.validateLT(2,
"-") &&
helper.validateLT(3,
DroolsSoftKeywords.GROUP)) {
attribute = stringAttribute(as,
new String[]{DroolsSoftKeywords.ACTIVATION, "-", DroolsSoftKeywords.GROUP});
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.RULEFLOW) &&
helper.validateLT(2,
"-") &&
helper.validateLT(3,
DroolsSoftKeywords.GROUP)) {
attribute = stringAttribute(as,
new String[]{DroolsSoftKeywords.RULEFLOW, "-", DroolsSoftKeywords.GROUP});
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.DATE) &&
helper.validateLT(2,
"-") &&
helper.validateLT(3,
DroolsSoftKeywords.EFFECTIVE)) {
attribute = stringAttribute(as,
new String[]{DroolsSoftKeywords.DATE, "-", DroolsSoftKeywords.EFFECTIVE});
attribute.setType(AttributeDescr.Type.DATE);
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.DATE) &&
helper.validateLT(2,
"-") &&
helper.validateLT(3,
DroolsSoftKeywords.EXPIRES)) {
attribute = stringAttribute(as,
new String[]{DroolsSoftKeywords.DATE, "-", DroolsSoftKeywords.EXPIRES});
attribute.setType(AttributeDescr.Type.DATE);
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.DIALECT)) {
attribute = stringAttribute(as,
new String[]{DroolsSoftKeywords.DIALECT});
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.CALENDARS)) {
attribute = stringListAttribute(as,
new String[]{DroolsSoftKeywords.CALENDARS});
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.TIMER)) {
attribute = intOrChunkAttribute(as,
new String[]{DroolsSoftKeywords.TIMER});
} else if (helper.validateIdentifierKey(DroolsSoftKeywords.DURATION)) {
attribute = intOrChunkAttribute(as,
new String[]{DroolsSoftKeywords.DURATION});
}
if (state.backtracking == 0) {
helper.emit(Location.LOCATION_RULE_HEADER);
}
} catch (RecognitionException re) {
reportError(re);
}
return attribute;
} | class class_name[name] begin[{]
method[attribute, return_type[type[AttributeDescr]], modifier[public], parameter[as]] begin[{]
local_variable[type[AttributeDescr], attribute]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=MemberReference(member=EOF, postfix_operators=[], prefix_operators=[], qualifier=DRL6Lexer, selectors=[]), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LOCATION_RULE_HEADER_KEYWORD, postfix_operators=[], prefix_operators=[], qualifier=Location, selectors=[])], member=emit, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=SALIENCE, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ENABLED, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=NO, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=LOOP, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=AUTO, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=FOCUS, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=LOCK, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=ON, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), MemberReference(member=ACTIVE, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=REFRACT, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=DIRECT, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=AGENDA, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=GROUP, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ACTIVATION, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=GROUP, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=RULEFLOW, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=GROUP, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=DATE, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=EFFECTIVE, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=DATE, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=EXPIRES, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateLT, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=DIALECT, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=CALENDARS, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=TIMER, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=DURATION, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])], member=validateIdentifierKey, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=DURATION, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=intOrChunkAttribute, 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=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=TIMER, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=intOrChunkAttribute, 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=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=CALENDARS, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=stringListAttribute, 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=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=DIALECT, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=stringAttribute, 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=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=DATE, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), MemberReference(member=EXPIRES, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=stringAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DATE, postfix_operators=[], prefix_operators=[], qualifier=AttributeDescr.Type, selectors=[])], member=setType, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=DATE, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), MemberReference(member=EFFECTIVE, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=stringAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DATE, postfix_operators=[], prefix_operators=[], qualifier=AttributeDescr.Type, selectors=[])], member=setType, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=RULEFLOW, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), MemberReference(member=GROUP, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=stringAttribute, 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=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=ACTIVATION, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), MemberReference(member=GROUP, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=stringAttribute, 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=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=AGENDA, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), MemberReference(member=GROUP, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=stringAttribute, 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=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=DIRECT, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=booleanAttribute, 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=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=REFRACT, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=booleanAttribute, 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=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=LOCK, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), MemberReference(member=ON, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), MemberReference(member=ACTIVE, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=booleanAttribute, 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=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=AUTO, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), MemberReference(member=FOCUS, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=booleanAttribute, 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=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=NO, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), MemberReference(member=LOOP, postfix_operators=[], prefix_operators=[], qualifier=DroolsSoftKeywords, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=booleanAttribute, 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=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=enabled, 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=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=as, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=salience, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LOCATION_RULE_HEADER, postfix_operators=[], prefix_operators=[], qualifier=Location, selectors=[])], member=emit, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=None, label=None, resources=None)
return[member[.attribute]]
end[}]
END[}] | Keyword[public] identifier[AttributeDescr] identifier[attribute] operator[SEP] identifier[AttributeSupportBuilder] operator[<] operator[?] operator[>] identifier[as] operator[SEP] {
identifier[AttributeDescr] identifier[attribute] operator[=] Other[null] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[&&] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[!=] identifier[DRL6Lexer] operator[SEP] identifier[EOF] operator[SEP] {
identifier[helper] operator[SEP] identifier[emit] operator[SEP] identifier[Location] operator[SEP] identifier[LOCATION_RULE_HEADER_KEYWORD] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[SALIENCE] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[salience] operator[SEP] identifier[as] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[ENABLED] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[enabled] operator[SEP] identifier[as] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[NO] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[2] , literal[String] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[3] , identifier[DroolsSoftKeywords] operator[SEP] identifier[LOOP] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[booleanAttribute] operator[SEP] identifier[as] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DroolsSoftKeywords] operator[SEP] identifier[NO] , literal[String] , identifier[DroolsSoftKeywords] operator[SEP] identifier[LOOP]
} operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[AUTO] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[2] , literal[String] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[3] , identifier[DroolsSoftKeywords] operator[SEP] identifier[FOCUS] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[booleanAttribute] operator[SEP] identifier[as] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DroolsSoftKeywords] operator[SEP] identifier[AUTO] , literal[String] , identifier[DroolsSoftKeywords] operator[SEP] identifier[FOCUS]
} operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[LOCK] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[2] , literal[String] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[3] , identifier[DroolsSoftKeywords] operator[SEP] identifier[ON] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[4] , literal[String] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[5] , identifier[DroolsSoftKeywords] operator[SEP] identifier[ACTIVE] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[booleanAttribute] operator[SEP] identifier[as] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DroolsSoftKeywords] operator[SEP] identifier[LOCK] , literal[String] , identifier[DroolsSoftKeywords] operator[SEP] identifier[ON] , literal[String] , identifier[DroolsSoftKeywords] operator[SEP] identifier[ACTIVE]
} operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[REFRACT] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[booleanAttribute] operator[SEP] identifier[as] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DroolsSoftKeywords] operator[SEP] identifier[REFRACT]
} operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[DIRECT] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[booleanAttribute] operator[SEP] identifier[as] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DroolsSoftKeywords] operator[SEP] identifier[DIRECT]
} operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[AGENDA] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[2] , literal[String] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[3] , identifier[DroolsSoftKeywords] operator[SEP] identifier[GROUP] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[stringAttribute] operator[SEP] identifier[as] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DroolsSoftKeywords] operator[SEP] identifier[AGENDA] , literal[String] , identifier[DroolsSoftKeywords] operator[SEP] identifier[GROUP]
} operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[ACTIVATION] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[2] , literal[String] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[3] , identifier[DroolsSoftKeywords] operator[SEP] identifier[GROUP] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[stringAttribute] operator[SEP] identifier[as] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DroolsSoftKeywords] operator[SEP] identifier[ACTIVATION] , literal[String] , identifier[DroolsSoftKeywords] operator[SEP] identifier[GROUP]
} operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[RULEFLOW] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[2] , literal[String] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[3] , identifier[DroolsSoftKeywords] operator[SEP] identifier[GROUP] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[stringAttribute] operator[SEP] identifier[as] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DroolsSoftKeywords] operator[SEP] identifier[RULEFLOW] , literal[String] , identifier[DroolsSoftKeywords] operator[SEP] identifier[GROUP]
} operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[DATE] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[2] , literal[String] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[3] , identifier[DroolsSoftKeywords] operator[SEP] identifier[EFFECTIVE] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[stringAttribute] operator[SEP] identifier[as] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DroolsSoftKeywords] operator[SEP] identifier[DATE] , literal[String] , identifier[DroolsSoftKeywords] operator[SEP] identifier[EFFECTIVE]
} operator[SEP] operator[SEP] identifier[attribute] operator[SEP] identifier[setType] operator[SEP] identifier[AttributeDescr] operator[SEP] identifier[Type] operator[SEP] identifier[DATE] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[DATE] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[2] , literal[String] operator[SEP] operator[&&] identifier[helper] operator[SEP] identifier[validateLT] operator[SEP] Other[3] , identifier[DroolsSoftKeywords] operator[SEP] identifier[EXPIRES] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[stringAttribute] operator[SEP] identifier[as] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DroolsSoftKeywords] operator[SEP] identifier[DATE] , literal[String] , identifier[DroolsSoftKeywords] operator[SEP] identifier[EXPIRES]
} operator[SEP] operator[SEP] identifier[attribute] operator[SEP] identifier[setType] operator[SEP] identifier[AttributeDescr] operator[SEP] identifier[Type] operator[SEP] identifier[DATE] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[DIALECT] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[stringAttribute] operator[SEP] identifier[as] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DroolsSoftKeywords] operator[SEP] identifier[DIALECT]
} operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[CALENDARS] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[stringListAttribute] operator[SEP] identifier[as] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DroolsSoftKeywords] operator[SEP] identifier[CALENDARS]
} operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[TIMER] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[intOrChunkAttribute] operator[SEP] identifier[as] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DroolsSoftKeywords] operator[SEP] identifier[TIMER]
} operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[validateIdentifierKey] operator[SEP] identifier[DroolsSoftKeywords] operator[SEP] identifier[DURATION] operator[SEP] operator[SEP] {
identifier[attribute] operator[=] identifier[intOrChunkAttribute] operator[SEP] identifier[as] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DroolsSoftKeywords] operator[SEP] identifier[DURATION]
} operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[helper] operator[SEP] identifier[emit] operator[SEP] identifier[Location] operator[SEP] identifier[LOCATION_RULE_HEADER] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] {
identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP]
}
Keyword[return] identifier[attribute] operator[SEP]
}
|
static int parametersCount(Query query) {
if (query.names().isEmpty())
return countQuestionMarkParameters(query.sql());
else
return query.names().size();
} | class class_name[name] begin[{]
method[parametersCount, return_type[type[int]], modifier[static], parameter[query]] begin[{]
if[call[query.names, parameter[]]] begin[{]
return[call[.countQuestionMarkParameters, parameter[call[query.sql, parameter[]]]]]
else begin[{]
return[call[query.names, parameter[]]]
end[}]
end[}]
END[}] | Keyword[static] Keyword[int] identifier[parametersCount] operator[SEP] identifier[Query] identifier[query] operator[SEP] {
Keyword[if] operator[SEP] identifier[query] operator[SEP] identifier[names] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[countQuestionMarkParameters] operator[SEP] identifier[query] operator[SEP] identifier[sql] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[return] identifier[query] operator[SEP] identifier[names] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP]
}
|
private void buildActivationButton() {
m_activation = new CmsCheckBox(Messages.get().key(Messages.GUI_MULTISELECT_ACTIVATE_0));
m_activation.addStyleName(I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().checkboxlabel());
m_activation.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
public void onValueChange(ValueChangeEvent<Boolean> event) {
setAllCheckboxEnabled(event.getValue().booleanValue());
}
});
} | class class_name[name] begin[{]
method[buildActivationButton, return_type[void], modifier[private], parameter[]] begin[{]
assign[member[.m_activation], ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=GUI_MULTISELECT_ACTIVATE_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsCheckBox, sub_type=None))]
call[m_activation.addStyleName, parameter[call[I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss, parameter[]]]]
call[m_activation.addValueChangeHandler, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[MethodInvocation(arguments=[], member=booleanValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setAllCheckboxEnabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onValueChange, parameters=[FormalParameter(annotations=[], modifiers=set(), name=event, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=[], name=ValueChangeEvent, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=None, name=ValueChangeHandler, sub_type=None))]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[buildActivationButton] operator[SEP] operator[SEP] {
identifier[m_activation] operator[=] Keyword[new] identifier[CmsCheckBox] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_MULTISELECT_ACTIVATE_0] operator[SEP] operator[SEP] operator[SEP] identifier[m_activation] operator[SEP] identifier[addStyleName] operator[SEP] identifier[I_CmsWidgetsLayoutBundle] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[widgetCss] operator[SEP] operator[SEP] operator[SEP] identifier[checkboxlabel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_activation] operator[SEP] identifier[addValueChangeHandler] operator[SEP] Keyword[new] identifier[ValueChangeHandler] operator[<] identifier[Boolean] operator[>] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onValueChange] operator[SEP] identifier[ValueChangeEvent] operator[<] identifier[Boolean] operator[>] identifier[event] operator[SEP] {
identifier[setAllCheckboxEnabled] operator[SEP] identifier[event] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
@SuppressWarnings("squid:S3752") // backwards compatability: multiple methods required
@RequestMapping(
method = {RequestMethod.GET, RequestMethod.POST},
value = "/scripts/{name}/run")
public void runScript(
@PathVariable("name") String scriptName,
@RequestParam Map<String, Object> parameters,
HttpServletResponse response)
throws IOException {
ScriptResult result = savedScriptRunner.runScript(scriptName, parameters);
if (result.getOutputFile() != null) {
response.sendRedirect(format("/files/{0}", result.getOutputFile().getId()));
} else if (StringUtils.isNotBlank(result.getOutput())) {
response.setContentType("text/plain");
PrintWriter pw = response.getWriter();
pw.write(result.getOutput());
pw.flush();
}
} | class class_name[name] begin[{]
method[runScript, return_type[void], modifier[public], parameter[scriptName, parameters, response]] begin[{]
local_variable[type[ScriptResult], result]
if[binary_operation[call[result.getOutputFile, parameter[]], !=, literal[null]]] begin[{]
call[response.sendRedirect, parameter[call[.format, parameter[literal["/files/{0}"], call[result.getOutputFile, parameter[]]]]]]
else begin[{]
if[call[StringUtils.isNotBlank, parameter[call[result.getOutput, parameter[]]]]] begin[{]
call[response.setContentType, parameter[literal["text/plain"]]]
local_variable[type[PrintWriter], pw]
call[pw.write, parameter[call[result.getOutput, parameter[]]]]
call[pw.flush, parameter[]]
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[RequestMapping] operator[SEP] identifier[method] operator[=] {
identifier[RequestMethod] operator[SEP] identifier[GET] , identifier[RequestMethod] operator[SEP] identifier[POST]
} , identifier[value] operator[=] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[runScript] operator[SEP] annotation[@] identifier[PathVariable] operator[SEP] literal[String] operator[SEP] identifier[String] identifier[scriptName] , annotation[@] identifier[RequestParam] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[parameters] , identifier[HttpServletResponse] identifier[response] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[ScriptResult] identifier[result] operator[=] identifier[savedScriptRunner] operator[SEP] identifier[runScript] operator[SEP] identifier[scriptName] , identifier[parameters] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[getOutputFile] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[response] operator[SEP] identifier[sendRedirect] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[result] operator[SEP] identifier[getOutputFile] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[result] operator[SEP] identifier[getOutput] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[response] operator[SEP] identifier[setContentType] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[PrintWriter] identifier[pw] operator[=] identifier[response] operator[SEP] identifier[getWriter] operator[SEP] operator[SEP] operator[SEP] identifier[pw] operator[SEP] identifier[write] operator[SEP] identifier[result] operator[SEP] identifier[getOutput] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pw] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public Page<FieldValueList> list(Schema schema, String field) {
// [START ]
Page<FieldValueList> page = table.list(schema);
for (FieldValueList row : page.iterateAll()) {
row.get(field);
}
// [END ]
return page;
} | class class_name[name] begin[{]
method[list, return_type[type[Page]], modifier[public], parameter[schema, field]] begin[{]
local_variable[type[Page], page]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=iterateAll, postfix_operators=[], prefix_operators=[], qualifier=page, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=row)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FieldValueList, sub_type=None))), label=None)
return[member[.page]]
end[}]
END[}] | Keyword[public] identifier[Page] operator[<] identifier[FieldValueList] operator[>] identifier[list] operator[SEP] identifier[Schema] identifier[schema] , identifier[String] identifier[field] operator[SEP] {
identifier[Page] operator[<] identifier[FieldValueList] operator[>] identifier[page] operator[=] identifier[table] operator[SEP] identifier[list] operator[SEP] identifier[schema] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[FieldValueList] identifier[row] operator[:] identifier[page] operator[SEP] identifier[iterateAll] operator[SEP] operator[SEP] operator[SEP] {
identifier[row] operator[SEP] identifier[get] operator[SEP] identifier[field] operator[SEP] operator[SEP]
}
Keyword[return] identifier[page] operator[SEP]
}
|
private String readInstrumentationKeyFromConfiguration() {
try (final InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(
CONFIGURATION_FILE)) {
final String configuration = IOUtils.toString(inputStream);
final Matcher matcher = INSTRUMENTATION_KEY_PATTERN.matcher(configuration);
if (matcher.find()) {
return matcher.group(1);
} else {
return StringUtils.EMPTY;
}
} catch (IOException exception) {
return StringUtils.EMPTY;
}
} | class class_name[name] begin[{]
method[readInstrumentationKeyFromConfiguration, return_type[type[String]], modifier[private], parameter[]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), name=configuration)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=configuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=INSTRUMENTATION_KEY_PATTERN, selectors=[], type_arguments=None), name=matcher)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Matcher, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=find, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=EMPTY, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=group, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ReturnStatement(expression=MemberReference(member=EMPTY, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['IOException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers={'final'}, name=inputStream, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=CONFIGURATION_FILE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResourceAsStream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]))])
end[}]
END[}] | Keyword[private] identifier[String] identifier[readInstrumentationKeyFromConfiguration] operator[SEP] operator[SEP] {
Keyword[try] operator[SEP] Keyword[final] identifier[InputStream] identifier[inputStream] operator[=] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceAsStream] operator[SEP] identifier[CONFIGURATION_FILE] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[configuration] operator[=] identifier[IOUtils] operator[SEP] identifier[toString] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] Keyword[final] identifier[Matcher] identifier[matcher] operator[=] identifier[INSTRUMENTATION_KEY_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[configuration] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[StringUtils] operator[SEP] identifier[EMPTY] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[exception] operator[SEP] {
Keyword[return] identifier[StringUtils] operator[SEP] identifier[EMPTY] operator[SEP]
}
}
|
protected final List<DataBucket> getSnapshotBuckets(final long pSeqDataBucketKey) throws TTIOException {
// Return Value, since the revision iterates a flexible number of version, this has to be a list
// first.
final List<DataBucket> dataBuckets = new ArrayList<DataBucket>();
// Getting the keys for the revRoots
final long[] pathToRoot =
BucketReadTrx.dereferenceLeafOfTree(mBucketReader,
mUberBucket.getReferenceKeys()[IReferenceBucket.GUARANTEED_INDIRECT_OFFSET], mRootBucket
.getRevision());
final RevisionRootBucket rootBucket =
(RevisionRootBucket)mBucketReader.read(pathToRoot[IConstants.INDIRECT_BUCKET_COUNT.length]);
final int numbersToRestore =
Integer.parseInt(mSession.getConfig().mProperties.getProperty(ConstructorProps.NUMBERTORESTORE));
// starting from the current databucket
final long[] pathToRecentBucket =
dereferenceLeafOfTree(mBucketReader,
rootBucket.getReferenceKeys()[IReferenceBucket.GUARANTEED_INDIRECT_OFFSET], pSeqDataBucketKey);
DataBucket bucket;
long bucketKey = pathToRecentBucket[IConstants.INDIRECT_BUCKET_COUNT.length];
// jumping through the databuckets based on the pointers
while (dataBuckets.size() < numbersToRestore && bucketKey > -1) {
bucket = (DataBucket)mBucketReader.read(bucketKey);
dataBuckets.add(bucket);
bucketKey = bucket.getLastBucketPointer();
}
// check if bucket was ever written before to perform check
if (bucketKey > -1) {
checkStructure(mBucketReader, pathToRecentBucket, rootBucket, pSeqDataBucketKey);
checkStructure(mBucketReader, pathToRoot, mUberBucket, mRootBucket.getRevision());
}
return dataBuckets;
} | class class_name[name] begin[{]
method[getSnapshotBuckets, return_type[type[List]], modifier[final protected], parameter[pSeqDataBucketKey]] begin[{]
local_variable[type[List], dataBuckets]
local_variable[type[long], pathToRoot]
local_variable[type[RevisionRootBucket], rootBucket]
local_variable[type[int], numbersToRestore]
local_variable[type[long], pathToRecentBucket]
local_variable[type[DataBucket], bucket]
local_variable[type[long], bucketKey]
while[binary_operation[binary_operation[call[dataBuckets.size, parameter[]], <, member[.numbersToRestore]], &&, binary_operation[member[.bucketKey], >, literal[1]]]] begin[{]
assign[member[.bucket], Cast(expression=MethodInvocation(arguments=[MemberReference(member=bucketKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=mBucketReader, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=DataBucket, sub_type=None))]
call[dataBuckets.add, parameter[member[.bucket]]]
assign[member[.bucketKey], call[bucket.getLastBucketPointer, parameter[]]]
end[}]
if[binary_operation[member[.bucketKey], >, literal[1]]] begin[{]
call[.checkStructure, parameter[member[.mBucketReader], member[.pathToRecentBucket], member[.rootBucket], member[.pSeqDataBucketKey]]]
call[.checkStructure, parameter[member[.mBucketReader], member[.pathToRoot], member[.mUberBucket], call[mRootBucket.getRevision, parameter[]]]]
else begin[{]
None
end[}]
return[member[.dataBuckets]]
end[}]
END[}] | Keyword[protected] Keyword[final] identifier[List] operator[<] identifier[DataBucket] operator[>] identifier[getSnapshotBuckets] operator[SEP] Keyword[final] Keyword[long] identifier[pSeqDataBucketKey] operator[SEP] Keyword[throws] identifier[TTIOException] {
Keyword[final] identifier[List] operator[<] identifier[DataBucket] operator[>] identifier[dataBuckets] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[DataBucket] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] operator[SEP] operator[SEP] identifier[pathToRoot] operator[=] identifier[BucketReadTrx] operator[SEP] identifier[dereferenceLeafOfTree] operator[SEP] identifier[mBucketReader] , identifier[mUberBucket] operator[SEP] identifier[getReferenceKeys] operator[SEP] operator[SEP] operator[SEP] identifier[IReferenceBucket] operator[SEP] identifier[GUARANTEED_INDIRECT_OFFSET] operator[SEP] , identifier[mRootBucket] operator[SEP] identifier[getRevision] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[RevisionRootBucket] identifier[rootBucket] operator[=] operator[SEP] identifier[RevisionRootBucket] operator[SEP] identifier[mBucketReader] operator[SEP] identifier[read] operator[SEP] identifier[pathToRoot] operator[SEP] identifier[IConstants] operator[SEP] identifier[INDIRECT_BUCKET_COUNT] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[numbersToRestore] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[mSession] operator[SEP] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] identifier[mProperties] operator[SEP] identifier[getProperty] operator[SEP] identifier[ConstructorProps] operator[SEP] identifier[NUMBERTORESTORE] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] operator[SEP] operator[SEP] identifier[pathToRecentBucket] operator[=] identifier[dereferenceLeafOfTree] operator[SEP] identifier[mBucketReader] , identifier[rootBucket] operator[SEP] identifier[getReferenceKeys] operator[SEP] operator[SEP] operator[SEP] identifier[IReferenceBucket] operator[SEP] identifier[GUARANTEED_INDIRECT_OFFSET] operator[SEP] , identifier[pSeqDataBucketKey] operator[SEP] operator[SEP] identifier[DataBucket] identifier[bucket] operator[SEP] Keyword[long] identifier[bucketKey] operator[=] identifier[pathToRecentBucket] operator[SEP] identifier[IConstants] operator[SEP] identifier[INDIRECT_BUCKET_COUNT] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[dataBuckets] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[numbersToRestore] operator[&&] identifier[bucketKey] operator[>] operator[-] Other[1] operator[SEP] {
identifier[bucket] operator[=] operator[SEP] identifier[DataBucket] operator[SEP] identifier[mBucketReader] operator[SEP] identifier[read] operator[SEP] identifier[bucketKey] operator[SEP] operator[SEP] identifier[dataBuckets] operator[SEP] identifier[add] operator[SEP] identifier[bucket] operator[SEP] operator[SEP] identifier[bucketKey] operator[=] identifier[bucket] operator[SEP] identifier[getLastBucketPointer] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[bucketKey] operator[>] operator[-] Other[1] operator[SEP] {
identifier[checkStructure] operator[SEP] identifier[mBucketReader] , identifier[pathToRecentBucket] , identifier[rootBucket] , identifier[pSeqDataBucketKey] operator[SEP] operator[SEP] identifier[checkStructure] operator[SEP] identifier[mBucketReader] , identifier[pathToRoot] , identifier[mUberBucket] , identifier[mRootBucket] operator[SEP] identifier[getRevision] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[dataBuckets] operator[SEP]
}
|
public static Point from(double lon, double lat, double alt) {
return new Point(new SinglePosition(lon, lat, alt));
} | class class_name[name] begin[{]
method[from, return_type[type[Point]], modifier[public static], parameter[lon, lat, alt]] begin[{]
return[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=lon, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=alt, 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=SinglePosition, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Point, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Point] identifier[from] operator[SEP] Keyword[double] identifier[lon] , Keyword[double] identifier[lat] , Keyword[double] identifier[alt] operator[SEP] {
Keyword[return] Keyword[new] identifier[Point] operator[SEP] Keyword[new] identifier[SinglePosition] operator[SEP] identifier[lon] , identifier[lat] , identifier[alt] operator[SEP] operator[SEP] operator[SEP]
}
|
private void saveCrashReportFile(@NonNull File file, @NonNull CrashReportData crashData) {
try {
if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Writing crash report file " + file);
final CrashReportPersister persister = new CrashReportPersister();
persister.store(crashData, file);
} catch (Exception e) {
ACRA.log.e(LOG_TAG, "An error occurred while writing the report file...", e);
}
} | class class_name[name] begin[{]
method[saveCrashReportFile, return_type[void], modifier[private], parameter[file, crashData]] begin[{]
TryStatement(block=[IfStatement(condition=MemberReference(member=DEV_LOGGING, postfix_operators=[], prefix_operators=[], qualifier=ACRA, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LOG_TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Writing crash report file "), operandr=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=d, postfix_operators=[], prefix_operators=[], qualifier=ACRA.log, selectors=[], type_arguments=None), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CrashReportPersister, sub_type=None)), name=persister)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=CrashReportPersister, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=crashData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=store, postfix_operators=[], prefix_operators=[], qualifier=persister, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LOG_TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An error occurred while writing the report file..."), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=e, postfix_operators=[], prefix_operators=[], qualifier=ACRA.log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[saveCrashReportFile] operator[SEP] annotation[@] identifier[NonNull] identifier[File] identifier[file] , annotation[@] identifier[NonNull] identifier[CrashReportData] identifier[crashData] operator[SEP] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[ACRA] operator[SEP] identifier[DEV_LOGGING] operator[SEP] identifier[ACRA] operator[SEP] identifier[log] operator[SEP] identifier[d] operator[SEP] identifier[LOG_TAG] , literal[String] operator[+] identifier[file] operator[SEP] operator[SEP] Keyword[final] identifier[CrashReportPersister] identifier[persister] operator[=] Keyword[new] identifier[CrashReportPersister] operator[SEP] operator[SEP] operator[SEP] identifier[persister] operator[SEP] identifier[store] operator[SEP] identifier[crashData] , identifier[file] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[ACRA] operator[SEP] identifier[log] operator[SEP] identifier[e] operator[SEP] identifier[LOG_TAG] , literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public double distance(Object pt1, Object pt2) {
Object p = newCopy(pt1);
subtract(p, pt2);
return magnitude(p);
} | class class_name[name] begin[{]
method[distance, return_type[type[double]], modifier[public], parameter[pt1, pt2]] begin[{]
local_variable[type[Object], p]
call[.subtract, parameter[member[.p], member[.pt2]]]
return[call[.magnitude, parameter[member[.p]]]]
end[}]
END[}] | Keyword[public] Keyword[double] identifier[distance] operator[SEP] identifier[Object] identifier[pt1] , identifier[Object] identifier[pt2] operator[SEP] {
identifier[Object] identifier[p] operator[=] identifier[newCopy] operator[SEP] identifier[pt1] operator[SEP] operator[SEP] identifier[subtract] operator[SEP] identifier[p] , identifier[pt2] operator[SEP] operator[SEP] Keyword[return] identifier[magnitude] operator[SEP] identifier[p] operator[SEP] operator[SEP]
}
|
public void populateFromAttributes(
@Nonnull final Template template,
@Nonnull final Map<String, Attribute> attributes,
@Nonnull final PObject requestJsonAttributes) {
if (requestJsonAttributes.has(JSON_REQUEST_HEADERS) &&
requestJsonAttributes.getObject(JSON_REQUEST_HEADERS).has(JSON_REQUEST_HEADERS) &&
!attributes.containsKey(JSON_REQUEST_HEADERS)) {
attributes.put(JSON_REQUEST_HEADERS, new HttpRequestHeadersAttribute());
}
for (Map.Entry<String, Attribute> attribute: attributes.entrySet()) {
try {
put(attribute.getKey(),
attribute.getValue().getValue(template, attribute.getKey(), requestJsonAttributes));
} catch (ObjectMissingException | IllegalArgumentException e) {
throw e;
} catch (Throwable e) {
String templateName = "unknown";
for (Map.Entry<String, Template> entry: template.getConfiguration().getTemplates()
.entrySet()) {
if (entry.getValue() == template) {
templateName = entry.getKey();
break;
}
}
String defaults = "";
if (attribute instanceof ReflectiveAttribute<?>) {
ReflectiveAttribute<?> reflectiveAttribute = (ReflectiveAttribute<?>) attribute;
defaults = "\n\n The attribute defaults are: " + reflectiveAttribute.getDefaultValue();
}
String errorMsg = "An error occurred when creating a value from the '" + attribute.getKey() +
"' attribute for the '" +
templateName + "' template.\n\nThe JSON is: \n" + requestJsonAttributes + defaults +
"\n" +
e.toString();
throw new AttributeParsingException(errorMsg, e);
}
}
if (template.getConfiguration().isThrowErrorOnExtraParameters()) {
final List<String> extraProperties = new ArrayList<>();
for (Iterator<String> it = requestJsonAttributes.keys(); it.hasNext(); ) {
final String attributeName = it.next();
if (!attributes.containsKey(attributeName)) {
extraProperties.add(attributeName);
}
}
if (!extraProperties.isEmpty()) {
throw new ExtraPropertyException("Extra properties found in the request attributes",
extraProperties, attributes.keySet());
}
}
} | class class_name[name] begin[{]
method[populateFromAttributes, return_type[void], modifier[public], parameter[template, attributes, requestJsonAttributes]] begin[{]
if[binary_operation[binary_operation[call[requestJsonAttributes.has, parameter[member[.JSON_REQUEST_HEADERS]]], &&, call[requestJsonAttributes.getObject, parameter[member[.JSON_REQUEST_HEADERS]]]], &&, call[attributes.containsKey, parameter[member[.JSON_REQUEST_HEADERS]]]]] begin[{]
call[attributes.put, parameter[member[.JSON_REQUEST_HEADERS], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpRequestHeadersAttribute, sub_type=None))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[MethodInvocation(arguments=[MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), MemberReference(member=requestJsonAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ObjectMissingException', 'IllegalArgumentException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unknown"), name=templateName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operandr=MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=templateName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getConfiguration, postfix_operators=[], prefix_operators=[], qualifier=template, selectors=[MethodInvocation(arguments=[], member=getTemplates, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=entrySet, 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=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Template, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), name=defaults)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=ReflectiveAttribute, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=ReflectiveAttribute, sub_type=None)), name=reflectiveAttribute)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=ReflectiveAttribute, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=defaults, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n\n The attribute defaults are: "), operandr=MethodInvocation(arguments=[], member=getDefaultValue, postfix_operators=[], prefix_operators=[], qualifier=reflectiveAttribute, selectors=[], type_arguments=None), operator=+)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An error occurred when creating a value from the '"), operandr=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' attribute for the '"), operator=+), operandr=MemberReference(member=templateName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' template.\n\nThe JSON is: \n"), operator=+), operandr=MemberReference(member=requestJsonAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=defaults, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), name=errorMsg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=errorMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=AttributeParsingException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=attribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
if[call[template.getConfiguration, parameter[]]] begin[{]
local_variable[type[List], extraProperties]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), name=attributeName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=attributeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=['!'], qualifier=attributes, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=attributeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=extraProperties, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=keys, postfix_operators=[], prefix_operators=[], qualifier=requestJsonAttributes, selectors=[], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)
if[call[extraProperties.isEmpty, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Extra properties found in the request attributes"), MemberReference(member=extraProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExtraPropertyException, sub_type=None)), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[populateFromAttributes] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[Template] identifier[template] , annotation[@] identifier[Nonnull] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Attribute] operator[>] identifier[attributes] , annotation[@] identifier[Nonnull] Keyword[final] identifier[PObject] identifier[requestJsonAttributes] operator[SEP] {
Keyword[if] operator[SEP] identifier[requestJsonAttributes] operator[SEP] identifier[has] operator[SEP] identifier[JSON_REQUEST_HEADERS] operator[SEP] operator[&&] identifier[requestJsonAttributes] operator[SEP] identifier[getObject] operator[SEP] identifier[JSON_REQUEST_HEADERS] operator[SEP] operator[SEP] identifier[has] operator[SEP] identifier[JSON_REQUEST_HEADERS] operator[SEP] operator[&&] operator[!] identifier[attributes] operator[SEP] identifier[containsKey] operator[SEP] identifier[JSON_REQUEST_HEADERS] operator[SEP] operator[SEP] {
identifier[attributes] operator[SEP] identifier[put] operator[SEP] identifier[JSON_REQUEST_HEADERS] , Keyword[new] identifier[HttpRequestHeadersAttribute] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Attribute] operator[>] identifier[attribute] operator[:] identifier[attributes] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[put] operator[SEP] identifier[attribute] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[attribute] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] identifier[template] , identifier[attribute] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[requestJsonAttributes] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ObjectMissingException] operator[|] identifier[IllegalArgumentException] identifier[e] operator[SEP] {
Keyword[throw] identifier[e] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] {
identifier[String] identifier[templateName] operator[=] literal[String] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Template] operator[>] identifier[entry] operator[:] identifier[template] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[getTemplates] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[==] identifier[template] operator[SEP] {
identifier[templateName] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
identifier[String] identifier[defaults] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[attribute] Keyword[instanceof] identifier[ReflectiveAttribute] operator[<] operator[?] operator[>] operator[SEP] {
identifier[ReflectiveAttribute] operator[<] operator[?] operator[>] identifier[reflectiveAttribute] operator[=] operator[SEP] identifier[ReflectiveAttribute] operator[<] operator[?] operator[>] operator[SEP] identifier[attribute] operator[SEP] identifier[defaults] operator[=] literal[String] operator[+] identifier[reflectiveAttribute] operator[SEP] identifier[getDefaultValue] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[errorMsg] operator[=] literal[String] operator[+] identifier[attribute] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[templateName] operator[+] literal[String] operator[+] identifier[requestJsonAttributes] operator[+] identifier[defaults] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[AttributeParsingException] operator[SEP] identifier[errorMsg] , identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[template] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[isThrowErrorOnExtraParameters] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[extraProperties] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[String] operator[>] identifier[it] operator[=] identifier[requestJsonAttributes] operator[SEP] identifier[keys] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[attributeName] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[attributes] operator[SEP] identifier[containsKey] operator[SEP] identifier[attributeName] operator[SEP] operator[SEP] {
identifier[extraProperties] operator[SEP] identifier[add] operator[SEP] identifier[attributeName] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[extraProperties] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ExtraPropertyException] operator[SEP] literal[String] , identifier[extraProperties] , identifier[attributes] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
protected SIMPMessage getMessageLocked(int classification) throws MessageStoreException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getMessageLocked", Integer.valueOf(classification));
SIMPMessage msg = null;
if(!classifyingMessages)
msg = (SIMPMessage)getDefaultGetCursor().next();
else
msg = (SIMPMessage)getGetCursor(classification).next();
if (msg != null)
msg.setLocalisingME(consumerDispatcher.getMessageProcessor().getMessagingEngineUuid());
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getMessageLocked", msg);
return msg;
} | class class_name[name] begin[{]
method[getMessageLocked, return_type[type[SIMPMessage]], modifier[protected], parameter[classification]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["getMessageLocked"], call[Integer.valueOf, parameter[member[.classification]]]]]
else begin[{]
None
end[}]
local_variable[type[SIMPMessage], msg]
if[member[.classifyingMessages]] begin[{]
assign[member[.msg], Cast(expression=MethodInvocation(arguments=[], member=getDefaultGetCursor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=next, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SIMPMessage, sub_type=None))]
else begin[{]
assign[member[.msg], Cast(expression=MethodInvocation(arguments=[MemberReference(member=classification, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getGetCursor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=next, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SIMPMessage, sub_type=None))]
end[}]
if[binary_operation[member[.msg], !=, literal[null]]] begin[{]
call[msg.setLocalisingME, parameter[call[consumerDispatcher.getMessageProcessor, parameter[]]]]
else begin[{]
None
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["getMessageLocked"], member[.msg]]]
else begin[{]
None
end[}]
return[member[.msg]]
end[}]
END[}] | Keyword[protected] identifier[SIMPMessage] identifier[getMessageLocked] operator[SEP] Keyword[int] identifier[classification] operator[SEP] Keyword[throws] identifier[MessageStoreException] {
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[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[classification] operator[SEP] operator[SEP] operator[SEP] identifier[SIMPMessage] identifier[msg] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[classifyingMessages] operator[SEP] identifier[msg] operator[=] operator[SEP] identifier[SIMPMessage] operator[SEP] identifier[getDefaultGetCursor] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[msg] operator[=] operator[SEP] identifier[SIMPMessage] operator[SEP] identifier[getGetCursor] operator[SEP] identifier[classification] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[msg] operator[!=] Other[null] operator[SEP] identifier[msg] operator[SEP] identifier[setLocalisingME] operator[SEP] identifier[consumerDispatcher] operator[SEP] identifier[getMessageProcessor] operator[SEP] operator[SEP] operator[SEP] identifier[getMessagingEngineUuid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[msg] operator[SEP] operator[SEP] Keyword[return] identifier[msg] operator[SEP]
}
|
protected AbstractButton findButton(AbstractCommand attachedCommand, List buttons) {
if (buttons == null) {
return null;
}
for (Iterator it = buttons.iterator(); it.hasNext();) {
AbstractButton button = (AbstractButton)it.next();
if (!(button instanceof JMenuItem) && attachedCommand.isAttached(button)) {
it.remove();
return button;
}
}
return null;
} | class class_name[name] begin[{]
method[findButton, return_type[type[AbstractButton]], modifier[protected], parameter[attachedCommand, buttons]] begin[{]
if[binary_operation[member[.buttons], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AbstractButton, sub_type=None)), name=button)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractButton, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=button, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=JMenuItem, sub_type=None), operator=instanceof), operandr=MethodInvocation(arguments=[MemberReference(member=button, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAttached, postfix_operators=[], prefix_operators=[], qualifier=attachedCommand, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=button, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=buttons, selectors=[], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)
return[literal[null]]
end[}]
END[}] | Keyword[protected] identifier[AbstractButton] identifier[findButton] operator[SEP] identifier[AbstractCommand] identifier[attachedCommand] , identifier[List] identifier[buttons] operator[SEP] {
Keyword[if] operator[SEP] identifier[buttons] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Iterator] identifier[it] operator[=] identifier[buttons] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[AbstractButton] identifier[button] operator[=] operator[SEP] identifier[AbstractButton] operator[SEP] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[button] Keyword[instanceof] identifier[JMenuItem] operator[SEP] operator[&&] identifier[attachedCommand] operator[SEP] identifier[isAttached] operator[SEP] identifier[button] operator[SEP] operator[SEP] {
identifier[it] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[button] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public static boolean lineIntersects(Coordinate c1, Coordinate c2, Coordinate c3, Coordinate c4) {
LineSegment ls1 = new LineSegment(c1, c2);
LineSegment ls2 = new LineSegment(c3, c4);
return ls1.intersects(ls2);
} | class class_name[name] begin[{]
method[lineIntersects, return_type[type[boolean]], modifier[public static], parameter[c1, c2, c3, c4]] begin[{]
local_variable[type[LineSegment], ls1]
local_variable[type[LineSegment], ls2]
return[call[ls1.intersects, parameter[member[.ls2]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[lineIntersects] operator[SEP] identifier[Coordinate] identifier[c1] , identifier[Coordinate] identifier[c2] , identifier[Coordinate] identifier[c3] , identifier[Coordinate] identifier[c4] operator[SEP] {
identifier[LineSegment] identifier[ls1] operator[=] Keyword[new] identifier[LineSegment] operator[SEP] identifier[c1] , identifier[c2] operator[SEP] operator[SEP] identifier[LineSegment] identifier[ls2] operator[=] Keyword[new] identifier[LineSegment] operator[SEP] identifier[c3] , identifier[c4] operator[SEP] operator[SEP] Keyword[return] identifier[ls1] operator[SEP] identifier[intersects] operator[SEP] identifier[ls2] operator[SEP] operator[SEP]
}
|
public Calendar adjustDate(final Calendar startDate, final int increment, final NonWorkingDayChecker<Calendar> checker) {
final Calendar cal = (Calendar) startDate.clone();
while (checker.isNonWorkingDay(cal)) {
cal.add(Calendar.DAY_OF_MONTH, increment);
}
return cal;
} | class class_name[name] begin[{]
method[adjustDate, return_type[type[Calendar]], modifier[public], parameter[startDate, increment, checker]] begin[{]
local_variable[type[Calendar], cal]
while[call[checker.isNonWorkingDay, parameter[member[.cal]]]] begin[{]
call[cal.add, parameter[member[Calendar.DAY_OF_MONTH], member[.increment]]]
end[}]
return[member[.cal]]
end[}]
END[}] | Keyword[public] identifier[Calendar] identifier[adjustDate] operator[SEP] Keyword[final] identifier[Calendar] identifier[startDate] , Keyword[final] Keyword[int] identifier[increment] , Keyword[final] identifier[NonWorkingDayChecker] operator[<] identifier[Calendar] operator[>] identifier[checker] operator[SEP] {
Keyword[final] identifier[Calendar] identifier[cal] operator[=] operator[SEP] identifier[Calendar] operator[SEP] identifier[startDate] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[checker] operator[SEP] identifier[isNonWorkingDay] operator[SEP] identifier[cal] operator[SEP] operator[SEP] {
identifier[cal] operator[SEP] identifier[add] operator[SEP] identifier[Calendar] operator[SEP] identifier[DAY_OF_MONTH] , identifier[increment] operator[SEP] operator[SEP]
}
Keyword[return] identifier[cal] operator[SEP]
}
|
private void storeInSession()
{
try {
Context.getThreadContext().setSessionAttribute(getCacheKey(), isExpanded());
} catch (final EFapsException e) {
UIMenuItem.LOG.error("Error storing Session info for UIMenuItem called by Command with UUID: {}",
getCommandUUID(), e);
}
} | class class_name[name] begin[{]
method[storeInSession, return_type[void], modifier[private], parameter[]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getThreadContext, postfix_operators=[], prefix_operators=[], qualifier=Context, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCacheKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=isExpanded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setSessionAttribute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error storing Session info for UIMenuItem called by Command with UUID: {}"), MethodInvocation(arguments=[], member=getCommandUUID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=UIMenuItem.LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['EFapsException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[storeInSession] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[Context] operator[SEP] identifier[getThreadContext] operator[SEP] operator[SEP] operator[SEP] identifier[setSessionAttribute] operator[SEP] identifier[getCacheKey] operator[SEP] operator[SEP] , identifier[isExpanded] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[EFapsException] identifier[e] operator[SEP] {
identifier[UIMenuItem] operator[SEP] identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[getCommandUUID] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public DJXYAreaChartBuilder addSerie(AbstractColumn column, String label) {
getDataset().addSerie(column, label);
return this;
} | class class_name[name] begin[{]
method[addSerie, return_type[type[DJXYAreaChartBuilder]], modifier[public], parameter[column, label]] begin[{]
call[.getDataset, parameter[]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[DJXYAreaChartBuilder] identifier[addSerie] operator[SEP] identifier[AbstractColumn] identifier[column] , identifier[String] identifier[label] operator[SEP] {
identifier[getDataset] operator[SEP] operator[SEP] operator[SEP] identifier[addSerie] operator[SEP] identifier[column] , identifier[label] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public ConnectionFactory createConnectionFactory(JmsJcaConnectionFactory jcaConnectionFactory, JmsJcaManagedConnectionFactory jcaManagedConnectionFactory) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "createConnectionFactory", new Object[] { jcaConnectionFactory, jcaManagedConnectionFactory });
ConnectionFactory cf = new JmsConnectionFactoryImpl(jcaConnectionFactory, jcaManagedConnectionFactory);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "createConnectionFactory", cf);
return cf;
} | class class_name[name] begin[{]
method[createConnectionFactory, return_type[type[ConnectionFactory]], modifier[public], parameter[jcaConnectionFactory, jcaManagedConnectionFactory]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[THIS[], member[.tc], literal["createConnectionFactory"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=jcaConnectionFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jcaManagedConnectionFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
else begin[{]
None
end[}]
local_variable[type[ConnectionFactory], cf]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[THIS[], member[.tc], literal["createConnectionFactory"], member[.cf]]]
else begin[{]
None
end[}]
return[member[.cf]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ConnectionFactory] identifier[createConnectionFactory] operator[SEP] identifier[JmsJcaConnectionFactory] identifier[jcaConnectionFactory] , identifier[JmsJcaManagedConnectionFactory] identifier[jcaManagedConnectionFactory] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[jcaConnectionFactory] , identifier[jcaManagedConnectionFactory]
} operator[SEP] operator[SEP] identifier[ConnectionFactory] identifier[cf] operator[=] Keyword[new] identifier[JmsConnectionFactoryImpl] operator[SEP] identifier[jcaConnectionFactory] , identifier[jcaManagedConnectionFactory] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[cf] operator[SEP] operator[SEP] Keyword[return] identifier[cf] operator[SEP]
}
|
private static String getSubgraphSmiles(IAtomContainer subgraph, IAtomContainer molecule) throws CDKException {
Set<IBond> bonds = new HashSet<>();
for (IBond bond : subgraph.bonds())
bonds.add(bond);
Integer[] hCount = new Integer[subgraph.getAtomCount()];
for (int i = 0; i < subgraph.getAtomCount(); i++) {
final IAtom atom = subgraph.getAtom(i);
int removed = 0;
for (IBond bond : molecule.getConnectedBondsList(atom)) {
if (!bonds.contains(bond))
removed += bond.getOrder().numeric();
}
hCount[i] = atom.getImplicitHydrogenCount();
atom.setImplicitHydrogenCount(hCount[i] == null ? removed : hCount[i] + removed);
}
String smi = cansmi(subgraph);
// reset for fused rings!
for (int i = 0; i < subgraph.getAtomCount(); i++) {
subgraph.getAtom(i).setImplicitHydrogenCount(hCount[i]);
}
return smi;
} | class class_name[name] begin[{]
method[getSubgraphSmiles, return_type[type[String]], modifier[private static], parameter[subgraph, molecule]] begin[{]
local_variable[type[Set], bonds]
ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=bonds, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=bonds, postfix_operators=[], prefix_operators=[], qualifier=subgraph, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bond)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IBond, sub_type=None))), label=None)
local_variable[type[Integer], hCount]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAtom, postfix_operators=[], prefix_operators=[], qualifier=subgraph, selectors=[], type_arguments=None), name=atom)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=removed)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=bond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=bonds, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=removed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getOrder, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[MethodInvocation(arguments=[], member=numeric, 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=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConnectedBondsList, postfix_operators=[], prefix_operators=[], qualifier=molecule, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bond)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IBond, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getImplicitHydrogenCount, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=hCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=BinaryOperation(operandl=MemberReference(member=hCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=removed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), if_true=MemberReference(member=removed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], member=setImplicitHydrogenCount, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getAtomCount, postfix_operators=[], prefix_operators=[], qualifier=subgraph, 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)
local_variable[type[String], smi]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAtom, postfix_operators=[], prefix_operators=[], qualifier=subgraph, selectors=[MethodInvocation(arguments=[MemberReference(member=hCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=setImplicitHydrogenCount, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getAtomCount, postfix_operators=[], prefix_operators=[], qualifier=subgraph, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.smi]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] identifier[getSubgraphSmiles] operator[SEP] identifier[IAtomContainer] identifier[subgraph] , identifier[IAtomContainer] identifier[molecule] operator[SEP] Keyword[throws] identifier[CDKException] {
identifier[Set] operator[<] identifier[IBond] operator[>] identifier[bonds] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[IBond] identifier[bond] operator[:] identifier[subgraph] operator[SEP] identifier[bonds] operator[SEP] operator[SEP] operator[SEP] identifier[bonds] operator[SEP] identifier[add] operator[SEP] identifier[bond] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] operator[SEP] identifier[hCount] operator[=] Keyword[new] identifier[Integer] operator[SEP] identifier[subgraph] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[subgraph] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[final] identifier[IAtom] identifier[atom] operator[=] identifier[subgraph] operator[SEP] identifier[getAtom] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[removed] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[IBond] identifier[bond] operator[:] identifier[molecule] operator[SEP] identifier[getConnectedBondsList] operator[SEP] identifier[atom] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[bonds] operator[SEP] identifier[contains] operator[SEP] identifier[bond] operator[SEP] operator[SEP] identifier[removed] operator[+=] identifier[bond] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[SEP] identifier[numeric] operator[SEP] operator[SEP] operator[SEP]
}
identifier[hCount] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[atom] operator[SEP] identifier[getImplicitHydrogenCount] operator[SEP] operator[SEP] operator[SEP] identifier[atom] operator[SEP] identifier[setImplicitHydrogenCount] operator[SEP] identifier[hCount] operator[SEP] identifier[i] operator[SEP] operator[==] Other[null] operator[?] identifier[removed] operator[:] identifier[hCount] operator[SEP] identifier[i] operator[SEP] operator[+] identifier[removed] operator[SEP] operator[SEP]
}
identifier[String] identifier[smi] operator[=] identifier[cansmi] operator[SEP] identifier[subgraph] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[subgraph] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[subgraph] operator[SEP] identifier[getAtom] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[setImplicitHydrogenCount] operator[SEP] identifier[hCount] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[smi] operator[SEP]
}
|
private void renderCellToHeaderFooter(StringBuilder result, String bandName, BandElement bandElement, Object value, int gridRow, int row,
int column, int cols, int rowSpan, int colSpan, boolean isImage) {
if (newRow) {
result.append("\r\n ");
} else {
result.append(" ");
}
boolean specialCell = false;
if (bandElement instanceof VariableBandElement) {
VariableBandElement vbe = (VariableBandElement)bandElement;
Variable var = VariableFactory.getVariable(vbe.getVariable());
if (var instanceof PageNoVariable) {
specialCell = true;
result.append("&P");
}
} else if (bandElement instanceof ExpressionBandElement) {
// special case pageNo inside an expression
// bandName is not important here (it is used for groupRow computation)
PrefixSuffix pf = interpretPageNo(bandElement);
if (pf != null) {
result.append(pf.getPrefix()).append(" &P ").append(pf.getSuffix());
specialCell = true;
}
}
if (!specialCell) {
result.append(value);
}
} | class class_name[name] begin[{]
method[renderCellToHeaderFooter, return_type[void], modifier[private], parameter[result, bandName, bandElement, value, gridRow, row, column, cols, rowSpan, colSpan, isImage]] begin[{]
if[member[.newRow]] begin[{]
call[result.append, parameter[literal["\r\n "]]]
else begin[{]
call[result.append, parameter[literal[" "]]]
end[}]
local_variable[type[boolean], specialCell]
if[binary_operation[member[.bandElement], instanceof, type[VariableBandElement]]] begin[{]
local_variable[type[VariableBandElement], vbe]
local_variable[type[Variable], var]
if[binary_operation[member[.var], instanceof, type[PageNoVariable]]] begin[{]
assign[member[.specialCell], literal[true]]
call[result.append, parameter[literal["&P"]]]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[member[.bandElement], instanceof, type[ExpressionBandElement]]] begin[{]
local_variable[type[PrefixSuffix], pf]
if[binary_operation[member[.pf], !=, literal[null]]] begin[{]
call[result.append, parameter[call[pf.getPrefix, parameter[]]]]
assign[member[.specialCell], literal[true]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
if[member[.specialCell]] begin[{]
call[result.append, parameter[member[.value]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[renderCellToHeaderFooter] operator[SEP] identifier[StringBuilder] identifier[result] , identifier[String] identifier[bandName] , identifier[BandElement] identifier[bandElement] , identifier[Object] identifier[value] , Keyword[int] identifier[gridRow] , Keyword[int] identifier[row] , Keyword[int] identifier[column] , Keyword[int] identifier[cols] , Keyword[int] identifier[rowSpan] , Keyword[int] identifier[colSpan] , Keyword[boolean] identifier[isImage] operator[SEP] {
Keyword[if] operator[SEP] identifier[newRow] operator[SEP] {
identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[boolean] identifier[specialCell] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[bandElement] Keyword[instanceof] identifier[VariableBandElement] operator[SEP] {
identifier[VariableBandElement] identifier[vbe] operator[=] operator[SEP] identifier[VariableBandElement] operator[SEP] identifier[bandElement] operator[SEP] identifier[Variable] identifier[var] operator[=] identifier[VariableFactory] operator[SEP] identifier[getVariable] operator[SEP] identifier[vbe] operator[SEP] identifier[getVariable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[var] Keyword[instanceof] identifier[PageNoVariable] operator[SEP] {
identifier[specialCell] operator[=] literal[boolean] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[bandElement] Keyword[instanceof] identifier[ExpressionBandElement] operator[SEP] {
identifier[PrefixSuffix] identifier[pf] operator[=] identifier[interpretPageNo] operator[SEP] identifier[bandElement] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pf] operator[!=] Other[null] operator[SEP] {
identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[pf] operator[SEP] identifier[getPrefix] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[pf] operator[SEP] identifier[getSuffix] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[specialCell] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[specialCell] operator[SEP] {
identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
|
public alluxio.grpc.TierList getAddedBlocksOnTiersOrDefault(
java.lang.String key,
alluxio.grpc.TierList defaultValue) {
if (key == null) { throw new java.lang.NullPointerException(); }
java.util.Map<java.lang.String, alluxio.grpc.TierList> map =
internalGetAddedBlocksOnTiers().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
} | class class_name[name] begin[{]
method[getAddedBlocksOnTiersOrDefault, return_type[type[alluxio]], modifier[public], parameter[key, defaultValue]] begin[{]
if[binary_operation[member[.key], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=lang, sub_type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)))), label=None)
else begin[{]
None
end[}]
local_variable[type[java], map]
return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), if_false=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None))]
end[}]
END[}] | Keyword[public] identifier[alluxio] operator[SEP] identifier[grpc] operator[SEP] identifier[TierList] identifier[getAddedBlocksOnTiersOrDefault] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[String] identifier[key] , identifier[alluxio] operator[SEP] identifier[grpc] operator[SEP] identifier[TierList] identifier[defaultValue] operator[SEP] {
Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP]
}
identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[String] , identifier[alluxio] operator[SEP] identifier[grpc] operator[SEP] identifier[TierList] operator[>] identifier[map] operator[=] identifier[internalGetAddedBlocksOnTiers] operator[SEP] operator[SEP] operator[SEP] identifier[getMap] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[map] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[?] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[:] identifier[defaultValue] operator[SEP]
}
|
public static boolean match(String route,
String withRoute,
boolean exact) {
return RouterUtils.match(route,
withRoute,
exact);
} | class class_name[name] begin[{]
method[match, return_type[type[boolean]], modifier[public static], parameter[route, withRoute, exact]] begin[{]
return[call[RouterUtils.match, parameter[member[.route], member[.withRoute], member[.exact]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[match] operator[SEP] identifier[String] identifier[route] , identifier[String] identifier[withRoute] , Keyword[boolean] identifier[exact] operator[SEP] {
Keyword[return] identifier[RouterUtils] operator[SEP] identifier[match] operator[SEP] identifier[route] , identifier[withRoute] , identifier[exact] operator[SEP] operator[SEP]
}
|
public static String normalizePath(String path) {
if (Platforms.FILE_PATH_SEPARATOR_CHAR == Platforms.WINDOWS_FILE_PATH_SEPARATOR_CHAR
&& StringUtils.indexOf(path, Platforms.LINUX_FILE_PATH_SEPARATOR_CHAR) != -1) {
return StringUtils.replaceChars(path, Platforms.LINUX_FILE_PATH_SEPARATOR_CHAR,
Platforms.WINDOWS_FILE_PATH_SEPARATOR_CHAR);
}
return path;
} | class class_name[name] begin[{]
method[normalizePath, return_type[type[String]], modifier[public static], parameter[path]] begin[{]
if[binary_operation[binary_operation[member[Platforms.FILE_PATH_SEPARATOR_CHAR], ==, member[Platforms.WINDOWS_FILE_PATH_SEPARATOR_CHAR]], &&, binary_operation[call[StringUtils.indexOf, parameter[member[.path], member[Platforms.LINUX_FILE_PATH_SEPARATOR_CHAR]]], !=, literal[1]]]] begin[{]
return[call[StringUtils.replaceChars, parameter[member[.path], member[Platforms.LINUX_FILE_PATH_SEPARATOR_CHAR], member[Platforms.WINDOWS_FILE_PATH_SEPARATOR_CHAR]]]]
else begin[{]
None
end[}]
return[member[.path]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[normalizePath] operator[SEP] identifier[String] identifier[path] operator[SEP] {
Keyword[if] operator[SEP] identifier[Platforms] operator[SEP] identifier[FILE_PATH_SEPARATOR_CHAR] operator[==] identifier[Platforms] operator[SEP] identifier[WINDOWS_FILE_PATH_SEPARATOR_CHAR] operator[&&] identifier[StringUtils] operator[SEP] identifier[indexOf] operator[SEP] identifier[path] , identifier[Platforms] operator[SEP] identifier[LINUX_FILE_PATH_SEPARATOR_CHAR] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] {
Keyword[return] identifier[StringUtils] operator[SEP] identifier[replaceChars] operator[SEP] identifier[path] , identifier[Platforms] operator[SEP] identifier[LINUX_FILE_PATH_SEPARATOR_CHAR] , identifier[Platforms] operator[SEP] identifier[WINDOWS_FILE_PATH_SEPARATOR_CHAR] operator[SEP] operator[SEP]
}
Keyword[return] identifier[path] operator[SEP]
}
|
public static String generateEntityQualifiedName(SQLiteDaoDefinition dao, SQLiteEntity entity) {
String entityName;
if (entity == null) {
M2MEntity m2mEntity = M2MEntity.extractEntityManagedByDAO(dao.getElement());
entityName = m2mEntity.getQualifiedName();
} else {
entityName = entity.getName().toString();
}
return entityName;
} | class class_name[name] begin[{]
method[generateEntityQualifiedName, return_type[type[String]], modifier[public static], parameter[dao, entity]] begin[{]
local_variable[type[String], entityName]
if[binary_operation[member[.entity], ==, literal[null]]] begin[{]
local_variable[type[M2MEntity], m2mEntity]
assign[member[.entityName], call[m2mEntity.getQualifiedName, parameter[]]]
else begin[{]
assign[member[.entityName], call[entity.getName, parameter[]]]
end[}]
return[member[.entityName]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[generateEntityQualifiedName] operator[SEP] identifier[SQLiteDaoDefinition] identifier[dao] , identifier[SQLiteEntity] identifier[entity] operator[SEP] {
identifier[String] identifier[entityName] operator[SEP] Keyword[if] operator[SEP] identifier[entity] operator[==] Other[null] operator[SEP] {
identifier[M2MEntity] identifier[m2mEntity] operator[=] identifier[M2MEntity] operator[SEP] identifier[extractEntityManagedByDAO] operator[SEP] identifier[dao] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[entityName] operator[=] identifier[m2mEntity] operator[SEP] identifier[getQualifiedName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[entityName] operator[=] identifier[entity] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[entityName] operator[SEP]
}
|
public static boolean del(Path path) throws IORuntimeException {
if (Files.notExists(path)) {
return true;
}
try {
if (Files.isDirectory(path)) {
Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Files.delete(file);
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException {
if (e == null) {
Files.delete(dir);
return FileVisitResult.CONTINUE;
} else {
throw e;
}
}
});
} else {
Files.delete(path);
}
} catch (IOException e) {
throw new IORuntimeException(e);
}
return true;
} | class class_name[name] begin[{]
method[del, return_type[type[boolean]], modifier[public static], parameter[path]] begin[{]
if[call[Files.notExists, parameter[member[.path]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isDirectory, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=delete, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=delete, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=CONTINUE, postfix_operators=[], prefix_operators=[], qualifier=FileVisitResult, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=visitFile, parameters=[FormalParameter(annotations=[], modifiers=set(), name=file, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=attrs, type=ReferenceType(arguments=None, dimensions=[], name=BasicFileAttributes, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=FileVisitResult, sub_type=None), throws=['IOException'], type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=delete, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=CONTINUE, postfix_operators=[], prefix_operators=[], qualifier=FileVisitResult, selectors=[]), label=None)]))], documentation=None, modifiers={'public'}, name=postVisitDirectory, parameters=[FormalParameter(annotations=[], modifiers=set(), name=dir, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=e, type=ReferenceType(arguments=None, dimensions=[], name=IOException, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=FileVisitResult, sub_type=None), throws=['IOException'], 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=Path, sub_type=None))], dimensions=None, name=SimpleFileVisitor, sub_type=None))], member=walkFileTree, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IORuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[del] operator[SEP] identifier[Path] identifier[path] operator[SEP] Keyword[throws] identifier[IORuntimeException] {
Keyword[if] operator[SEP] identifier[Files] operator[SEP] identifier[notExists] operator[SEP] identifier[path] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[try] {
Keyword[if] operator[SEP] identifier[Files] operator[SEP] identifier[isDirectory] operator[SEP] identifier[path] operator[SEP] operator[SEP] {
identifier[Files] operator[SEP] identifier[walkFileTree] operator[SEP] identifier[path] , Keyword[new] identifier[SimpleFileVisitor] operator[<] identifier[Path] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[FileVisitResult] identifier[visitFile] operator[SEP] identifier[Path] identifier[file] , identifier[BasicFileAttributes] identifier[attrs] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Files] operator[SEP] identifier[delete] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[return] identifier[FileVisitResult] operator[SEP] identifier[CONTINUE] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] identifier[FileVisitResult] identifier[postVisitDirectory] operator[SEP] identifier[Path] identifier[dir] , identifier[IOException] identifier[e] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[e] operator[==] Other[null] operator[SEP] {
identifier[Files] operator[SEP] identifier[delete] operator[SEP] identifier[dir] operator[SEP] operator[SEP] Keyword[return] identifier[FileVisitResult] operator[SEP] identifier[CONTINUE] operator[SEP]
}
Keyword[else] {
Keyword[throw] identifier[e] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Files] operator[SEP] identifier[delete] operator[SEP] identifier[path] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IORuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public Stemmer getInstance(String name) throws StemmerNotFoundException {
// logger.debug("stemmerFactory.getInstance: " + name);
String stemmerClass = initParams.getProperty(name.toUpperCase());
Stemmer stemmer = null;
try {
stemmer = (Stemmer) (Class.forName(stemmerClass)).newInstance();
// stemmer.set(initParams);
} catch (Exception e) {
throw new StemmerNotFoundException(name + " stemmer not found.");
}
return stemmer;
} | class class_name[name] begin[{]
method[getInstance, return_type[type[Stemmer]], modifier[public], parameter[name]] begin[{]
local_variable[type[String], stemmerClass]
local_variable[type[Stemmer], stemmer]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stemmer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=stemmerClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, 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=Stemmer, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" stemmer not found."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StemmerNotFoundException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
return[member[.stemmer]]
end[}]
END[}] | Keyword[public] identifier[Stemmer] identifier[getInstance] operator[SEP] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[StemmerNotFoundException] {
identifier[String] identifier[stemmerClass] operator[=] identifier[initParams] operator[SEP] identifier[getProperty] operator[SEP] identifier[name] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Stemmer] identifier[stemmer] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[stemmer] operator[=] operator[SEP] identifier[Stemmer] operator[SEP] operator[SEP] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[stemmerClass] operator[SEP] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[StemmerNotFoundException] operator[SEP] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[stemmer] operator[SEP]
}
|
public boolean mediaIsVideo () {
String contentType = this.getContentType();
return contentType != null && this.media != null && contentType.startsWith("video");
} | class class_name[name] begin[{]
method[mediaIsVideo, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
local_variable[type[String], contentType]
return[binary_operation[binary_operation[binary_operation[member[.contentType], !=, literal[null]], &&, binary_operation[THIS[member[None.media]], !=, literal[null]]], &&, call[contentType.startsWith, parameter[literal["video"]]]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[mediaIsVideo] operator[SEP] operator[SEP] {
identifier[String] identifier[contentType] operator[=] Keyword[this] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[contentType] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[media] operator[!=] Other[null] operator[&&] identifier[contentType] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
public boolean removeLayout(final Layout layout) {
boolean removed = mLayouts.remove(layout);
if (layout != null && removed) {
layout.onLayoutApplied(null, new Vector3Axis());
}
return removed;
} | class class_name[name] begin[{]
method[removeLayout, return_type[type[boolean]], modifier[public], parameter[layout]] begin[{]
local_variable[type[boolean], removed]
if[binary_operation[binary_operation[member[.layout], !=, literal[null]], &&, member[.removed]]] begin[{]
call[layout.onLayoutApplied, parameter[literal[null], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Vector3Axis, sub_type=None))]]
else begin[{]
None
end[}]
return[member[.removed]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[removeLayout] operator[SEP] Keyword[final] identifier[Layout] identifier[layout] operator[SEP] {
Keyword[boolean] identifier[removed] operator[=] identifier[mLayouts] operator[SEP] identifier[remove] operator[SEP] identifier[layout] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[layout] operator[!=] Other[null] operator[&&] identifier[removed] operator[SEP] {
identifier[layout] operator[SEP] identifier[onLayoutApplied] operator[SEP] Other[null] , Keyword[new] identifier[Vector3Axis] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[removed] operator[SEP]
}
|
protected final String getForCopy(final Class<?> pClass) {
if (this.seEntities.contains(pClass) || pClass == Deliv.class
|| pClass == PayMd.class) {
return null;
}
if (pClass == ServiceSpecifics.class || pClass == GoodsSpecifics.class) {
return PrcItemSpecificsRetrieve.class.getSimpleName();
} else if (IPersistableBase.class.isAssignableFrom(pClass)) {
return PrcEntityPbCopy.class.getSimpleName();
}
return PrcEntityCopy.class.getSimpleName();
} | class class_name[name] begin[{]
method[getForCopy, return_type[type[String]], modifier[final protected], parameter[pClass]] begin[{]
if[binary_operation[binary_operation[THIS[member[None.seEntities]call[None.contains, parameter[member[.pClass]]]], ||, binary_operation[member[.pClass], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Deliv, sub_type=None))]], ||, binary_operation[member[.pClass], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PayMd, sub_type=None))]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.pClass], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServiceSpecifics, sub_type=None))], ||, binary_operation[member[.pClass], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GoodsSpecifics, sub_type=None))]]] begin[{]
return[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=PrcItemSpecificsRetrieve, sub_type=None))]
else begin[{]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=pClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=IPersistableBase, sub_type=None))] begin[{]
return[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=PrcEntityPbCopy, sub_type=None))]
else begin[{]
None
end[}]
end[}]
return[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=PrcEntityCopy, sub_type=None))]
end[}]
END[}] | Keyword[protected] Keyword[final] identifier[String] identifier[getForCopy] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[pClass] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[seEntities] operator[SEP] identifier[contains] operator[SEP] identifier[pClass] operator[SEP] operator[||] identifier[pClass] operator[==] identifier[Deliv] operator[SEP] Keyword[class] operator[||] identifier[pClass] operator[==] identifier[PayMd] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[pClass] operator[==] identifier[ServiceSpecifics] operator[SEP] Keyword[class] operator[||] identifier[pClass] operator[==] identifier[GoodsSpecifics] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] identifier[PrcItemSpecificsRetrieve] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[IPersistableBase] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[pClass] operator[SEP] operator[SEP] {
Keyword[return] identifier[PrcEntityPbCopy] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[PrcEntityCopy] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String percentToStr(Double amount, Language lang, Pennies pennies) {
if (amount == null) {
throw new IllegalArgumentException("amount is null");
}
if (lang == null) {
throw new IllegalArgumentException("language is null");
}
if (pennies == null) {
throw new IllegalArgumentException("pennies is null");
}
Long intPart = amount.longValue();
Long fractPart = 0L;
String result;
if (amount.floatValue() == amount.intValue()) {
result = new MoneyToStr(Currency.PER10, lang, pennies).convert(amount.longValue(), 0L);
} else if (Double.valueOf(amount * NUM10).floatValue() == Double.valueOf(amount * NUM10).intValue()) {
fractPart = Math.round((amount - intPart) * NUM10);
result = new MoneyToStr(Currency.PER10, lang, pennies).convert(intPart, fractPart);
} else if (Double.valueOf(amount * NUM100).floatValue() == Double.valueOf(amount * NUM100).intValue()) {
fractPart = Math.round((amount - intPart) * NUM100);
result = new MoneyToStr(Currency.PER100, lang, pennies).convert(intPart, fractPart);
} else if (Double.valueOf(amount * NUM1000).floatValue() == Double.valueOf(amount * NUM1000).intValue()) {
fractPart = Math.round((amount - intPart) * NUM1000);
result = new MoneyToStr(Currency.PER1000, lang, pennies).convert(intPart, fractPart);
} else {
fractPart = Math.round((amount - intPart) * NUM10000);
result = new MoneyToStr(Currency.PER10000, lang, pennies).convert(intPart, fractPart);
}
return result;
} | class class_name[name] begin[{]
method[percentToStr, return_type[type[String]], modifier[public static], parameter[amount, lang, pennies]] begin[{]
if[binary_operation[member[.amount], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="amount is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.lang], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="language is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.pennies], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pennies is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[Long], intPart]
local_variable[type[Long], fractPart]
local_variable[type[String], result]
if[binary_operation[call[amount.floatValue, parameter[]], ==, call[amount.intValue, parameter[]]]] begin[{]
assign[member[.result], ClassCreator(arguments=[MemberReference(member=PER10, postfix_operators=[], prefix_operators=[], qualifier=Currency, selectors=[]), MemberReference(member=lang, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pennies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=longValue, postfix_operators=[], prefix_operators=[], qualifier=amount, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L)], member=convert, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=MoneyToStr, sub_type=None))]
else begin[{]
if[binary_operation[call[Double.valueOf, parameter[binary_operation[member[.amount], *, member[.NUM10]]]], ==, call[Double.valueOf, parameter[binary_operation[member[.amount], *, member[.NUM10]]]]]] begin[{]
assign[member[.fractPart], call[Math.round, parameter[binary_operation[binary_operation[member[.amount], -, member[.intPart]], *, member[.NUM10]]]]]
assign[member[.result], ClassCreator(arguments=[MemberReference(member=PER10, postfix_operators=[], prefix_operators=[], qualifier=Currency, selectors=[]), MemberReference(member=lang, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pennies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=intPart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fractPart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convert, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=MoneyToStr, sub_type=None))]
else begin[{]
if[binary_operation[call[Double.valueOf, parameter[binary_operation[member[.amount], *, member[.NUM100]]]], ==, call[Double.valueOf, parameter[binary_operation[member[.amount], *, member[.NUM100]]]]]] begin[{]
assign[member[.fractPart], call[Math.round, parameter[binary_operation[binary_operation[member[.amount], -, member[.intPart]], *, member[.NUM100]]]]]
assign[member[.result], ClassCreator(arguments=[MemberReference(member=PER100, postfix_operators=[], prefix_operators=[], qualifier=Currency, selectors=[]), MemberReference(member=lang, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pennies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=intPart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fractPart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convert, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=MoneyToStr, sub_type=None))]
else begin[{]
if[binary_operation[call[Double.valueOf, parameter[binary_operation[member[.amount], *, member[.NUM1000]]]], ==, call[Double.valueOf, parameter[binary_operation[member[.amount], *, member[.NUM1000]]]]]] begin[{]
assign[member[.fractPart], call[Math.round, parameter[binary_operation[binary_operation[member[.amount], -, member[.intPart]], *, member[.NUM1000]]]]]
assign[member[.result], ClassCreator(arguments=[MemberReference(member=PER1000, postfix_operators=[], prefix_operators=[], qualifier=Currency, selectors=[]), MemberReference(member=lang, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pennies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=intPart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fractPart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convert, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=MoneyToStr, sub_type=None))]
else begin[{]
assign[member[.fractPart], call[Math.round, parameter[binary_operation[binary_operation[member[.amount], -, member[.intPart]], *, member[.NUM10000]]]]]
assign[member[.result], ClassCreator(arguments=[MemberReference(member=PER10000, postfix_operators=[], prefix_operators=[], qualifier=Currency, selectors=[]), MemberReference(member=lang, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pennies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=intPart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fractPart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convert, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=MoneyToStr, sub_type=None))]
end[}]
end[}]
end[}]
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[percentToStr] operator[SEP] identifier[Double] identifier[amount] , identifier[Language] identifier[lang] , identifier[Pennies] identifier[pennies] operator[SEP] {
Keyword[if] operator[SEP] identifier[amount] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[lang] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[pennies] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[Long] identifier[intPart] operator[=] identifier[amount] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] identifier[Long] identifier[fractPart] operator[=] Other[0L] operator[SEP] identifier[String] identifier[result] operator[SEP] Keyword[if] operator[SEP] identifier[amount] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[==] identifier[amount] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] {
identifier[result] operator[=] Keyword[new] identifier[MoneyToStr] operator[SEP] identifier[Currency] operator[SEP] identifier[PER10] , identifier[lang] , identifier[pennies] operator[SEP] operator[SEP] identifier[convert] operator[SEP] identifier[amount] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] , Other[0L] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[Double] operator[SEP] identifier[valueOf] operator[SEP] identifier[amount] operator[*] identifier[NUM10] operator[SEP] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[==] identifier[Double] operator[SEP] identifier[valueOf] operator[SEP] identifier[amount] operator[*] identifier[NUM10] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] {
identifier[fractPart] operator[=] identifier[Math] operator[SEP] identifier[round] operator[SEP] operator[SEP] identifier[amount] operator[-] identifier[intPart] operator[SEP] operator[*] identifier[NUM10] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[MoneyToStr] operator[SEP] identifier[Currency] operator[SEP] identifier[PER10] , identifier[lang] , identifier[pennies] operator[SEP] operator[SEP] identifier[convert] operator[SEP] identifier[intPart] , identifier[fractPart] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[Double] operator[SEP] identifier[valueOf] operator[SEP] identifier[amount] operator[*] identifier[NUM100] operator[SEP] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[==] identifier[Double] operator[SEP] identifier[valueOf] operator[SEP] identifier[amount] operator[*] identifier[NUM100] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] {
identifier[fractPart] operator[=] identifier[Math] operator[SEP] identifier[round] operator[SEP] operator[SEP] identifier[amount] operator[-] identifier[intPart] operator[SEP] operator[*] identifier[NUM100] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[MoneyToStr] operator[SEP] identifier[Currency] operator[SEP] identifier[PER100] , identifier[lang] , identifier[pennies] operator[SEP] operator[SEP] identifier[convert] operator[SEP] identifier[intPart] , identifier[fractPart] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[Double] operator[SEP] identifier[valueOf] operator[SEP] identifier[amount] operator[*] identifier[NUM1000] operator[SEP] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[==] identifier[Double] operator[SEP] identifier[valueOf] operator[SEP] identifier[amount] operator[*] identifier[NUM1000] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] {
identifier[fractPart] operator[=] identifier[Math] operator[SEP] identifier[round] operator[SEP] operator[SEP] identifier[amount] operator[-] identifier[intPart] operator[SEP] operator[*] identifier[NUM1000] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[MoneyToStr] operator[SEP] identifier[Currency] operator[SEP] identifier[PER1000] , identifier[lang] , identifier[pennies] operator[SEP] operator[SEP] identifier[convert] operator[SEP] identifier[intPart] , identifier[fractPart] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[fractPart] operator[=] identifier[Math] operator[SEP] identifier[round] operator[SEP] operator[SEP] identifier[amount] operator[-] identifier[intPart] operator[SEP] operator[*] identifier[NUM10000] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[MoneyToStr] operator[SEP] identifier[Currency] operator[SEP] identifier[PER10000] , identifier[lang] , identifier[pennies] operator[SEP] operator[SEP] identifier[convert] operator[SEP] identifier[intPart] , identifier[fractPart] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public SortedMap<String, HealthCheck.Result> runHealthChecks(ExecutorService executor, HealthCheckFilter filter) {
final Map<String, Future<HealthCheck.Result>> futures = new HashMap<>();
for (final Map.Entry<String, HealthCheck> entry : healthChecks.entrySet()) {
final String name = entry.getKey();
final HealthCheck healthCheck = entry.getValue();
if (filter.matches(name, healthCheck)) {
futures.put(name, executor.submit(() -> healthCheck.execute()));
}
}
final SortedMap<String, HealthCheck.Result> results = new TreeMap<>();
for (Map.Entry<String, Future<Result>> entry : futures.entrySet()) {
try {
results.put(entry.getKey(), entry.getValue().get());
} catch (Exception e) {
LOGGER.warn("Error executing health check {}", entry.getKey(), e);
results.put(entry.getKey(), HealthCheck.Result.unhealthy(e));
}
}
return Collections.unmodifiableSortedMap(results);
} | class class_name[name] begin[{]
method[runHealthChecks, return_type[type[SortedMap]], modifier[public], parameter[executor, filter]] begin[{]
local_variable[type[Map], futures]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=name)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=healthCheck)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=HealthCheck, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=healthCheck, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[], member=execute, postfix_operators=[], prefix_operators=[], qualifier=healthCheck, selectors=[], type_arguments=None), parameters=[])], member=submit, postfix_operators=[], prefix_operators=[], qualifier=executor, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=futures, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=healthChecks, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=HealthCheck, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
local_variable[type[SortedMap], results]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error executing health check {}"), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unhealthy, postfix_operators=[], prefix_operators=[], qualifier=HealthCheck.Result, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=futures, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Result, sub_type=None))], dimensions=[], name=Future, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
return[call[Collections.unmodifiableSortedMap, parameter[member[.results]]]]
end[}]
END[}] | Keyword[public] identifier[SortedMap] operator[<] identifier[String] , identifier[HealthCheck] operator[SEP] identifier[Result] operator[>] identifier[runHealthChecks] operator[SEP] identifier[ExecutorService] identifier[executor] , identifier[HealthCheckFilter] identifier[filter] operator[SEP] {
Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Future] operator[<] identifier[HealthCheck] operator[SEP] identifier[Result] operator[>] operator[>] identifier[futures] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[HealthCheck] operator[>] identifier[entry] operator[:] identifier[healthChecks] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[name] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[HealthCheck] identifier[healthCheck] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[filter] operator[SEP] identifier[matches] operator[SEP] identifier[name] , identifier[healthCheck] operator[SEP] operator[SEP] {
identifier[futures] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[executor] operator[SEP] identifier[submit] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[healthCheck] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[final] identifier[SortedMap] operator[<] identifier[String] , identifier[HealthCheck] operator[SEP] identifier[Result] operator[>] identifier[results] operator[=] Keyword[new] identifier[TreeMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Future] operator[<] identifier[Result] operator[>] operator[>] identifier[entry] operator[:] identifier[futures] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[results] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[HealthCheck] operator[SEP] identifier[Result] operator[SEP] identifier[unhealthy] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableSortedMap] operator[SEP] identifier[results] operator[SEP] operator[SEP]
}
|
public static <K, M extends Message> MapWithProtoValuesSubject<?, K, M, Map<K, M>> assertThat(
@NullableDecl Map<K, M> map) {
return assertAbout(protos()).that(map);
} | class class_name[name] begin[{]
method[assertThat, return_type[type[MapWithProtoValuesSubject]], modifier[public static], parameter[map]] begin[{]
return[call[.assertAbout, parameter[call[.protos, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[M] Keyword[extends] identifier[Message] operator[>] identifier[MapWithProtoValuesSubject] operator[<] operator[?] , identifier[K] , identifier[M] , identifier[Map] operator[<] identifier[K] , identifier[M] operator[>] operator[>] identifier[assertThat] operator[SEP] annotation[@] identifier[NullableDecl] identifier[Map] operator[<] identifier[K] , identifier[M] operator[>] identifier[map] operator[SEP] {
Keyword[return] identifier[assertAbout] operator[SEP] identifier[protos] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[that] operator[SEP] identifier[map] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("Duplicates")
protected void downgradeUrlElements(Document doc) throws JaxenException {
List nodes = XmlUtils.newXPath(
"/io:root/io:property/io:url",
doc).selectNodes(doc);
for (Object item : nodes) {
Element node = (Element) item;
String enUrlValue = null;
String fallbackUrlValue = null;
List childNodes = XmlUtils.newXPath(
"*", doc).selectNodes(node);
for (Object childItem : childNodes) {
Element langNode = (Element) childItem;
if ("en".equalsIgnoreCase(langNode.getLocalName()))
enUrlValue = StringUtils.trimToNull(langNode.getTextContent());
else if (fallbackUrlValue == null)
fallbackUrlValue = StringUtils.trimToNull(langNode.getTextContent());
node.removeChild(langNode);
}
node.setTextContent((enUrlValue != null) ? enUrlValue : fallbackUrlValue);
}
} | class class_name[name] begin[{]
method[downgradeUrlElements, return_type[void], modifier[protected], parameter[doc]] begin[{]
local_variable[type[List], nodes]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=enUrlValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=fallbackUrlValue)], 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="*"), MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newXPath, postfix_operators=[], prefix_operators=[], qualifier=XmlUtils, selectors=[MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=selectNodes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=childNodes)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=childItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), name=langNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalName, postfix_operators=[], prefix_operators=[], qualifier=langNode, selectors=[], type_arguments=None)], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="en"), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fallbackUrlValue, 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=StatementExpression(expression=Assignment(expressionl=MemberReference(member=fallbackUrlValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTextContent, postfix_operators=[], prefix_operators=[], qualifier=langNode, selectors=[], type_arguments=None)], member=trimToNull, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None)), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=enUrlValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTextContent, postfix_operators=[], prefix_operators=[], qualifier=langNode, selectors=[], type_arguments=None)], member=trimToNull, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None)), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=langNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeChild, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=childNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=childItem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=enUrlValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=fallbackUrlValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=enUrlValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], member=setTextContent, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=nodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[protected] Keyword[void] identifier[downgradeUrlElements] operator[SEP] identifier[Document] identifier[doc] operator[SEP] Keyword[throws] identifier[JaxenException] {
identifier[List] identifier[nodes] operator[=] identifier[XmlUtils] operator[SEP] identifier[newXPath] operator[SEP] literal[String] , identifier[doc] operator[SEP] operator[SEP] identifier[selectNodes] operator[SEP] identifier[doc] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[item] operator[:] identifier[nodes] operator[SEP] {
identifier[Element] identifier[node] operator[=] operator[SEP] identifier[Element] operator[SEP] identifier[item] operator[SEP] identifier[String] identifier[enUrlValue] operator[=] Other[null] operator[SEP] identifier[String] identifier[fallbackUrlValue] operator[=] Other[null] operator[SEP] identifier[List] identifier[childNodes] operator[=] identifier[XmlUtils] operator[SEP] identifier[newXPath] operator[SEP] literal[String] , identifier[doc] operator[SEP] operator[SEP] identifier[selectNodes] operator[SEP] identifier[node] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[childItem] operator[:] identifier[childNodes] operator[SEP] {
identifier[Element] identifier[langNode] operator[=] operator[SEP] identifier[Element] operator[SEP] identifier[childItem] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[langNode] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[enUrlValue] operator[=] identifier[StringUtils] operator[SEP] identifier[trimToNull] operator[SEP] identifier[langNode] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[fallbackUrlValue] operator[==] Other[null] operator[SEP] identifier[fallbackUrlValue] operator[=] identifier[StringUtils] operator[SEP] identifier[trimToNull] operator[SEP] identifier[langNode] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[removeChild] operator[SEP] identifier[langNode] operator[SEP] operator[SEP]
}
identifier[node] operator[SEP] identifier[setTextContent] operator[SEP] operator[SEP] identifier[enUrlValue] operator[!=] Other[null] operator[SEP] operator[?] identifier[enUrlValue] operator[:] identifier[fallbackUrlValue] operator[SEP] operator[SEP]
}
}
|
public ClusteringServiceConfigurationBuilder timeouts(Builder<? extends Timeouts> timeoutsBuilder) {
return new ClusteringServiceConfigurationBuilder(this.connectionSource, timeoutsBuilder.build(), this.autoCreate);
} | class class_name[name] begin[{]
method[timeouts, return_type[type[ClusteringServiceConfigurationBuilder]], modifier[public], parameter[timeoutsBuilder]] begin[{]
return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=connectionSource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MethodInvocation(arguments=[], member=build, postfix_operators=[], prefix_operators=[], qualifier=timeoutsBuilder, selectors=[], type_arguments=None), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=autoCreate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClusteringServiceConfigurationBuilder, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[ClusteringServiceConfigurationBuilder] identifier[timeouts] operator[SEP] identifier[Builder] operator[<] operator[?] Keyword[extends] identifier[Timeouts] operator[>] identifier[timeoutsBuilder] operator[SEP] {
Keyword[return] Keyword[new] identifier[ClusteringServiceConfigurationBuilder] operator[SEP] Keyword[this] operator[SEP] identifier[connectionSource] , identifier[timeoutsBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[autoCreate] operator[SEP] operator[SEP]
}
|
@Override
public boolean isBodyAllowed() {
if (super.isBodyAllowed()) {
// sending a body with the response is not valid for a HEAD request
if (getServiceContext().getRequestMethod().equals(MethodValues.HEAD)) {
return false;
}
// if that worked, then check the status code flag
return this.myStatusCode.isBodyAllowed();
}
// no body allowed on this message
return false;
} | class class_name[name] begin[{]
method[isBodyAllowed, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
if[SuperMethodInvocation(arguments=[], member=isBodyAllowed, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] begin[{]
if[call[.getServiceContext, parameter[]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
return[THIS[member[None.myStatusCode]call[None.isBodyAllowed, parameter[]]]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isBodyAllowed] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] Keyword[super] operator[SEP] identifier[isBodyAllowed] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[getServiceContext] operator[SEP] operator[SEP] operator[SEP] identifier[getRequestMethod] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[MethodValues] operator[SEP] identifier[HEAD] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP] identifier[myStatusCode] operator[SEP] identifier[isBodyAllowed] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public OvhFramework serviceName_frameworks_frameworkId_GET(String serviceName, String frameworkId) throws IOException {
String qPath = "/caas/containers/{serviceName}/frameworks/{frameworkId}";
StringBuilder sb = path(qPath, serviceName, frameworkId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhFramework.class);
} | class class_name[name] begin[{]
method[serviceName_frameworks_frameworkId_GET, return_type[type[OvhFramework]], modifier[public], parameter[serviceName, frameworkId]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
local_variable[type[String], resp]
return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhFramework, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[OvhFramework] identifier[serviceName_frameworks_frameworkId_GET] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[frameworkId] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] , identifier[frameworkId] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhFramework] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
static public long computeMinimumHeapRqt(int tableCount, int sitesPerHost, int kfactor)
{
long baseRqt = 384;
long tableRqt = 10 * tableCount;
// K-safety Heap consumption drop to 8 MB (per node)
// Snapshot cost 32 MB (per node)
// Theoretically, 40 MB (per node) should be enough
long rejoinRqt = (kfactor > 0) ? 128 * sitesPerHost : 0;
return baseRqt + tableRqt + rejoinRqt;
} | class class_name[name] begin[{]
method[computeMinimumHeapRqt, return_type[type[long]], modifier[public static], parameter[tableCount, sitesPerHost, kfactor]] begin[{]
local_variable[type[long], baseRqt]
local_variable[type[long], tableRqt]
local_variable[type[long], rejoinRqt]
return[binary_operation[binary_operation[member[.baseRqt], +, member[.tableRqt]], +, member[.rejoinRqt]]]
end[}]
END[}] | Keyword[static] Keyword[public] Keyword[long] identifier[computeMinimumHeapRqt] operator[SEP] Keyword[int] identifier[tableCount] , Keyword[int] identifier[sitesPerHost] , Keyword[int] identifier[kfactor] operator[SEP] {
Keyword[long] identifier[baseRqt] operator[=] Other[384] operator[SEP] Keyword[long] identifier[tableRqt] operator[=] Other[10] operator[*] identifier[tableCount] operator[SEP] Keyword[long] identifier[rejoinRqt] operator[=] operator[SEP] identifier[kfactor] operator[>] Other[0] operator[SEP] operator[?] Other[128] operator[*] identifier[sitesPerHost] operator[:] Other[0] operator[SEP] Keyword[return] identifier[baseRqt] operator[+] identifier[tableRqt] operator[+] identifier[rejoinRqt] operator[SEP]
}
|
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.GSFLW__MH:
return getMH();
case AfplibPackage.GSFLW__MFR:
return getMFR();
}
return super.eGet(featureID, resolve, coreType);
} | class class_name[name] begin[{]
method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=GSFLW__MH, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getMH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=GSFLW__MFR, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getMFR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[GSFLW__MH] operator[:] Keyword[return] identifier[getMH] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[GSFLW__MFR] operator[:] Keyword[return] identifier[getMFR] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP]
}
|
public SchemaBuilder mapper(String field, MapperBuilder<?, ?> mapper) {
mapperBuilders.put(field, mapper);
return this;
} | class class_name[name] begin[{]
method[mapper, return_type[type[SchemaBuilder]], modifier[public], parameter[field, mapper]] begin[{]
call[mapperBuilders.put, parameter[member[.field], member[.mapper]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[SchemaBuilder] identifier[mapper] operator[SEP] identifier[String] identifier[field] , identifier[MapperBuilder] operator[<] operator[?] , operator[?] operator[>] identifier[mapper] operator[SEP] {
identifier[mapperBuilders] operator[SEP] identifier[put] operator[SEP] identifier[field] , identifier[mapper] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public static Map<String, Object> curryDelegateAndGetContent(Closure<?> c, Object o) {
JsonDelegate delegate = new JsonDelegate();
Closure<?> curried = c.curry(o);
curried.setDelegate(delegate);
curried.setResolveStrategy(Closure.DELEGATE_FIRST);
curried.call();
return delegate.getContent();
} | class class_name[name] begin[{]
method[curryDelegateAndGetContent, return_type[type[Map]], modifier[public static], parameter[c, o]] begin[{]
local_variable[type[JsonDelegate], delegate]
local_variable[type[Closure], curried]
call[curried.setDelegate, parameter[member[.delegate]]]
call[curried.setResolveStrategy, parameter[member[Closure.DELEGATE_FIRST]]]
call[curried.call, parameter[]]
return[call[delegate.getContent, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[curryDelegateAndGetContent] operator[SEP] identifier[Closure] operator[<] operator[?] operator[>] identifier[c] , identifier[Object] identifier[o] operator[SEP] {
identifier[JsonDelegate] identifier[delegate] operator[=] Keyword[new] identifier[JsonDelegate] operator[SEP] operator[SEP] operator[SEP] identifier[Closure] operator[<] operator[?] operator[>] identifier[curried] operator[=] identifier[c] operator[SEP] identifier[curry] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[curried] operator[SEP] identifier[setDelegate] operator[SEP] identifier[delegate] operator[SEP] operator[SEP] identifier[curried] operator[SEP] identifier[setResolveStrategy] operator[SEP] identifier[Closure] operator[SEP] identifier[DELEGATE_FIRST] operator[SEP] operator[SEP] identifier[curried] operator[SEP] identifier[call] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[delegate] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP]
}
|
@NonNull
public static ResolvedType resolveSubtype(@NonNull ResolvedType superType, @NonNull Class<?> subType)
{
return typeResolver.resolveSubtype(superType, subType);
} | class class_name[name] begin[{]
method[resolveSubtype, return_type[type[ResolvedType]], modifier[public static], parameter[superType, subType]] begin[{]
return[call[typeResolver.resolveSubtype, parameter[member[.superType], member[.subType]]]]
end[}]
END[}] | annotation[@] identifier[NonNull] Keyword[public] Keyword[static] identifier[ResolvedType] identifier[resolveSubtype] operator[SEP] annotation[@] identifier[NonNull] identifier[ResolvedType] identifier[superType] , annotation[@] identifier[NonNull] identifier[Class] operator[<] operator[?] operator[>] identifier[subType] operator[SEP] {
Keyword[return] identifier[typeResolver] operator[SEP] identifier[resolveSubtype] operator[SEP] identifier[superType] , identifier[subType] operator[SEP] operator[SEP]
}
|
@Deprecated
protected EntryMessage enter(final String fqcn, final MessageSupplier msgSupplier) {
EntryMessage message = null;
if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, message = flowMessageFactory.newEntryMessage(
msgSupplier.get()), null);
}
return message;
} | class class_name[name] begin[{]
method[enter, return_type[type[EntryMessage]], modifier[protected], parameter[fqcn, msgSupplier]] begin[{]
local_variable[type[EntryMessage], message]
if[call[.isEnabled, parameter[member[Level.TRACE], member[.ENTRY_MARKER], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), literal[null]]]] begin[{]
call[.logMessageSafely, parameter[member[.fqcn], member[Level.TRACE], member[.ENTRY_MARKER], assign[member[.message], call[flowMessageFactory.newEntryMessage, parameter[call[msgSupplier.get, parameter[]]]]], literal[null]]]
else begin[{]
None
end[}]
return[member[.message]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[protected] identifier[EntryMessage] identifier[enter] operator[SEP] Keyword[final] identifier[String] identifier[fqcn] , Keyword[final] identifier[MessageSupplier] identifier[msgSupplier] operator[SEP] {
identifier[EntryMessage] identifier[message] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[isEnabled] operator[SEP] identifier[Level] operator[SEP] identifier[TRACE] , identifier[ENTRY_MARKER] , operator[SEP] identifier[Object] operator[SEP] Other[null] , Other[null] operator[SEP] operator[SEP] {
identifier[logMessageSafely] operator[SEP] identifier[fqcn] , identifier[Level] operator[SEP] identifier[TRACE] , identifier[ENTRY_MARKER] , identifier[message] operator[=] identifier[flowMessageFactory] operator[SEP] identifier[newEntryMessage] operator[SEP] identifier[msgSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP]
}
Keyword[return] identifier[message] operator[SEP]
}
|
public OvhOrder cdn_webstorage_serviceName_traffic_GET(String serviceName, OvhOrderTrafficEnum bandwidth) throws IOException {
String qPath = "/order/cdn/webstorage/{serviceName}/traffic";
StringBuilder sb = path(qPath, serviceName);
query(sb, "bandwidth", bandwidth);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhOrder.class);
} | class class_name[name] begin[{]
method[cdn_webstorage_serviceName_traffic_GET, return_type[type[OvhOrder]], modifier[public], parameter[serviceName, bandwidth]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
call[.query, parameter[member[.sb], literal["bandwidth"], member[.bandwidth]]]
local_variable[type[String], resp]
return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhOrder, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[OvhOrder] identifier[cdn_webstorage_serviceName_traffic_GET] operator[SEP] identifier[String] identifier[serviceName] , identifier[OvhOrderTrafficEnum] identifier[bandwidth] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[bandwidth] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhOrder] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
public static String getShortRequestDump(String fromMethod, HttpServletRequest request) {
return (getShortRequestDump(fromMethod, false, request));
} | class class_name[name] begin[{]
method[getShortRequestDump, return_type[type[String]], modifier[public static], parameter[fromMethod, request]] begin[{]
return[call[.getShortRequestDump, parameter[member[.fromMethod], literal[false], member[.request]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getShortRequestDump] operator[SEP] identifier[String] identifier[fromMethod] , identifier[HttpServletRequest] identifier[request] operator[SEP] {
Keyword[return] operator[SEP] identifier[getShortRequestDump] operator[SEP] identifier[fromMethod] , literal[boolean] , identifier[request] operator[SEP] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.