code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
private static boolean removeInCurrentStep(Resource resource) {
for (String childType : resource.getChildTypes()) {
for (Resource.ResourceEntry entry : resource.getChildren(childType)) {
if (!entry.isRuntime() && resource.hasChild(entry.getPathElement())) {
return false;
}
}
}
return true;
} | class class_name[name] begin[{]
method[removeInCurrentStep, return_type[type[boolean]], modifier[private static], parameter[resource]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isRuntime, postfix_operators=[], prefix_operators=['!'], qualifier=entry, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPathElement, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=hasChild, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=childType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Resource, sub_type=ReferenceType(arguments=None, dimensions=None, name=ResourceEntry, sub_type=None)))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getChildTypes, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=childType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[literal[true]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[boolean] identifier[removeInCurrentStep] operator[SEP] identifier[Resource] identifier[resource] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[childType] operator[:] identifier[resource] operator[SEP] identifier[getChildTypes] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[Resource] operator[SEP] identifier[ResourceEntry] identifier[entry] operator[:] identifier[resource] operator[SEP] identifier[getChildren] operator[SEP] identifier[childType] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[entry] operator[SEP] identifier[isRuntime] operator[SEP] operator[SEP] operator[&&] identifier[resource] operator[SEP] identifier[hasChild] operator[SEP] identifier[entry] operator[SEP] identifier[getPathElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static String unCamel(String str, char seperator, boolean lowercase) {
char[] ca = str.toCharArray();
if (3 > ca.length) { return lowercase ? str.toLowerCase() : str; }
// about five seperator
StringBuilder build = new StringBuilder(ca.length + 5);
build.append(lowercase ? toLowerCase(ca[0]) : ca[0]);
boolean lower1 = isLowerCase(ca[0]);
int i = 1;
while (i < ca.length - 1) {
char cur = ca[i];
char next = ca[i + 1];
boolean upper2 = isUpperCase(cur);
boolean lower3 = isLowerCase(next);
if (lower1 && upper2 && lower3) {
build.append(seperator);
build.append(lowercase ? toLowerCase(cur) : cur);
build.append(next);
i += 2;
} else {
if (lowercase && upper2) {
build.append(toLowerCase(cur));
} else {
build.append(cur);
}
lower1 = !upper2;
i++;
}
}
if (i == ca.length - 1) {
build.append(lowercase ? toLowerCase(ca[i]) : ca[i]);
}
return build.toString();
} | class class_name[name] begin[{]
method[unCamel, return_type[type[String]], modifier[public static], parameter[str, seperator, lowercase]] begin[{]
local_variable[type[char], ca]
if[binary_operation[literal[3], >, member[ca.length]]] begin[{]
return[TernaryExpression(condition=MemberReference(member=lowercase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None))]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], build]
call[build.append, parameter[TernaryExpression(condition=MemberReference(member=lowercase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=ca, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), if_true=MethodInvocation(arguments=[MemberReference(member=ca, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))]]
local_variable[type[boolean], lower1]
local_variable[type[int], i]
while[binary_operation[member[.i], <, binary_operation[member[ca.length], -, literal[1]]]] begin[{]
local_variable[type[char], cur]
local_variable[type[char], next]
local_variable[type[boolean], upper2]
local_variable[type[boolean], lower3]
if[binary_operation[binary_operation[member[.lower1], &&, member[.upper2]], &&, member[.lower3]]] begin[{]
call[build.append, parameter[member[.seperator]]]
call[build.append, parameter[TernaryExpression(condition=MemberReference(member=lowercase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=cur, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[MemberReference(member=cur, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))]]
call[build.append, parameter[member[.next]]]
assign[member[.i], literal[2]]
else begin[{]
if[binary_operation[member[.lowercase], &&, member[.upper2]]] begin[{]
call[build.append, parameter[call[.toLowerCase, parameter[member[.cur]]]]]
else begin[{]
call[build.append, parameter[member[.cur]]]
end[}]
assign[member[.lower1], member[.upper2]]
member[.i]
end[}]
end[}]
if[binary_operation[member[.i], ==, binary_operation[member[ca.length], -, literal[1]]]] begin[{]
call[build.append, parameter[TernaryExpression(condition=MemberReference(member=lowercase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=ca, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), if_true=MethodInvocation(arguments=[MemberReference(member=ca, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))]]
else begin[{]
None
end[}]
return[call[build.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[unCamel] operator[SEP] identifier[String] identifier[str] , Keyword[char] identifier[seperator] , Keyword[boolean] identifier[lowercase] operator[SEP] {
Keyword[char] operator[SEP] operator[SEP] identifier[ca] operator[=] identifier[str] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[3] operator[>] identifier[ca] operator[SEP] identifier[length] operator[SEP] {
Keyword[return] identifier[lowercase] operator[?] identifier[str] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[:] identifier[str] operator[SEP]
}
identifier[StringBuilder] identifier[build] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[ca] operator[SEP] identifier[length] operator[+] Other[5] operator[SEP] operator[SEP] identifier[build] operator[SEP] identifier[append] operator[SEP] identifier[lowercase] operator[?] identifier[toLowerCase] operator[SEP] identifier[ca] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[:] identifier[ca] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[lower1] operator[=] identifier[isLowerCase] operator[SEP] identifier[ca] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[<] identifier[ca] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] {
Keyword[char] identifier[cur] operator[=] identifier[ca] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[char] identifier[next] operator[=] identifier[ca] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[boolean] identifier[upper2] operator[=] identifier[isUpperCase] operator[SEP] identifier[cur] operator[SEP] operator[SEP] Keyword[boolean] identifier[lower3] operator[=] identifier[isLowerCase] operator[SEP] identifier[next] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lower1] operator[&&] identifier[upper2] operator[&&] identifier[lower3] operator[SEP] {
identifier[build] operator[SEP] identifier[append] operator[SEP] identifier[seperator] operator[SEP] operator[SEP] identifier[build] operator[SEP] identifier[append] operator[SEP] identifier[lowercase] operator[?] identifier[toLowerCase] operator[SEP] identifier[cur] operator[SEP] operator[:] identifier[cur] operator[SEP] operator[SEP] identifier[build] operator[SEP] identifier[append] operator[SEP] identifier[next] operator[SEP] operator[SEP] identifier[i] operator[+=] Other[2] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[lowercase] operator[&&] identifier[upper2] operator[SEP] {
identifier[build] operator[SEP] identifier[append] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[cur] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[build] operator[SEP] identifier[append] operator[SEP] identifier[cur] operator[SEP] operator[SEP]
}
identifier[lower1] operator[=] operator[!] identifier[upper2] operator[SEP] identifier[i] operator[++] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[i] operator[==] identifier[ca] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] {
identifier[build] operator[SEP] identifier[append] operator[SEP] identifier[lowercase] operator[?] identifier[toLowerCase] operator[SEP] identifier[ca] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[:] identifier[ca] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[build] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static int cusparseScsc2hyb(
cusparseHandle handle,
int m,
int n,
cusparseMatDescr descrA,
Pointer cscSortedValA,
Pointer cscSortedRowIndA,
Pointer cscSortedColPtrA,
cusparseHybMat hybA,
int userEllWidth,
int partitionType)
{
return checkResult(cusparseScsc2hybNative(handle, m, n, descrA, cscSortedValA, cscSortedRowIndA, cscSortedColPtrA, hybA, userEllWidth, partitionType));
} | class class_name[name] begin[{]
method[cusparseScsc2hyb, return_type[type[int]], modifier[public static], parameter[handle, m, n, descrA, cscSortedValA, cscSortedRowIndA, cscSortedColPtrA, hybA, userEllWidth, partitionType]] begin[{]
return[call[.checkResult, parameter[call[.cusparseScsc2hybNative, parameter[member[.handle], member[.m], member[.n], member[.descrA], member[.cscSortedValA], member[.cscSortedRowIndA], member[.cscSortedColPtrA], member[.hybA], member[.userEllWidth], member[.partitionType]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[cusparseScsc2hyb] operator[SEP] identifier[cusparseHandle] identifier[handle] , Keyword[int] identifier[m] , Keyword[int] identifier[n] , identifier[cusparseMatDescr] identifier[descrA] , identifier[Pointer] identifier[cscSortedValA] , identifier[Pointer] identifier[cscSortedRowIndA] , identifier[Pointer] identifier[cscSortedColPtrA] , identifier[cusparseHybMat] identifier[hybA] , Keyword[int] identifier[userEllWidth] , Keyword[int] identifier[partitionType] operator[SEP] {
Keyword[return] identifier[checkResult] operator[SEP] identifier[cusparseScsc2hybNative] operator[SEP] identifier[handle] , identifier[m] , identifier[n] , identifier[descrA] , identifier[cscSortedValA] , identifier[cscSortedRowIndA] , identifier[cscSortedColPtrA] , identifier[hybA] , identifier[userEllWidth] , identifier[partitionType] operator[SEP] operator[SEP] operator[SEP]
}
|
private Map<String, Integer> runSampling(
final ProctorContext proctorContext,
final Set<String> targetTestNames,
final TestType testType,
final int determinationsToRun
) {
final Set<String> targetTestGroups = getTargetTestGroups(targetTestNames);
final Map<String, Integer> testGroupToOccurrences = Maps.newTreeMap();
for (final String testGroup : targetTestGroups) {
testGroupToOccurrences.put(testGroup, 0);
}
for (int i = 0; i < determinationsToRun; ++i) {
final Identifiers identifiers = TestType.RANDOM.equals(testType)
? new Identifiers(Collections.<TestType, String>emptyMap(), /* randomEnabled */ true)
: Identifiers.of(testType, Long.toString(random.nextLong()));
final AbstractGroups groups = supplier.getRandomGroups(proctorContext, identifiers);
for (final Entry<String, TestBucket> e : groups.getProctorResult().getBuckets().entrySet()) {
final String testName = e.getKey();
if (targetTestNames.contains(testName)) {
final int group = e.getValue().getValue();
final String testGroup = testName + group;
testGroupToOccurrences.put(testGroup, testGroupToOccurrences.get(testGroup) + 1);
}
}
}
return testGroupToOccurrences;
} | class class_name[name] begin[{]
method[runSampling, return_type[type[Map]], modifier[private], parameter[proctorContext, targetTestNames, testType, determinationsToRun]] begin[{]
local_variable[type[Set], targetTestGroups]
local_variable[type[Map], testGroupToOccurrences]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=testGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=put, postfix_operators=[], prefix_operators=[], qualifier=testGroupToOccurrences, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=targetTestGroups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=testGroup)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=testType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=TestType.RANDOM, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[MemberReference(member=testType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=nextLong, postfix_operators=[], prefix_operators=[], qualifier=random, selectors=[], type_arguments=None)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None)], member=of, postfix_operators=[], prefix_operators=[], qualifier=Identifiers, selectors=[], type_arguments=None), if_true=ClassCreator(arguments=[MethodInvocation(arguments=[], member=Collections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TestType, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Identifiers, sub_type=None))), name=identifiers)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Identifiers, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=proctorContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=identifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRandomGroups, postfix_operators=[], prefix_operators=[], qualifier=supplier, selectors=[], type_arguments=None), name=groups)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=AbstractGroups, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=testName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=testName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=targetTestNames, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[MethodInvocation(arguments=[], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=group)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=testName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=testGroup)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=testGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=testGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=testGroupToOccurrences, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=put, postfix_operators=[], prefix_operators=[], qualifier=testGroupToOccurrences, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getProctorResult, postfix_operators=[], prefix_operators=[], qualifier=groups, selectors=[MethodInvocation(arguments=[], member=getBuckets, 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=e)], modifiers={'final'}, 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=TestBucket, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=determinationsToRun, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
return[member[.testGroupToOccurrences]]
end[}]
END[}] | Keyword[private] identifier[Map] operator[<] identifier[String] , identifier[Integer] operator[>] identifier[runSampling] operator[SEP] Keyword[final] identifier[ProctorContext] identifier[proctorContext] , Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[targetTestNames] , Keyword[final] identifier[TestType] identifier[testType] , Keyword[final] Keyword[int] identifier[determinationsToRun] operator[SEP] {
Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[targetTestGroups] operator[=] identifier[getTargetTestGroups] operator[SEP] identifier[targetTestNames] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Integer] operator[>] identifier[testGroupToOccurrences] operator[=] identifier[Maps] operator[SEP] identifier[newTreeMap] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[testGroup] operator[:] identifier[targetTestGroups] operator[SEP] {
identifier[testGroupToOccurrences] operator[SEP] identifier[put] operator[SEP] identifier[testGroup] , Other[0] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[determinationsToRun] operator[SEP] operator[++] identifier[i] operator[SEP] {
Keyword[final] identifier[Identifiers] identifier[identifiers] operator[=] identifier[TestType] operator[SEP] identifier[RANDOM] operator[SEP] identifier[equals] operator[SEP] identifier[testType] operator[SEP] operator[?] Keyword[new] identifier[Identifiers] operator[SEP] identifier[Collections] operator[SEP] operator[<] identifier[TestType] , identifier[String] operator[>] identifier[emptyMap] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[:] identifier[Identifiers] operator[SEP] identifier[of] operator[SEP] identifier[testType] , identifier[Long] operator[SEP] identifier[toString] operator[SEP] identifier[random] operator[SEP] identifier[nextLong] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[AbstractGroups] identifier[groups] operator[=] identifier[supplier] operator[SEP] identifier[getRandomGroups] operator[SEP] identifier[proctorContext] , identifier[identifiers] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Entry] operator[<] identifier[String] , identifier[TestBucket] operator[>] identifier[e] operator[:] identifier[groups] operator[SEP] identifier[getProctorResult] operator[SEP] operator[SEP] operator[SEP] identifier[getBuckets] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[testName] operator[=] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[targetTestNames] operator[SEP] identifier[contains] operator[SEP] identifier[testName] operator[SEP] operator[SEP] {
Keyword[final] Keyword[int] identifier[group] operator[=] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[testGroup] operator[=] identifier[testName] operator[+] identifier[group] operator[SEP] identifier[testGroupToOccurrences] operator[SEP] identifier[put] operator[SEP] identifier[testGroup] , identifier[testGroupToOccurrences] operator[SEP] identifier[get] operator[SEP] identifier[testGroup] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[testGroupToOccurrences] operator[SEP]
}
|
private static Stream<Node> streamAttributes(Node node) {
final NamedNodeMap attributes = node.getAttributes();
if (attributes == null) return Stream.empty();
return IntStream.range(0, attributes.getLength()).mapToObj(attributes::item);
} | class class_name[name] begin[{]
method[streamAttributes, return_type[type[Stream]], modifier[private static], parameter[node]] begin[{]
local_variable[type[NamedNodeMap], attributes]
if[binary_operation[member[.attributes], ==, literal[null]]] begin[{]
return[call[Stream.empty, parameter[]]]
else begin[{]
None
end[}]
return[call[IntStream.range, parameter[literal[0], call[attributes.getLength, parameter[]]]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Stream] operator[<] identifier[Node] operator[>] identifier[streamAttributes] operator[SEP] identifier[Node] identifier[node] operator[SEP] {
Keyword[final] identifier[NamedNodeMap] identifier[attributes] operator[=] identifier[node] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attributes] operator[==] Other[null] operator[SEP] Keyword[return] identifier[Stream] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[IntStream] operator[SEP] identifier[range] operator[SEP] Other[0] , identifier[attributes] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mapToObj] operator[SEP] identifier[attributes] operator[::] identifier[item] operator[SEP] operator[SEP]
}
|
public String updateClusterSetting(ClusterSetting clusterSetting){
StringBuilder updateDsl = new StringBuilder();
if(clusterSetting.isPersistent()) {
updateDsl.append("{").append("\"persistent\":{");
}
else {
updateDsl.append("{").append("\"transient\":{");
}
updateDsl.append("\"").append(clusterSetting.getKey()).append("\":");
if(clusterSetting.getValue() == null){
updateDsl.append("null");
}
else if(clusterSetting.getValue() instanceof String) {
updateDsl.append("\"").append(clusterSetting.getValue()).append("\"");
}
else{
updateDsl.append(clusterSetting.getValue());
}
updateDsl.append("}}");
return this.client.executeHttp("_cluster/settings",updateDsl.toString(),ClientInterface.HTTP_PUT);
} | class class_name[name] begin[{]
method[updateClusterSetting, return_type[type[String]], modifier[public], parameter[clusterSetting]] begin[{]
local_variable[type[StringBuilder], updateDsl]
if[call[clusterSetting.isPersistent, parameter[]]] begin[{]
call[updateDsl.append, parameter[literal["{"]]]
else begin[{]
call[updateDsl.append, parameter[literal["{"]]]
end[}]
call[updateDsl.append, parameter[literal["\""]]]
if[binary_operation[call[clusterSetting.getValue, parameter[]], ==, literal[null]]] begin[{]
call[updateDsl.append, parameter[literal["null"]]]
else begin[{]
if[binary_operation[call[clusterSetting.getValue, parameter[]], instanceof, type[String]]] begin[{]
call[updateDsl.append, parameter[literal["\""]]]
else begin[{]
call[updateDsl.append, parameter[call[clusterSetting.getValue, parameter[]]]]
end[}]
end[}]
call[updateDsl.append, parameter[literal["}}"]]]
return[THIS[member[None.client]call[None.executeHttp, parameter[literal["_cluster/settings"], call[updateDsl.toString, parameter[]], member[ClientInterface.HTTP_PUT]]]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[updateClusterSetting] operator[SEP] identifier[ClusterSetting] identifier[clusterSetting] operator[SEP] {
identifier[StringBuilder] identifier[updateDsl] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[clusterSetting] operator[SEP] identifier[isPersistent] operator[SEP] operator[SEP] operator[SEP] {
identifier[updateDsl] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[updateDsl] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[updateDsl] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[clusterSetting] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[clusterSetting] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[updateDsl] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[clusterSetting] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] Keyword[instanceof] identifier[String] operator[SEP] {
identifier[updateDsl] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[clusterSetting] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[updateDsl] operator[SEP] identifier[append] operator[SEP] identifier[clusterSetting] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[updateDsl] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[executeHttp] operator[SEP] literal[String] , identifier[updateDsl] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[ClientInterface] operator[SEP] identifier[HTTP_PUT] operator[SEP] operator[SEP]
}
|
public static boolean isPrintable(int ch)
{
int cat = getType(ch);
// if props == 0, it will just fall through and return false
return (cat != UCharacterCategory.UNASSIGNED &&
cat != UCharacterCategory.CONTROL &&
cat != UCharacterCategory.FORMAT &&
cat != UCharacterCategory.PRIVATE_USE &&
cat != UCharacterCategory.SURROGATE &&
cat != UCharacterCategory.GENERAL_OTHER_TYPES);
} | class class_name[name] begin[{]
method[isPrintable, return_type[type[boolean]], modifier[public static], parameter[ch]] begin[{]
local_variable[type[int], cat]
return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.cat], !=, member[UCharacterCategory.UNASSIGNED]], &&, binary_operation[member[.cat], !=, member[UCharacterCategory.CONTROL]]], &&, binary_operation[member[.cat], !=, member[UCharacterCategory.FORMAT]]], &&, binary_operation[member[.cat], !=, member[UCharacterCategory.PRIVATE_USE]]], &&, binary_operation[member[.cat], !=, member[UCharacterCategory.SURROGATE]]], &&, binary_operation[member[.cat], !=, member[UCharacterCategory.GENERAL_OTHER_TYPES]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isPrintable] operator[SEP] Keyword[int] identifier[ch] operator[SEP] {
Keyword[int] identifier[cat] operator[=] identifier[getType] operator[SEP] identifier[ch] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[cat] operator[!=] identifier[UCharacterCategory] operator[SEP] identifier[UNASSIGNED] operator[&&] identifier[cat] operator[!=] identifier[UCharacterCategory] operator[SEP] identifier[CONTROL] operator[&&] identifier[cat] operator[!=] identifier[UCharacterCategory] operator[SEP] identifier[FORMAT] operator[&&] identifier[cat] operator[!=] identifier[UCharacterCategory] operator[SEP] identifier[PRIVATE_USE] operator[&&] identifier[cat] operator[!=] identifier[UCharacterCategory] operator[SEP] identifier[SURROGATE] operator[&&] identifier[cat] operator[!=] identifier[UCharacterCategory] operator[SEP] identifier[GENERAL_OTHER_TYPES] operator[SEP] operator[SEP]
}
|
public void setImportTablesInProgress(java.util.Collection<String> importTablesInProgress) {
if (importTablesInProgress == null) {
this.importTablesInProgress = null;
return;
}
this.importTablesInProgress = new com.amazonaws.internal.SdkInternalList<String>(importTablesInProgress);
} | class class_name[name] begin[{]
method[setImportTablesInProgress, return_type[void], modifier[public], parameter[importTablesInProgress]] begin[{]
if[binary_operation[member[.importTablesInProgress], ==, literal[null]]] begin[{]
assign[THIS[member[None.importTablesInProgress]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.importTablesInProgress]], ClassCreator(arguments=[MemberReference(member=importTablesInProgress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setImportTablesInProgress] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[importTablesInProgress] operator[SEP] {
Keyword[if] operator[SEP] identifier[importTablesInProgress] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[importTablesInProgress] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[importTablesInProgress] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[importTablesInProgress] operator[SEP] operator[SEP]
}
|
public void toBMES(String file,int duplicateNum) throws IOException {
BufferedWriter bout = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(file,true), "UTF-8"));
for(String line:set){
if(line.length()>1){
StringBuilder sb = new StringBuilder();
for(int i=0;i<duplicateNum;i++){
sb.append(line);
if(i<duplicateNum-1)
sb.append(" ");
}
line = sb.toString();
}
String s = Tags.genSegSequence(line,"\\s+",4);
bout.write(s);
}
bout.close();
} | class class_name[name] begin[{]
method[toBMES, return_type[void], modifier[public], parameter[file, duplicateNum]] begin[{]
local_variable[type[BufferedWriter], bout]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[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=StringBuilder, sub_type=None)), name=sb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=duplicateNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=duplicateNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\s+"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], member=genSegSequence, postfix_operators=[], prefix_operators=[], qualifier=Tags, selectors=[], type_arguments=None), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=bout, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
call[bout.close, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[toBMES] operator[SEP] identifier[String] identifier[file] , Keyword[int] identifier[duplicateNum] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[BufferedWriter] identifier[bout] operator[=] Keyword[new] identifier[BufferedWriter] operator[SEP] Keyword[new] identifier[OutputStreamWriter] operator[SEP] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[file] , literal[boolean] operator[SEP] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[line] operator[:] identifier[set] operator[SEP] {
Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] {
identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[duplicateNum] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[line] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[<] identifier[duplicateNum] operator[-] Other[1] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[line] operator[=] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[s] operator[=] identifier[Tags] operator[SEP] identifier[genSegSequence] operator[SEP] identifier[line] , literal[String] , Other[4] operator[SEP] operator[SEP] identifier[bout] operator[SEP] identifier[write] operator[SEP] identifier[s] operator[SEP] operator[SEP]
}
identifier[bout] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
|
@Beta
public static <T> List<T> toList(Iterable<T> iterable) {
if (iterable instanceof List<?>) {
List<T> result = (List<T>) iterable;
return result;
}
return Lists.newArrayList(iterable);
} | class class_name[name] begin[{]
method[toList, return_type[type[List]], modifier[public static], parameter[iterable]] begin[{]
if[binary_operation[member[.iterable], instanceof, type[List]]] begin[{]
local_variable[type[List], result]
return[member[.result]]
else begin[{]
None
end[}]
return[call[Lists.newArrayList, parameter[member[.iterable]]]]
end[}]
END[}] | annotation[@] identifier[Beta] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[toList] operator[SEP] identifier[Iterable] operator[<] identifier[T] operator[>] identifier[iterable] operator[SEP] {
Keyword[if] operator[SEP] identifier[iterable] Keyword[instanceof] identifier[List] operator[<] operator[?] operator[>] operator[SEP] {
identifier[List] operator[<] identifier[T] operator[>] identifier[result] operator[=] operator[SEP] identifier[List] operator[<] identifier[T] operator[>] operator[SEP] identifier[iterable] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
Keyword[return] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] identifier[iterable] operator[SEP] operator[SEP]
}
|
public void removeConfiguration(Configuration c)
{
if (configs.remove(c)) {
((ConfigImpl) c).unregister();
logger.info("removed configuration of " + c.getBaseLink().getName());
}
} | class class_name[name] begin[{]
method[removeConfiguration, return_type[void], modifier[public], parameter[c]] begin[{]
if[call[configs.remove, parameter[member[.c]]]] begin[{]
Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ConfigImpl, sub_type=None))
call[logger.info, parameter[binary_operation[literal["removed configuration of "], +, call[c.getBaseLink, parameter[]]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[removeConfiguration] operator[SEP] identifier[Configuration] identifier[c] operator[SEP] {
Keyword[if] operator[SEP] identifier[configs] operator[SEP] identifier[remove] operator[SEP] identifier[c] operator[SEP] operator[SEP] {
operator[SEP] operator[SEP] identifier[ConfigImpl] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[unregister] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[c] operator[SEP] identifier[getBaseLink] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public ApiResponse<CharacterShipResponse> getCharactersCharacterIdShipWithHttpInfo(Integer characterId,
String datasource, String ifNoneMatch, String token) throws ApiException {
com.squareup.okhttp.Call call = getCharactersCharacterIdShipValidateBeforeCall(characterId, datasource,
ifNoneMatch, token, null);
Type localVarReturnType = new TypeToken<CharacterShipResponse>() {
}.getType();
return apiClient.execute(call, localVarReturnType);
} | class class_name[name] begin[{]
method[getCharactersCharacterIdShipWithHttpInfo, return_type[type[ApiResponse]], modifier[public], parameter[characterId, datasource, ifNoneMatch, token]] begin[{]
local_variable[type[com], call]
local_variable[type[Type], localVarReturnType]
return[call[apiClient.execute, parameter[member[.call], member[.localVarReturnType]]]]
end[}]
END[}] | Keyword[public] identifier[ApiResponse] operator[<] identifier[CharacterShipResponse] operator[>] identifier[getCharactersCharacterIdShipWithHttpInfo] operator[SEP] identifier[Integer] identifier[characterId] , identifier[String] identifier[datasource] , identifier[String] identifier[ifNoneMatch] , identifier[String] identifier[token] operator[SEP] Keyword[throws] identifier[ApiException] {
identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[call] operator[=] identifier[getCharactersCharacterIdShipValidateBeforeCall] operator[SEP] identifier[characterId] , identifier[datasource] , identifier[ifNoneMatch] , identifier[token] , Other[null] operator[SEP] operator[SEP] identifier[Type] identifier[localVarReturnType] operator[=] Keyword[new] identifier[TypeToken] operator[<] identifier[CharacterShipResponse] operator[>] operator[SEP] operator[SEP] {
} operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[apiClient] operator[SEP] identifier[execute] operator[SEP] identifier[call] , identifier[localVarReturnType] operator[SEP] operator[SEP]
}
|
private synchronized void failReduce(TaskInProgress tip) {
if (nonRunningReduces == null) {
LOG.warn("Failed cache for reducers missing!! "
+ "Job details are missing.");
return;
}
nonRunningReduces.add(0, tip);
} | class class_name[name] begin[{]
method[failReduce, return_type[void], modifier[synchronized private], parameter[tip]] begin[{]
if[binary_operation[member[.nonRunningReduces], ==, literal[null]]] begin[{]
call[LOG.warn, parameter[binary_operation[literal["Failed cache for reducers missing!! "], +, literal["Job details are missing."]]]]
return[None]
else begin[{]
None
end[}]
call[nonRunningReduces.add, parameter[literal[0], member[.tip]]]
end[}]
END[}] | Keyword[private] Keyword[synchronized] Keyword[void] identifier[failReduce] operator[SEP] identifier[TaskInProgress] identifier[tip] operator[SEP] {
Keyword[if] operator[SEP] identifier[nonRunningReduces] operator[==] Other[null] operator[SEP] {
identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[nonRunningReduces] operator[SEP] identifier[add] operator[SEP] Other[0] , identifier[tip] operator[SEP] operator[SEP]
}
|
public ReportDefinition withAdditionalSchemaElements(SchemaElement... additionalSchemaElements) {
java.util.ArrayList<String> additionalSchemaElementsCopy = new java.util.ArrayList<String>(additionalSchemaElements.length);
for (SchemaElement value : additionalSchemaElements) {
additionalSchemaElementsCopy.add(value.toString());
}
if (getAdditionalSchemaElements() == null) {
setAdditionalSchemaElements(additionalSchemaElementsCopy);
} else {
getAdditionalSchemaElements().addAll(additionalSchemaElementsCopy);
}
return this;
} | class class_name[name] begin[{]
method[withAdditionalSchemaElements, return_type[type[ReportDefinition]], modifier[public], parameter[additionalSchemaElements]] begin[{]
local_variable[type[java], additionalSchemaElementsCopy]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=additionalSchemaElementsCopy, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=additionalSchemaElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SchemaElement, sub_type=None))), label=None)
if[binary_operation[call[.getAdditionalSchemaElements, parameter[]], ==, literal[null]]] begin[{]
call[.setAdditionalSchemaElements, parameter[member[.additionalSchemaElementsCopy]]]
else begin[{]
call[.getAdditionalSchemaElements, parameter[]]
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ReportDefinition] identifier[withAdditionalSchemaElements] operator[SEP] identifier[SchemaElement] operator[...] identifier[additionalSchemaElements] operator[SEP] {
identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[additionalSchemaElementsCopy] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[additionalSchemaElements] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SchemaElement] identifier[value] operator[:] identifier[additionalSchemaElements] operator[SEP] {
identifier[additionalSchemaElementsCopy] operator[SEP] identifier[add] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[getAdditionalSchemaElements] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[setAdditionalSchemaElements] operator[SEP] identifier[additionalSchemaElementsCopy] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[getAdditionalSchemaElements] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[additionalSchemaElementsCopy] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
private EntryPosition findEndPosition(MysqlConnection mysqlConnection) {
try {
ResultSetPacket packet = mysqlConnection.query("show master status");
List<String> fields = packet.getFieldValues();
if (CollectionUtils.isEmpty(fields)) {
throw new CanalParseException("command : 'show master status' has an error! pls check. you need (at least one of) the SUPER,REPLICATION CLIENT privilege(s) for this operation");
}
EntryPosition endPosition = new EntryPosition(fields.get(0), Long.valueOf(fields.get(1)));
if (isGTIDMode() && fields.size() > 4) {
endPosition.setGtid(fields.get(4));
}
return endPosition;
} catch (IOException e) {
throw new CanalParseException("command : 'show master status' has an error!", e);
}
} | class class_name[name] begin[{]
method[findEndPosition, return_type[type[EntryPosition]], modifier[private], parameter[mysqlConnection]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="show master status")], member=query, postfix_operators=[], prefix_operators=[], qualifier=mysqlConnection, selectors=[], type_arguments=None), name=packet)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResultSetPacket, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFieldValues, postfix_operators=[], prefix_operators=[], qualifier=packet, selectors=[], type_arguments=None), name=fields)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=CollectionUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="command : 'show master status' has an error! pls check. you need (at least one of) the SUPER,REPLICATION CLIENT privilege(s) for this operation")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CanalParseException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=get, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EntryPosition, sub_type=None)), name=endPosition)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EntryPosition, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isGTIDMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], member=get, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[], type_arguments=None)], member=setGtid, postfix_operators=[], prefix_operators=[], qualifier=endPosition, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MemberReference(member=endPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="command : 'show master status' has an error!"), 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=CanalParseException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] identifier[EntryPosition] identifier[findEndPosition] operator[SEP] identifier[MysqlConnection] identifier[mysqlConnection] operator[SEP] {
Keyword[try] {
identifier[ResultSetPacket] identifier[packet] operator[=] identifier[mysqlConnection] operator[SEP] identifier[query] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[fields] operator[=] identifier[packet] operator[SEP] identifier[getFieldValues] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CollectionUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[fields] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CanalParseException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[EntryPosition] identifier[endPosition] operator[=] Keyword[new] identifier[EntryPosition] operator[SEP] identifier[fields] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] , identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[fields] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isGTIDMode] operator[SEP] operator[SEP] operator[&&] identifier[fields] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[4] operator[SEP] {
identifier[endPosition] operator[SEP] identifier[setGtid] operator[SEP] identifier[fields] operator[SEP] identifier[get] operator[SEP] Other[4] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[endPosition] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CanalParseException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void setErrorTolerance(double errorTolerance)
{
if(errorTolerance < 0 || errorTolerance > 1 || Double.isNaN(errorTolerance))
throw new IllegalArgumentException("Error tolerance must be in [0, 1], not " + errorTolerance);
this.errorTolerance = errorTolerance;
} | class class_name[name] begin[{]
method[setErrorTolerance, return_type[void], modifier[public], parameter[errorTolerance]] begin[{]
if[binary_operation[binary_operation[binary_operation[member[.errorTolerance], <, literal[0]], ||, binary_operation[member[.errorTolerance], >, literal[1]]], ||, call[Double.isNaN, parameter[member[.errorTolerance]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error tolerance must be in [0, 1], not "), operandr=MemberReference(member=errorTolerance, 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=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[THIS[member[None.errorTolerance]], member[.errorTolerance]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setErrorTolerance] operator[SEP] Keyword[double] identifier[errorTolerance] operator[SEP] {
Keyword[if] operator[SEP] identifier[errorTolerance] operator[<] Other[0] operator[||] identifier[errorTolerance] operator[>] Other[1] operator[||] identifier[Double] operator[SEP] identifier[isNaN] operator[SEP] identifier[errorTolerance] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[errorTolerance] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[errorTolerance] operator[=] identifier[errorTolerance] operator[SEP]
}
|
protected final synchronized GenerationContext openContext(EObject sarlObject, JvmDeclaredType type,
final Iterable<Class<? extends XtendMember>> supportedMemberTypes) {
assert type != null;
assert supportedMemberTypes != null;
this.sarlSignatureProvider.clear(type);
final GenerationContext context = new GenerationContext(sarlObject, type) {
@Override
public boolean isSupportedMember(XtendMember member) {
for (final Class<? extends XtendMember> supportedMemberType : supportedMemberTypes) {
if (supportedMemberType.isInstance(member)) {
return true;
}
}
return false;
}
};
this.contextInjector.injectMembers(context);
this.bufferedContexes.push(context);
return context;
} | class class_name[name] begin[{]
method[openContext, return_type[type[GenerationContext]], modifier[synchronized final protected], parameter[sarlObject, type, supportedMemberTypes]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=supportedMemberTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
THIS[member[None.sarlSignatureProvider]call[None.clear, parameter[member[.type]]]]
local_variable[type[GenerationContext], context]
THIS[member[None.contextInjector]call[None.injectMembers, parameter[member[.context]]]]
THIS[member[None.bufferedContexes]call[None.push, parameter[member[.context]]]]
return[member[.context]]
end[}]
END[}] | Keyword[protected] Keyword[final] Keyword[synchronized] identifier[GenerationContext] identifier[openContext] operator[SEP] identifier[EObject] identifier[sarlObject] , identifier[JvmDeclaredType] identifier[type] , Keyword[final] identifier[Iterable] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[XtendMember] operator[>] operator[>] identifier[supportedMemberTypes] operator[SEP] {
Keyword[assert] identifier[type] operator[!=] Other[null] operator[SEP] Keyword[assert] identifier[supportedMemberTypes] operator[!=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[sarlSignatureProvider] operator[SEP] identifier[clear] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[final] identifier[GenerationContext] identifier[context] operator[=] Keyword[new] identifier[GenerationContext] operator[SEP] identifier[sarlObject] , identifier[type] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isSupportedMember] operator[SEP] identifier[XtendMember] identifier[member] operator[SEP] {
Keyword[for] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[XtendMember] operator[>] identifier[supportedMemberType] operator[:] identifier[supportedMemberTypes] operator[SEP] {
Keyword[if] operator[SEP] identifier[supportedMemberType] operator[SEP] identifier[isInstance] operator[SEP] identifier[member] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
} operator[SEP] Keyword[this] operator[SEP] identifier[contextInjector] operator[SEP] identifier[injectMembers] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[bufferedContexes] operator[SEP] identifier[push] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[return] identifier[context] operator[SEP]
}
|
private void drawHeatMap(Graphics2D chartGraphics, double[][] data) {
// Calculate the available size for the heatmap.
int noYCells = data.length;
int noXCells = data[0].length;
// double dataMin = min(data);
// double dataMax = max(data);
BufferedImage heatMapImage = new BufferedImage(heatMapSize.width, heatMapSize.height,
BufferedImage.TYPE_INT_ARGB);
Graphics2D heatMapGraphics = heatMapImage.createGraphics();
for (int x = 0; x < noXCells; x++) {
for (int y = 0; y < noYCells; y++) {
// Set colour depending on zValues.
heatMapGraphics.setColor(getCellColour(data[y][x], lowValue, highValue));
int cellX = x * cellSize.width;
int cellY = y * cellSize.height;
heatMapGraphics.fillRect(cellX, cellY, cellSize.width, cellSize.height);
}
}
// Draw the heat map onto the chart.
chartGraphics.drawImage(heatMapImage, heatMapTL.x, heatMapTL.y, heatMapSize.width,
heatMapSize.height, null);
} | class class_name[name] begin[{]
method[drawHeatMap, return_type[void], modifier[private], parameter[chartGraphics, data]] begin[{]
local_variable[type[int], noYCells]
local_variable[type[int], noXCells]
local_variable[type[BufferedImage], heatMapImage]
local_variable[type[Graphics2D], heatMapGraphics]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=lowValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=highValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCellColour, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setColor, postfix_operators=[], prefix_operators=[], qualifier=heatMapGraphics, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=cellSize, selectors=[]), operator=*), name=cellX)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=cellSize, selectors=[]), operator=*), name=cellY)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cellX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cellY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=cellSize, selectors=[]), MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=cellSize, selectors=[])], member=fillRect, postfix_operators=[], prefix_operators=[], qualifier=heatMapGraphics, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=noYCells, 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=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=noXCells, 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=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[chartGraphics.drawImage, parameter[member[.heatMapImage], member[heatMapTL.x], member[heatMapTL.y], member[heatMapSize.width], member[heatMapSize.height], literal[null]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[drawHeatMap] operator[SEP] identifier[Graphics2D] identifier[chartGraphics] , Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[data] operator[SEP] {
Keyword[int] identifier[noYCells] operator[=] identifier[data] operator[SEP] identifier[length] operator[SEP] Keyword[int] identifier[noXCells] operator[=] identifier[data] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[BufferedImage] identifier[heatMapImage] operator[=] Keyword[new] identifier[BufferedImage] operator[SEP] identifier[heatMapSize] operator[SEP] identifier[width] , identifier[heatMapSize] operator[SEP] identifier[height] , identifier[BufferedImage] operator[SEP] identifier[TYPE_INT_ARGB] operator[SEP] operator[SEP] identifier[Graphics2D] identifier[heatMapGraphics] operator[=] identifier[heatMapImage] operator[SEP] identifier[createGraphics] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[noXCells] operator[SEP] identifier[x] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[noYCells] operator[SEP] identifier[y] operator[++] operator[SEP] {
identifier[heatMapGraphics] operator[SEP] identifier[setColor] operator[SEP] identifier[getCellColour] operator[SEP] identifier[data] operator[SEP] identifier[y] operator[SEP] operator[SEP] identifier[x] operator[SEP] , identifier[lowValue] , identifier[highValue] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[cellX] operator[=] identifier[x] operator[*] identifier[cellSize] operator[SEP] identifier[width] operator[SEP] Keyword[int] identifier[cellY] operator[=] identifier[y] operator[*] identifier[cellSize] operator[SEP] identifier[height] operator[SEP] identifier[heatMapGraphics] operator[SEP] identifier[fillRect] operator[SEP] identifier[cellX] , identifier[cellY] , identifier[cellSize] operator[SEP] identifier[width] , identifier[cellSize] operator[SEP] identifier[height] operator[SEP] operator[SEP]
}
}
identifier[chartGraphics] operator[SEP] identifier[drawImage] operator[SEP] identifier[heatMapImage] , identifier[heatMapTL] operator[SEP] identifier[x] , identifier[heatMapTL] operator[SEP] identifier[y] , identifier[heatMapSize] operator[SEP] identifier[width] , identifier[heatMapSize] operator[SEP] identifier[height] , Other[null] operator[SEP] operator[SEP]
}
|
@Override
public ListCloudFrontOriginAccessIdentitiesResult listCloudFrontOriginAccessIdentities(ListCloudFrontOriginAccessIdentitiesRequest request) {
request = beforeClientExecution(request);
return executeListCloudFrontOriginAccessIdentities(request);
} | class class_name[name] begin[{]
method[listCloudFrontOriginAccessIdentities, return_type[type[ListCloudFrontOriginAccessIdentitiesResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeListCloudFrontOriginAccessIdentities, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ListCloudFrontOriginAccessIdentitiesResult] identifier[listCloudFrontOriginAccessIdentities] operator[SEP] identifier[ListCloudFrontOriginAccessIdentitiesRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeListCloudFrontOriginAccessIdentities] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public void init(int size, int columns, ColorPickerSwatch.OnColorSelectedListener listener) {
mNumColumns = columns;
Resources res = getResources();
if (size == ColorPickerDialog.SIZE_LARGE) {
mSwatchLength = res.getDimensionPixelSize(R.dimen.color_swatch_large);
mMarginSize = res.getDimensionPixelSize(R.dimen.color_swatch_margins_large);
} else {
mSwatchLength = res.getDimensionPixelSize(R.dimen.color_swatch_small);
mMarginSize = res.getDimensionPixelSize(R.dimen.color_swatch_margins_small);
}
mOnColorSelectedListener = listener;
mDescription = res.getString(R.string.color_swatch_description);
mDescriptionSelected = res.getString(R.string.color_swatch_description_selected);
} | class class_name[name] begin[{]
method[init, return_type[void], modifier[public], parameter[size, columns, listener]] begin[{]
assign[member[.mNumColumns], member[.columns]]
local_variable[type[Resources], res]
if[binary_operation[member[.size], ==, member[ColorPickerDialog.SIZE_LARGE]]] begin[{]
assign[member[.mSwatchLength], call[res.getDimensionPixelSize, parameter[member[R.dimen.color_swatch_large]]]]
assign[member[.mMarginSize], call[res.getDimensionPixelSize, parameter[member[R.dimen.color_swatch_margins_large]]]]
else begin[{]
assign[member[.mSwatchLength], call[res.getDimensionPixelSize, parameter[member[R.dimen.color_swatch_small]]]]
assign[member[.mMarginSize], call[res.getDimensionPixelSize, parameter[member[R.dimen.color_swatch_margins_small]]]]
end[}]
assign[member[.mOnColorSelectedListener], member[.listener]]
assign[member[.mDescription], call[res.getString, parameter[member[R.string.color_swatch_description]]]]
assign[member[.mDescriptionSelected], call[res.getString, parameter[member[R.string.color_swatch_description_selected]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[init] operator[SEP] Keyword[int] identifier[size] , Keyword[int] identifier[columns] , identifier[ColorPickerSwatch] operator[SEP] identifier[OnColorSelectedListener] identifier[listener] operator[SEP] {
identifier[mNumColumns] operator[=] identifier[columns] operator[SEP] identifier[Resources] identifier[res] operator[=] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[==] identifier[ColorPickerDialog] operator[SEP] identifier[SIZE_LARGE] operator[SEP] {
identifier[mSwatchLength] operator[=] identifier[res] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[R] operator[SEP] identifier[dimen] operator[SEP] identifier[color_swatch_large] operator[SEP] operator[SEP] identifier[mMarginSize] operator[=] identifier[res] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[R] operator[SEP] identifier[dimen] operator[SEP] identifier[color_swatch_margins_large] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[mSwatchLength] operator[=] identifier[res] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[R] operator[SEP] identifier[dimen] operator[SEP] identifier[color_swatch_small] operator[SEP] operator[SEP] identifier[mMarginSize] operator[=] identifier[res] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[R] operator[SEP] identifier[dimen] operator[SEP] identifier[color_swatch_margins_small] operator[SEP] operator[SEP]
}
identifier[mOnColorSelectedListener] operator[=] identifier[listener] operator[SEP] identifier[mDescription] operator[=] identifier[res] operator[SEP] identifier[getString] operator[SEP] identifier[R] operator[SEP] identifier[string] operator[SEP] identifier[color_swatch_description] operator[SEP] operator[SEP] identifier[mDescriptionSelected] operator[=] identifier[res] operator[SEP] identifier[getString] operator[SEP] identifier[R] operator[SEP] identifier[string] operator[SEP] identifier[color_swatch_description_selected] operator[SEP] operator[SEP]
}
|
public IPHPJavaClassCreator getClassCreator(PHPContainer container, PHPClassDescriptor desc) {
return new PHPJavaClassCreator(container, desc, uniqueId);
} | class class_name[name] begin[{]
method[getClassCreator, return_type[type[IPHPJavaClassCreator]], modifier[public], parameter[container, desc]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=desc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uniqueId, 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=PHPJavaClassCreator, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[IPHPJavaClassCreator] identifier[getClassCreator] operator[SEP] identifier[PHPContainer] identifier[container] , identifier[PHPClassDescriptor] identifier[desc] operator[SEP] {
Keyword[return] Keyword[new] identifier[PHPJavaClassCreator] operator[SEP] identifier[container] , identifier[desc] , identifier[uniqueId] operator[SEP] operator[SEP]
}
|
private List<ObligationExpression> getFulfilledObligationExpressions(
List<ObligationExpression> oes,
DecisionType decision) {
List<ObligationExpression> fulfilledOEs = new ArrayList<ObligationExpression>();
if (oes != null && oes.size() > 0) {
for (ObligationExpression oe : oes) {
if (oe.isFulfilled(decision)) {
fulfilledOEs.add(oe);
}
}
}
return fulfilledOEs;
} | class class_name[name] begin[{]
method[getFulfilledObligationExpressions, return_type[type[List]], modifier[private], parameter[oes, decision]] begin[{]
local_variable[type[List], fulfilledOEs]
if[binary_operation[binary_operation[member[.oes], !=, literal[null]], &&, binary_operation[call[oes.size, parameter[]], >, literal[0]]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=decision, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isFulfilled, postfix_operators=[], prefix_operators=[], qualifier=oe, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=oe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=fulfilledOEs, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=oes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=oe)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObligationExpression, sub_type=None))), label=None)
else begin[{]
None
end[}]
return[member[.fulfilledOEs]]
end[}]
END[}] | Keyword[private] identifier[List] operator[<] identifier[ObligationExpression] operator[>] identifier[getFulfilledObligationExpressions] operator[SEP] identifier[List] operator[<] identifier[ObligationExpression] operator[>] identifier[oes] , identifier[DecisionType] identifier[decision] operator[SEP] {
identifier[List] operator[<] identifier[ObligationExpression] operator[>] identifier[fulfilledOEs] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ObligationExpression] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oes] operator[!=] Other[null] operator[&&] identifier[oes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[for] operator[SEP] identifier[ObligationExpression] identifier[oe] operator[:] identifier[oes] operator[SEP] {
Keyword[if] operator[SEP] identifier[oe] operator[SEP] identifier[isFulfilled] operator[SEP] identifier[decision] operator[SEP] operator[SEP] {
identifier[fulfilledOEs] operator[SEP] identifier[add] operator[SEP] identifier[oe] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[fulfilledOEs] operator[SEP]
}
|
PdfDictionary getDictionary(PdfWriter writer) {
try {
return PdfNumberTree.writeTree(map, writer);
}
catch (IOException e) {
throw new ExceptionConverter(e);
}
} | class class_name[name] begin[{]
method[getDictionary, return_type[type[PdfDictionary]], modifier[default], parameter[writer]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeTree, postfix_operators=[], prefix_operators=[], qualifier=PdfNumberTree, 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=ExceptionConverter, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | identifier[PdfDictionary] identifier[getDictionary] operator[SEP] identifier[PdfWriter] identifier[writer] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[PdfNumberTree] operator[SEP] identifier[writeTree] operator[SEP] identifier[map] , identifier[writer] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ExceptionConverter] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
private static void setParams(Map<String, ?> map) {
for (String name : map.keySet()) {
setParam(name, map.get(name));
}
} | class class_name[name] begin[{]
method[setParams, return_type[void], modifier[private static], parameter[map]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None)], member=setParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[setParams] operator[SEP] identifier[Map] operator[<] identifier[String] , operator[?] operator[>] identifier[map] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[name] operator[:] identifier[map] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[setParam] operator[SEP] identifier[name] , identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP]
}
}
|
protected void sequence_JvmTypeReference(ISerializationContext context, JvmGenericArrayTypeReference semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, TypesPackage.Literals.JVM_GENERIC_ARRAY_TYPE_REFERENCE__COMPONENT_TYPE) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TypesPackage.Literals.JVM_GENERIC_ARRAY_TYPE_REFERENCE__COMPONENT_TYPE));
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getJvmTypeReferenceAccess().getJvmGenericArrayTypeReferenceComponentTypeAction_0_1_0_0(), semanticObject.getComponentType());
feeder.finish();
} | class class_name[name] begin[{]
method[sequence_JvmTypeReference, return_type[void], modifier[protected], parameter[context, semanticObject]] begin[{]
if[binary_operation[member[.errorAcceptor], !=, literal[null]]] begin[{]
if[binary_operation[call[transientValues.isValueTransient, parameter[member[.semanticObject], member[TypesPackage.Literals.JVM_GENERIC_ARRAY_TYPE_REFERENCE__COMPONENT_TYPE]]], ==, member[ValueTransient.YES]]] begin[{]
call[errorAcceptor.accept, parameter[call[diagnosticProvider.createFeatureValueMissing, parameter[member[.semanticObject], member[TypesPackage.Literals.JVM_GENERIC_ARRAY_TYPE_REFERENCE__COMPONENT_TYPE]]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[SequenceFeeder], feeder]
call[feeder.accept, parameter[call[grammarAccess.getJvmTypeReferenceAccess, parameter[]], call[semanticObject.getComponentType, parameter[]]]]
call[feeder.finish, parameter[]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[sequence_JvmTypeReference] operator[SEP] identifier[ISerializationContext] identifier[context] , identifier[JvmGenericArrayTypeReference] identifier[semanticObject] operator[SEP] {
Keyword[if] operator[SEP] identifier[errorAcceptor] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[transientValues] operator[SEP] identifier[isValueTransient] operator[SEP] identifier[semanticObject] , identifier[TypesPackage] operator[SEP] identifier[Literals] operator[SEP] identifier[JVM_GENERIC_ARRAY_TYPE_REFERENCE__COMPONENT_TYPE] operator[SEP] operator[==] identifier[ValueTransient] operator[SEP] identifier[YES] operator[SEP] identifier[errorAcceptor] operator[SEP] identifier[accept] operator[SEP] identifier[diagnosticProvider] operator[SEP] identifier[createFeatureValueMissing] operator[SEP] identifier[semanticObject] , identifier[TypesPackage] operator[SEP] identifier[Literals] operator[SEP] identifier[JVM_GENERIC_ARRAY_TYPE_REFERENCE__COMPONENT_TYPE] operator[SEP] operator[SEP] operator[SEP]
}
identifier[SequenceFeeder] identifier[feeder] operator[=] identifier[createSequencerFeeder] operator[SEP] identifier[context] , identifier[semanticObject] operator[SEP] operator[SEP] identifier[feeder] operator[SEP] identifier[accept] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getJvmTypeReferenceAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getJvmGenericArrayTypeReferenceComponentTypeAction_0_1_0_0] operator[SEP] operator[SEP] , identifier[semanticObject] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[feeder] operator[SEP] identifier[finish] operator[SEP] operator[SEP] operator[SEP]
}
|
public <B> StreamT<W,B> flatMapT(final Function<? super T, StreamT<W,B>> f) {
return of(run.map(list -> list.flatMap(a -> f.apply(a).run.stream())
.flatMap(a -> a)));
} | class class_name[name] begin[{]
method[flatMapT, return_type[type[StreamT]], modifier[public], parameter[f]] begin[{]
return[call[.of, parameter[call[run.map, parameter[LambdaExpression(body=MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[MemberReference(member=run, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=stream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=flatMap, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), parameters=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=flatMap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[B] operator[>] identifier[StreamT] operator[<] identifier[W] , identifier[B] operator[>] identifier[flatMapT] operator[SEP] Keyword[final] identifier[Function] operator[<] operator[?] Keyword[super] identifier[T] , identifier[StreamT] operator[<] identifier[W] , identifier[B] operator[>] operator[>] identifier[f] operator[SEP] {
Keyword[return] identifier[of] operator[SEP] identifier[run] operator[SEP] identifier[map] operator[SEP] identifier[list] operator[->] identifier[list] operator[SEP] identifier[flatMap] operator[SEP] identifier[a] operator[->] identifier[f] operator[SEP] identifier[apply] operator[SEP] identifier[a] operator[SEP] operator[SEP] identifier[run] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] identifier[a] operator[->] identifier[a] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Betner betnLast(String target, String leftSameWithRight) {
return betn(target).betweenLast(leftSameWithRight);
} | class class_name[name] begin[{]
method[betnLast, return_type[type[Betner]], modifier[public static], parameter[target, leftSameWithRight]] begin[{]
return[call[.betn, parameter[member[.target]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Betner] identifier[betnLast] operator[SEP] identifier[String] identifier[target] , identifier[String] identifier[leftSameWithRight] operator[SEP] {
Keyword[return] identifier[betn] operator[SEP] identifier[target] operator[SEP] operator[SEP] identifier[betweenLast] operator[SEP] identifier[leftSameWithRight] operator[SEP] operator[SEP]
}
|
public static String decodeComponent(final String s, final Charset charset) {
if (s == null) {
return "";
}
final int size = s.length();
boolean modified = false;
for (int i = 0; i < size; i++) {
final char c = s.charAt(i);
if (c == '%' || c == '+') {
modified = true;
break;
}
}
if (!modified) {
return s;
}
final byte[] buf = new byte[size];
int pos = 0; // position in `buf'.
for (int i = 0; i < size; i++) {
char c = s.charAt(i);
switch (c) {
case '+':
buf[pos++] = ' '; // "+" -> " "
break;
case '%':
if (i == size - 1) {
throw new IllegalArgumentException("unterminated escape"
+ " sequence at end of string: " + s);
}
c = s.charAt(++i);
if (c == '%') {
buf[pos++] = '%'; // "%%" -> "%"
break;
}
if (i == size - 1) {
throw new IllegalArgumentException("partial escape"
+ " sequence at end of string: " + s);
}
c = decodeHexNibble(c);
final char c2 = decodeHexNibble(s.charAt(++i));
if (c == Character.MAX_VALUE || c2 == Character.MAX_VALUE) {
throw new IllegalArgumentException(
"invalid escape sequence `%" + s.charAt(i - 1)
+ s.charAt(i) + "' at index " + (i - 2)
+ " of: " + s);
}
c = (char) (c * 16 + c2);
// Fall through.
default:
buf[pos++] = (byte) c;
break;
}
}
return new String(buf, 0, pos, charset);
} | class class_name[name] begin[{]
method[decodeComponent, return_type[type[String]], modifier[public static], parameter[s, charset]] begin[{]
if[binary_operation[member[.s], ==, literal[null]]] begin[{]
return[literal[""]]
else begin[{]
None
end[}]
local_variable[type[int], size]
local_variable[type[boolean], modified]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=c)], modifiers={'final'}, type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%'), operator===), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='+'), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=modified, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[member[.modified]] begin[{]
return[member[.s]]
else begin[{]
None
end[}]
local_variable[type[byte], buf]
local_variable[type[int], pos]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='+')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%')], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unterminated escape"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" sequence at end of string: "), operator=+), operandr=MemberReference(member=s, 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=IllegalArgumentException, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%'), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='%')), label=None), BreakStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="partial escape"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" sequence at end of string: "), operator=+), operandr=MemberReference(member=s, 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=IllegalArgumentException, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decodeHexNibble, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=decodeHexNibble, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=c2)], modifiers={'final'}, type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid escape sequence `%"), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' at index "), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=-), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" of: "), operator=+), operandr=MemberReference(member=s, 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=IllegalArgumentException, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=*), operandr=MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), type=BasicType(dimensions=[], name=char))), label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[ClassCreator(arguments=[MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=charset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[decodeComponent] operator[SEP] Keyword[final] identifier[String] identifier[s] , Keyword[final] identifier[Charset] identifier[charset] operator[SEP] {
Keyword[if] operator[SEP] identifier[s] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
Keyword[final] Keyword[int] identifier[size] operator[=] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[modified] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[final] Keyword[char] identifier[c] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[||] identifier[c] operator[==] literal[String] operator[SEP] {
identifier[modified] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[modified] operator[SEP] {
Keyword[return] identifier[s] operator[SEP]
}
Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[int] identifier[pos] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[char] identifier[c] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[c] operator[SEP] {
Keyword[case] literal[String] operator[:] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[i] operator[==] identifier[size] operator[-] Other[1] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] literal[String] operator[+] identifier[s] operator[SEP] operator[SEP]
}
identifier[c] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] operator[++] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] literal[String] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[if] operator[SEP] identifier[i] operator[==] identifier[size] operator[-] Other[1] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] literal[String] operator[+] identifier[s] operator[SEP] operator[SEP]
}
identifier[c] operator[=] identifier[decodeHexNibble] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[final] Keyword[char] identifier[c2] operator[=] identifier[decodeHexNibble] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] operator[++] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] identifier[Character] operator[SEP] identifier[MAX_VALUE] operator[||] identifier[c2] operator[==] identifier[Character] operator[SEP] identifier[MAX_VALUE] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[-] Other[1] operator[SEP] operator[+] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[i] operator[-] Other[2] operator[SEP] operator[+] literal[String] operator[+] identifier[s] operator[SEP] operator[SEP]
}
identifier[c] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[c] operator[*] Other[16] operator[+] identifier[c2] operator[SEP] operator[SEP] Keyword[default] operator[:] identifier[buf] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[c] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[buf] , Other[0] , identifier[pos] , identifier[charset] operator[SEP] operator[SEP]
}
|
private synchronized void issueTaggingFailedMessage(int returnCode) {
if (taggingFailedIssued) {
return;
}
System.err.println(MessageFormat.format(BootstrapConstants.messages.getString("warn.unableTagFile"), returnCode));
taggingFailedIssued = true;
} | class class_name[name] begin[{]
method[issueTaggingFailedMessage, return_type[void], modifier[synchronized private], parameter[returnCode]] begin[{]
if[member[.taggingFailedIssued]] begin[{]
return[None]
else begin[{]
None
end[}]
call[System.err.println, parameter[call[MessageFormat.format, parameter[call[BootstrapConstants.messages.getString, parameter[literal["warn.unableTagFile"]]], member[.returnCode]]]]]
assign[member[.taggingFailedIssued], literal[true]]
end[}]
END[}] | Keyword[private] Keyword[synchronized] Keyword[void] identifier[issueTaggingFailedMessage] operator[SEP] Keyword[int] identifier[returnCode] operator[SEP] {
Keyword[if] operator[SEP] identifier[taggingFailedIssued] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] identifier[MessageFormat] operator[SEP] identifier[format] operator[SEP] identifier[BootstrapConstants] operator[SEP] identifier[messages] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] , identifier[returnCode] operator[SEP] operator[SEP] operator[SEP] identifier[taggingFailedIssued] operator[=] literal[boolean] operator[SEP]
}
|
public Props load(final InputStream in) throws IOException {
final Writer out = new FastCharArrayWriter();
StreamUtil.copy(in, out);
parse(out.toString());
return this;
} | class class_name[name] begin[{]
method[load, return_type[type[Props]], modifier[public], parameter[in]] begin[{]
local_variable[type[Writer], out]
call[StreamUtil.copy, parameter[member[.in], member[.out]]]
call[.parse, parameter[call[out.toString, parameter[]]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Props] identifier[load] operator[SEP] Keyword[final] identifier[InputStream] identifier[in] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[final] identifier[Writer] identifier[out] operator[=] Keyword[new] identifier[FastCharArrayWriter] operator[SEP] operator[SEP] operator[SEP] identifier[StreamUtil] operator[SEP] identifier[copy] operator[SEP] identifier[in] , identifier[out] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[out] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@Bean
@ConditionalOnMissingBean
DistributionSetTagManagement distributionSetTagManagement(
final DistributionSetTagRepository distributionSetTagRepository,
final DistributionSetRepository distributionSetRepository,
final VirtualPropertyReplacer virtualPropertyReplacer, final NoCountPagingRepository criteriaNoCountDao,
final JpaProperties properties) {
return new JpaDistributionSetTagManagement(distributionSetTagRepository, distributionSetRepository,
virtualPropertyReplacer, criteriaNoCountDao, properties.getDatabase());
} | class class_name[name] begin[{]
method[distributionSetTagManagement, return_type[type[DistributionSetTagManagement]], modifier[default], parameter[distributionSetTagRepository, distributionSetRepository, virtualPropertyReplacer, criteriaNoCountDao, properties]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=distributionSetTagRepository, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=distributionSetRepository, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=virtualPropertyReplacer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=criteriaNoCountDao, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getDatabase, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JpaDistributionSetTagManagement, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Bean] annotation[@] identifier[ConditionalOnMissingBean] identifier[DistributionSetTagManagement] identifier[distributionSetTagManagement] operator[SEP] Keyword[final] identifier[DistributionSetTagRepository] identifier[distributionSetTagRepository] , Keyword[final] identifier[DistributionSetRepository] identifier[distributionSetRepository] , Keyword[final] identifier[VirtualPropertyReplacer] identifier[virtualPropertyReplacer] , Keyword[final] identifier[NoCountPagingRepository] identifier[criteriaNoCountDao] , Keyword[final] identifier[JpaProperties] identifier[properties] operator[SEP] {
Keyword[return] Keyword[new] identifier[JpaDistributionSetTagManagement] operator[SEP] identifier[distributionSetTagRepository] , identifier[distributionSetRepository] , identifier[virtualPropertyReplacer] , identifier[criteriaNoCountDao] , identifier[properties] operator[SEP] identifier[getDatabase] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private Map<String, String> createScriptEnvironment() {
Map<String, String> env = new HashMap<>();
env.putAll(System.getenv());
env.putAll(configuration.getScriptEnvironmentVariables());
env.put(propertyToEnvironmentVariableName(Configuration.KUBERNETES_NAMESPACE), configuration.getNamespace());
env.put(propertyToEnvironmentVariableName(Configuration.KUBERNETES_DOMAIN), configuration.getKubernetesDomain());
env.put(propertyToEnvironmentVariableName(Configuration.KUBERNETES_MASTER),
configuration.getMasterUrl().toString());
env.put(propertyToEnvironmentVariableName(Configuration.DOCKER_REGISTY), configuration.getDockerRegistry());
return env;
} | class class_name[name] begin[{]
method[createScriptEnvironment, return_type[type[Map]], modifier[private], parameter[]] begin[{]
local_variable[type[Map], env]
call[env.putAll, parameter[call[System.getenv, parameter[]]]]
call[env.putAll, parameter[call[configuration.getScriptEnvironmentVariables, parameter[]]]]
call[env.put, parameter[call[.propertyToEnvironmentVariableName, parameter[member[Configuration.KUBERNETES_NAMESPACE]]], call[configuration.getNamespace, parameter[]]]]
call[env.put, parameter[call[.propertyToEnvironmentVariableName, parameter[member[Configuration.KUBERNETES_DOMAIN]]], call[configuration.getKubernetesDomain, parameter[]]]]
call[env.put, parameter[call[.propertyToEnvironmentVariableName, parameter[member[Configuration.KUBERNETES_MASTER]]], call[configuration.getMasterUrl, parameter[]]]]
call[env.put, parameter[call[.propertyToEnvironmentVariableName, parameter[member[Configuration.DOCKER_REGISTY]]], call[configuration.getDockerRegistry, parameter[]]]]
return[member[.env]]
end[}]
END[}] | Keyword[private] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[createScriptEnvironment] operator[SEP] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[env] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[env] operator[SEP] identifier[putAll] operator[SEP] identifier[System] operator[SEP] identifier[getenv] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[env] operator[SEP] identifier[putAll] operator[SEP] identifier[configuration] operator[SEP] identifier[getScriptEnvironmentVariables] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[env] operator[SEP] identifier[put] operator[SEP] identifier[propertyToEnvironmentVariableName] operator[SEP] identifier[Configuration] operator[SEP] identifier[KUBERNETES_NAMESPACE] operator[SEP] , identifier[configuration] operator[SEP] identifier[getNamespace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[env] operator[SEP] identifier[put] operator[SEP] identifier[propertyToEnvironmentVariableName] operator[SEP] identifier[Configuration] operator[SEP] identifier[KUBERNETES_DOMAIN] operator[SEP] , identifier[configuration] operator[SEP] identifier[getKubernetesDomain] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[env] operator[SEP] identifier[put] operator[SEP] identifier[propertyToEnvironmentVariableName] operator[SEP] identifier[Configuration] operator[SEP] identifier[KUBERNETES_MASTER] operator[SEP] , identifier[configuration] operator[SEP] identifier[getMasterUrl] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[env] operator[SEP] identifier[put] operator[SEP] identifier[propertyToEnvironmentVariableName] operator[SEP] identifier[Configuration] operator[SEP] identifier[DOCKER_REGISTY] operator[SEP] , identifier[configuration] operator[SEP] identifier[getDockerRegistry] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[env] operator[SEP]
}
|
public static void startActivity(@NonNull Fragment fragment, int requestCode,
@IntRange(from = 0) int maxSelection,
List<Uri> selection,
String... mediaTypeFilter) {
Intent intent = buildIntent(fragment.getContext(), maxSelection, selection, mediaTypeFilter);
fragment.startActivityForResult(intent, requestCode);
} | class class_name[name] begin[{]
method[startActivity, return_type[void], modifier[public static], parameter[fragment, requestCode, maxSelection, selection, mediaTypeFilter]] begin[{]
local_variable[type[Intent], intent]
call[fragment.startActivityForResult, parameter[member[.intent], member[.requestCode]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[startActivity] operator[SEP] annotation[@] identifier[NonNull] identifier[Fragment] identifier[fragment] , Keyword[int] identifier[requestCode] , annotation[@] identifier[IntRange] operator[SEP] identifier[from] operator[=] Other[0] operator[SEP] Keyword[int] identifier[maxSelection] , identifier[List] operator[<] identifier[Uri] operator[>] identifier[selection] , identifier[String] operator[...] identifier[mediaTypeFilter] operator[SEP] {
identifier[Intent] identifier[intent] operator[=] identifier[buildIntent] operator[SEP] identifier[fragment] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] , identifier[maxSelection] , identifier[selection] , identifier[mediaTypeFilter] operator[SEP] operator[SEP] identifier[fragment] operator[SEP] identifier[startActivityForResult] operator[SEP] identifier[intent] , identifier[requestCode] operator[SEP] operator[SEP]
}
|
public void info(Object message) {
differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.INFO_INT, message, null);
} | class class_name[name] begin[{]
method[info, return_type[void], modifier[public], parameter[message]] begin[{]
call[.differentiatedLog, parameter[literal[null], member[.CATEGORY_FQCN], member[LocationAwareLogger.INFO_INT], member[.message], literal[null]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[info] operator[SEP] identifier[Object] identifier[message] operator[SEP] {
identifier[differentiatedLog] operator[SEP] Other[null] , identifier[CATEGORY_FQCN] , identifier[LocationAwareLogger] operator[SEP] identifier[INFO_INT] , identifier[message] , Other[null] operator[SEP] operator[SEP]
}
|
public static String toHexBytes(byte[] bytes, int offset, int length) {
StringBuilder builder = new StringBuilder();
for (int index = offset; index < bytes.length && index < (offset + length); index++) {
byte b = bytes[index];
int first = (b >> 4) & 15;
int second = b & 15;
builder.append(hexChars.charAt(first)).append(hexChars.charAt(second));
}
return builder.toString();
} | class class_name[name] begin[{]
method[toHexBytes, return_type[type[String]], modifier[public static], parameter[bytes, offset, length]] begin[{]
local_variable[type[StringBuilder], builder]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=b)], modifiers=set(), type=BasicType(dimensions=[], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=15), operator=&), name=first)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=15), operator=&), name=second)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=hexChars, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=second, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=hexChars, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bytes, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operator=<), operator=&&), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[call[builder.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[toHexBytes] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] , Keyword[int] identifier[offset] , Keyword[int] identifier[length] operator[SEP] {
identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[offset] operator[SEP] identifier[index] operator[<] identifier[bytes] operator[SEP] identifier[length] operator[&&] identifier[index] operator[<] operator[SEP] identifier[offset] operator[+] identifier[length] operator[SEP] operator[SEP] identifier[index] operator[++] operator[SEP] {
Keyword[byte] identifier[b] operator[=] identifier[bytes] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[int] identifier[first] operator[=] operator[SEP] identifier[b] operator[>] operator[>] Other[4] operator[SEP] operator[&] Other[15] operator[SEP] Keyword[int] identifier[second] operator[=] identifier[b] operator[&] Other[15] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[hexChars] operator[SEP] identifier[charAt] operator[SEP] identifier[first] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[hexChars] operator[SEP] identifier[charAt] operator[SEP] identifier[second] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public void bind(Handler<AsyncResult<Void>> completion) {
logger.info("Starting server {}", name);
context = vertx.getOrCreateContext();
bind(port, completion);
} | class class_name[name] begin[{]
method[bind, return_type[void], modifier[public], parameter[completion]] begin[{]
call[logger.info, parameter[literal["Starting server {}"], member[.name]]]
assign[member[.context], call[vertx.getOrCreateContext, parameter[]]]
call[.bind, parameter[member[.port], member[.completion]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[bind] operator[SEP] identifier[Handler] operator[<] identifier[AsyncResult] operator[<] identifier[Void] operator[>] operator[>] identifier[completion] operator[SEP] {
identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[name] operator[SEP] operator[SEP] identifier[context] operator[=] identifier[vertx] operator[SEP] identifier[getOrCreateContext] operator[SEP] operator[SEP] operator[SEP] identifier[bind] operator[SEP] identifier[port] , identifier[completion] operator[SEP] operator[SEP]
}
|
public void marshall(TypedAttributeValue typedAttributeValue, ProtocolMarshaller protocolMarshaller) {
if (typedAttributeValue == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(typedAttributeValue.getStringValue(), STRINGVALUE_BINDING);
protocolMarshaller.marshall(typedAttributeValue.getBinaryValue(), BINARYVALUE_BINDING);
protocolMarshaller.marshall(typedAttributeValue.getBooleanValue(), BOOLEANVALUE_BINDING);
protocolMarshaller.marshall(typedAttributeValue.getNumberValue(), NUMBERVALUE_BINDING);
protocolMarshaller.marshall(typedAttributeValue.getDatetimeValue(), DATETIMEVALUE_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} | class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[typedAttributeValue, protocolMarshaller]] begin[{]
if[binary_operation[member[.typedAttributeValue], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStringValue, postfix_operators=[], prefix_operators=[], qualifier=typedAttributeValue, selectors=[], type_arguments=None), MemberReference(member=STRINGVALUE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBinaryValue, postfix_operators=[], prefix_operators=[], qualifier=typedAttributeValue, selectors=[], type_arguments=None), MemberReference(member=BINARYVALUE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBooleanValue, postfix_operators=[], prefix_operators=[], qualifier=typedAttributeValue, selectors=[], type_arguments=None), MemberReference(member=BOOLEANVALUE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNumberValue, postfix_operators=[], prefix_operators=[], qualifier=typedAttributeValue, selectors=[], type_arguments=None), MemberReference(member=NUMBERVALUE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDatetimeValue, postfix_operators=[], prefix_operators=[], qualifier=typedAttributeValue, selectors=[], type_arguments=None), MemberReference(member=DATETIMEVALUE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[TypedAttributeValue] identifier[typedAttributeValue] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[typedAttributeValue] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[typedAttributeValue] operator[SEP] identifier[getStringValue] operator[SEP] operator[SEP] , identifier[STRINGVALUE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[typedAttributeValue] operator[SEP] identifier[getBinaryValue] operator[SEP] operator[SEP] , identifier[BINARYVALUE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[typedAttributeValue] operator[SEP] identifier[getBooleanValue] operator[SEP] operator[SEP] , identifier[BOOLEANVALUE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[typedAttributeValue] operator[SEP] identifier[getNumberValue] operator[SEP] operator[SEP] , identifier[NUMBERVALUE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[typedAttributeValue] operator[SEP] identifier[getDatetimeValue] operator[SEP] operator[SEP] , identifier[DATETIMEVALUE_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
static void deleteDocument(SolrClient client, String lang, String word) throws IOException, SolrServerException {
if ((null == client)
|| CmsStringUtil.isEmptyOrWhitespaceOnly(lang)
|| CmsStringUtil.isEmptyOrWhitespaceOnly(word)) {
return;
}
// Make sure the parameter holding the word that should be deleted
// contains just a single word
if (word.trim().contains(" ")) {
final String query = String.format("entry_%s:%s", lang, word);
client.deleteByQuery(query);
}
} | class class_name[name] begin[{]
method[deleteDocument, return_type[void], modifier[static], parameter[client, lang, word]] begin[{]
if[binary_operation[binary_operation[binary_operation[literal[null], ==, member[.client]], ||, call[CmsStringUtil.isEmptyOrWhitespaceOnly, parameter[member[.lang]]]], ||, call[CmsStringUtil.isEmptyOrWhitespaceOnly, parameter[member[.word]]]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[call[word.trim, parameter[]]] begin[{]
local_variable[type[String], query]
call[client.deleteByQuery, parameter[member[.query]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[static] Keyword[void] identifier[deleteDocument] operator[SEP] identifier[SolrClient] identifier[client] , identifier[String] identifier[lang] , identifier[String] identifier[word] operator[SEP] Keyword[throws] identifier[IOException] , identifier[SolrServerException] {
Keyword[if] operator[SEP] operator[SEP] Other[null] operator[==] identifier[client] operator[SEP] operator[||] identifier[CmsStringUtil] operator[SEP] identifier[isEmptyOrWhitespaceOnly] operator[SEP] identifier[lang] operator[SEP] operator[||] identifier[CmsStringUtil] operator[SEP] identifier[isEmptyOrWhitespaceOnly] operator[SEP] identifier[word] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[word] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[query] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[lang] , identifier[word] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[deleteByQuery] operator[SEP] identifier[query] operator[SEP] operator[SEP]
}
}
|
protected void _createBody(_IControl body,boolean includeStatusMessage){
int statusMessageIndex = body.getContainedControls().size();
showErrorsIfAny(body,statusMessageIndex, includeStatusMessage);
createBody(body);
} | class class_name[name] begin[{]
method[_createBody, return_type[void], modifier[protected], parameter[body, includeStatusMessage]] begin[{]
local_variable[type[int], statusMessageIndex]
call[.showErrorsIfAny, parameter[member[.body], member[.statusMessageIndex], member[.includeStatusMessage]]]
call[.createBody, parameter[member[.body]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[_createBody] operator[SEP] identifier[_IControl] identifier[body] , Keyword[boolean] identifier[includeStatusMessage] operator[SEP] {
Keyword[int] identifier[statusMessageIndex] operator[=] identifier[body] operator[SEP] identifier[getContainedControls] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[showErrorsIfAny] operator[SEP] identifier[body] , identifier[statusMessageIndex] , identifier[includeStatusMessage] operator[SEP] operator[SEP] identifier[createBody] operator[SEP] identifier[body] operator[SEP] operator[SEP]
}
|
public static boolean isIdentifierKeyword(CharSequence text)
{
int pos = 0;
int valuelen = text.length();
if(valuelen == 0)
{
return false;
}
boolean keyword = false;
// there has to be at least 1 character or we wouldn't be here
switch (text.charAt(pos++)) {
case '$':
if (valuelen == 1) return false;
while (pos < valuelen) {
char c = text.charAt(pos++);
if (! isDecimalDigit(c)) return false;
}
return true;
case 'f':
if (valuelen == 5 // 'f'
&& text.charAt(pos++) == 'a'
&& text.charAt(pos++) == 'l'
&& text.charAt(pos++) == 's'
&& text.charAt(pos++) == 'e'
) {
keyword = true;
}
break;
case 'n':
if (valuelen == 4 // 'n'
&& text.charAt(pos++) == 'u'
&& text.charAt(pos++) == 'l'
&& text.charAt(pos++) == 'l'
) {
keyword = true;
}
else if (valuelen == 3 // 'n'
&& text.charAt(pos++) == 'a'
&& text.charAt(pos++) == 'n'
) {
keyword = true;
}
break;
case 't':
if (valuelen == 4 // 't'
&& text.charAt(pos++) == 'r'
&& text.charAt(pos++) == 'u'
&& text.charAt(pos++) == 'e'
) {
keyword = true;
}
break;
}
return keyword;
} | class class_name[name] begin[{]
method[isIdentifierKeyword, return_type[type[boolean]], modifier[public static], parameter[text]] begin[{]
local_variable[type[int], pos]
local_variable[type[int], valuelen]
if[binary_operation[member[.valuelen], ==, literal[0]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
local_variable[type[boolean], keyword]
SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='$')], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=valuelen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isDecimalDigit, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))]), condition=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=valuelen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f')], statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=valuelen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator===), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='l'), operator===), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='s'), operator===), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='e'), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='n')], statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=valuelen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='u'), operator===), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='l'), operator===), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='l'), operator===), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=valuelen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator===), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='n'), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='t')], statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=valuelen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='r'), operator===), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='u'), operator===), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='e'), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), label=None)
return[member[.keyword]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isIdentifierKeyword] operator[SEP] identifier[CharSequence] identifier[text] operator[SEP] {
Keyword[int] identifier[pos] operator[=] Other[0] operator[SEP] Keyword[int] identifier[valuelen] operator[=] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[valuelen] operator[==] Other[0] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[boolean] identifier[keyword] operator[=] literal[boolean] operator[SEP] Keyword[switch] operator[SEP] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[SEP] {
Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[valuelen] operator[==] Other[1] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[while] operator[SEP] identifier[pos] operator[<] identifier[valuelen] operator[SEP] {
Keyword[char] identifier[c] operator[=] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isDecimalDigit] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[valuelen] operator[==] Other[5] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[==] literal[String] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[==] literal[String] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[==] literal[String] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[keyword] operator[=] literal[boolean] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[valuelen] operator[==] Other[4] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[==] literal[String] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[==] literal[String] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[keyword] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[valuelen] operator[==] Other[3] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[==] literal[String] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[keyword] operator[=] literal[boolean] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[valuelen] operator[==] Other[4] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[==] literal[String] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[==] literal[String] operator[&&] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[keyword] operator[=] literal[boolean] operator[SEP]
}
Keyword[break] operator[SEP]
}
Keyword[return] identifier[keyword] operator[SEP]
}
|
public boolean isAssigned()
{
boolean ret = false;
try {
ret = hasChildPerson(Context.getThreadContext().getPerson());
} catch (final EFapsException e) {
AbstractUserObject.LOG.error("could not read Person ", e);
}
return ret;
} | class class_name[name] begin[{]
method[isAssigned, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
local_variable[type[boolean], ret]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getThreadContext, postfix_operators=[], prefix_operators=[], qualifier=Context, selectors=[MethodInvocation(arguments=[], member=getPerson, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=hasChildPerson, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="could not read Person "), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=AbstractUserObject.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)
return[member[.ret]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isAssigned] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[ret] operator[=] literal[boolean] operator[SEP] Keyword[try] {
identifier[ret] operator[=] identifier[hasChildPerson] operator[SEP] identifier[Context] operator[SEP] identifier[getThreadContext] operator[SEP] operator[SEP] operator[SEP] identifier[getPerson] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[EFapsException] identifier[e] operator[SEP] {
identifier[AbstractUserObject] operator[SEP] identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ret] operator[SEP]
}
|
public static Set<String> findPrefixesForMandatoryImportedVariables( Instance instance ) {
Set<String> result = new HashSet<> ();
for( ImportedVariable var : ComponentHelpers.findAllImportedVariables( instance.getComponent()).values()) {
if( ! var.isOptional())
result.add( VariableHelpers.parseVariableName( var.getName()).getKey());
}
return result;
} | class class_name[name] begin[{]
method[findPrefixesForMandatoryImportedVariables, return_type[type[Set]], modifier[public static], parameter[instance]] begin[{]
local_variable[type[Set], result]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isOptional, postfix_operators=[], prefix_operators=['!'], qualifier=var, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=var, selectors=[], type_arguments=None)], member=parseVariableName, postfix_operators=[], prefix_operators=[], qualifier=VariableHelpers, selectors=[MethodInvocation(arguments=[], member=getKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getComponent, postfix_operators=[], prefix_operators=[], qualifier=instance, selectors=[], type_arguments=None)], member=findAllImportedVariables, postfix_operators=[], prefix_operators=[], qualifier=ComponentHelpers, selectors=[MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=var)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ImportedVariable, sub_type=None))), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Set] operator[<] identifier[String] operator[>] identifier[findPrefixesForMandatoryImportedVariables] operator[SEP] identifier[Instance] identifier[instance] operator[SEP] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[result] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ImportedVariable] identifier[var] operator[:] identifier[ComponentHelpers] operator[SEP] identifier[findAllImportedVariables] operator[SEP] identifier[instance] operator[SEP] identifier[getComponent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[var] operator[SEP] identifier[isOptional] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[VariableHelpers] operator[SEP] identifier[parseVariableName] operator[SEP] identifier[var] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
private Element writeCoordTransform(CoordinateTransform ct) {
Element ctElem = new Element("coordTransform");
ctElem.setAttribute("name", ct.getName());
ctElem.setAttribute("transformType", ct.getTransformType().toString());
for (Parameter param : ct.getParameters()) {
Element pElem = new Element("parameter");
pElem.setAttribute("name", param.getName());
pElem.setAttribute("value", param.getStringValue());
ctElem.addContent(pElem);
}
return ctElem;
} | class class_name[name] begin[{]
method[writeCoordTransform, return_type[type[Element]], modifier[private], parameter[ct]] begin[{]
local_variable[type[Element], ctElem]
call[ctElem.setAttribute, parameter[literal["name"], call[ct.getName, parameter[]]]]
call[ctElem.setAttribute, parameter[literal["transformType"], call[ct.getTransformType, parameter[]]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="parameter")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Element, sub_type=None)), name=pElem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=pElem, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value"), MethodInvocation(arguments=[], member=getStringValue, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=pElem, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pElem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addContent, postfix_operators=[], prefix_operators=[], qualifier=ctElem, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getParameters, postfix_operators=[], prefix_operators=[], qualifier=ct, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=param)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Parameter, sub_type=None))), label=None)
return[member[.ctElem]]
end[}]
END[}] | Keyword[private] identifier[Element] identifier[writeCoordTransform] operator[SEP] identifier[CoordinateTransform] identifier[ct] operator[SEP] {
identifier[Element] identifier[ctElem] operator[=] Keyword[new] identifier[Element] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ctElem] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[ct] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ctElem] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[ct] operator[SEP] identifier[getTransformType] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Parameter] identifier[param] operator[:] identifier[ct] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] {
identifier[Element] identifier[pElem] operator[=] Keyword[new] identifier[Element] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[pElem] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[param] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pElem] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[param] operator[SEP] identifier[getStringValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ctElem] operator[SEP] identifier[addContent] operator[SEP] identifier[pElem] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ctElem] operator[SEP]
}
|
public void setRtfDocument(RtfDocument doc) {
this.document = doc;
if(document != null) {
this.fontNumber = document.getDocumentHeader().getFontNumber(this);
}
if(this.color != null) {
this.color.setRtfDocument(this.document);
}
} | class class_name[name] begin[{]
method[setRtfDocument, return_type[void], modifier[public], parameter[doc]] begin[{]
assign[THIS[member[None.document]], member[.doc]]
if[binary_operation[member[.document], !=, literal[null]]] begin[{]
assign[THIS[member[None.fontNumber]], call[document.getDocumentHeader, parameter[]]]
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.color]], !=, literal[null]]] begin[{]
THIS[member[None.color]call[None.setRtfDocument, parameter[THIS[member[None.document]]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setRtfDocument] operator[SEP] identifier[RtfDocument] identifier[doc] operator[SEP] {
Keyword[this] operator[SEP] identifier[document] operator[=] identifier[doc] operator[SEP] Keyword[if] operator[SEP] identifier[document] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[fontNumber] operator[=] identifier[document] operator[SEP] identifier[getDocumentHeader] operator[SEP] operator[SEP] operator[SEP] identifier[getFontNumber] operator[SEP] Keyword[this] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[color] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[color] operator[SEP] identifier[setRtfDocument] operator[SEP] Keyword[this] operator[SEP] identifier[document] operator[SEP] operator[SEP]
}
}
|
@SuppressWarnings({"WeakerAccess", "unused", "SameParameterValue"}) // For library users
public boolean hasFacetRefinement(@NonNull String attribute, @NonNull String value) {
List<String> attributeRefinements = refinementMap.get(attribute);
return attributeRefinements != null && attributeRefinements.contains(value);
} | class class_name[name] begin[{]
method[hasFacetRefinement, return_type[type[boolean]], modifier[public], parameter[attribute, value]] begin[{]
local_variable[type[List], attributeRefinements]
return[binary_operation[binary_operation[member[.attributeRefinements], !=, literal[null]], &&, call[attributeRefinements.contains, parameter[member[.value]]]]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String] , literal[String] , literal[String]
} operator[SEP] Keyword[public] Keyword[boolean] identifier[hasFacetRefinement] operator[SEP] annotation[@] identifier[NonNull] identifier[String] identifier[attribute] , annotation[@] identifier[NonNull] identifier[String] identifier[value] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[attributeRefinements] operator[=] identifier[refinementMap] operator[SEP] identifier[get] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] Keyword[return] identifier[attributeRefinements] operator[!=] Other[null] operator[&&] identifier[attributeRefinements] operator[SEP] identifier[contains] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
|
@Override
public int getStartLevel() {
int result = _startLevel.get();
if (result == -1) {
result = ProvisionerConstants.LEVEL_FEATURE_CONTAINERS;
// Directive names are in the attributes map, but end with a colon
String phase = _rawAttributes.get("start-phase:");
result = setStartLevel(phase, result);
if (!!!_startLevel.compareAndSet(-1, result)) {
result = _startLevel.get();
}
}
return result;
} | class class_name[name] begin[{]
method[getStartLevel, return_type[type[int]], modifier[public], parameter[]] begin[{]
local_variable[type[int], result]
if[binary_operation[member[.result], ==, literal[1]]] begin[{]
assign[member[.result], member[ProvisionerConstants.LEVEL_FEATURE_CONTAINERS]]
local_variable[type[String], phase]
assign[member[.result], call[.setStartLevel, parameter[member[.phase], member[.result]]]]
if[call[_startLevel.compareAndSet, parameter[literal[1], member[.result]]]] begin[{]
assign[member[.result], call[_startLevel.get, parameter[]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[getStartLevel] operator[SEP] operator[SEP] {
Keyword[int] identifier[result] operator[=] identifier[_startLevel] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] operator[-] Other[1] operator[SEP] {
identifier[result] operator[=] identifier[ProvisionerConstants] operator[SEP] identifier[LEVEL_FEATURE_CONTAINERS] operator[SEP] identifier[String] identifier[phase] operator[=] identifier[_rawAttributes] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[setStartLevel] operator[SEP] identifier[phase] , identifier[result] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[!] operator[!] identifier[_startLevel] operator[SEP] identifier[compareAndSet] operator[SEP] operator[-] Other[1] , identifier[result] operator[SEP] operator[SEP] {
identifier[result] operator[=] identifier[_startLevel] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
public void pushDefaultReturnValueToStack(Type type) {
if (type.equals(Type.BOOLEAN_TYPE)) {
push(false);
} else if (type.equals(Type.INT_TYPE) || type.equals(Type.SHORT_TYPE) || type.equals(Type.BYTE_TYPE) || type.equals(Type.CHAR_TYPE)) {
push(0);
} else if (type.equals(Type.LONG_TYPE)) {
push(0L);
} else if (type.equals(Type.FLOAT_TYPE)) {
push(0f);
} else if (type.equals(Type.DOUBLE_TYPE)) {
push(0d);
} else if (type.getSort() == ARRAY || type.getSort() == OBJECT) {
loadNull();
}
} | class class_name[name] begin[{]
method[pushDefaultReturnValueToStack, return_type[void], modifier[public], parameter[type]] begin[{]
if[call[type.equals, parameter[member[Type.BOOLEAN_TYPE]]]] begin[{]
call[.push, parameter[literal[false]]]
else begin[{]
if[binary_operation[binary_operation[binary_operation[call[type.equals, parameter[member[Type.INT_TYPE]]], ||, call[type.equals, parameter[member[Type.SHORT_TYPE]]]], ||, call[type.equals, parameter[member[Type.BYTE_TYPE]]]], ||, call[type.equals, parameter[member[Type.CHAR_TYPE]]]]] begin[{]
call[.push, parameter[literal[0]]]
else begin[{]
if[call[type.equals, parameter[member[Type.LONG_TYPE]]]] begin[{]
call[.push, parameter[literal[0L]]]
else begin[{]
if[call[type.equals, parameter[member[Type.FLOAT_TYPE]]]] begin[{]
call[.push, parameter[literal[0f]]]
else begin[{]
if[call[type.equals, parameter[member[Type.DOUBLE_TYPE]]]] begin[{]
call[.push, parameter[literal[0d]]]
else begin[{]
if[binary_operation[binary_operation[call[type.getSort, parameter[]], ==, member[.ARRAY]], ||, binary_operation[call[type.getSort, parameter[]], ==, member[.OBJECT]]]] begin[{]
call[.loadNull, parameter[]]
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[pushDefaultReturnValueToStack] operator[SEP] identifier[Type] identifier[type] operator[SEP] {
Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[Type] operator[SEP] identifier[BOOLEAN_TYPE] operator[SEP] operator[SEP] {
identifier[push] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[Type] operator[SEP] identifier[INT_TYPE] operator[SEP] operator[||] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[Type] operator[SEP] identifier[SHORT_TYPE] operator[SEP] operator[||] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[Type] operator[SEP] identifier[BYTE_TYPE] operator[SEP] operator[||] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[Type] operator[SEP] identifier[CHAR_TYPE] operator[SEP] operator[SEP] {
identifier[push] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[Type] operator[SEP] identifier[LONG_TYPE] operator[SEP] operator[SEP] {
identifier[push] operator[SEP] Other[0L] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[Type] operator[SEP] identifier[FLOAT_TYPE] operator[SEP] operator[SEP] {
identifier[push] operator[SEP] literal[Float] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[Type] operator[SEP] identifier[DOUBLE_TYPE] operator[SEP] operator[SEP] {
identifier[push] operator[SEP] literal[Float] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[getSort] operator[SEP] operator[SEP] operator[==] identifier[ARRAY] operator[||] identifier[type] operator[SEP] identifier[getSort] operator[SEP] operator[SEP] operator[==] identifier[OBJECT] operator[SEP] {
identifier[loadNull] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Override
public RandomVariableInterface getNumeraire(double time) throws CalculationException {
int timeIndex = getLiborPeriodIndex(time);
if(timeIndex < 0) {
// Interpolation of Numeraire: log linear interpolation.
int upperIndex = -timeIndex-1;
int lowerIndex = upperIndex-1;
if(lowerIndex < 0) {
throw new IllegalArgumentException("Numeraire requested for time " + time + ". Unsupported");
}
double alpha = (time-getLiborPeriod(lowerIndex)) / (getLiborPeriod(upperIndex) - getLiborPeriod(lowerIndex));
RandomVariableInterface numeraire = getNumeraire(getLiborPeriod(upperIndex)).log().mult(alpha).add(getNumeraire(getLiborPeriod(lowerIndex)).log().mult(1.0-alpha)).exp();
/*
* Adjust for discounting, i.e. funding or collateralization
*/
if(discountCurve != null) {
// This includes a control for zero bonds
double deterministicNumeraireAdjustment = numeraire.invert().getAverage() / discountCurve.getDiscountFactor(curveModel, time);
numeraire = numeraire.mult(deterministicNumeraireAdjustment);
}
return numeraire;
}
/*
* Calculate the numeraire, when time is part of liborPeriodDiscretization
*/
/*
* Check if numeraire cache is valid (i.e. process did not change)
*/
if(getProcess() != numerairesProcess) {
numeraires.clear();
numerairesProcess = getProcess();
}
/*
* Check if numeraire is part of the cache
*/
RandomVariableInterface numeraire = numeraires.get(timeIndex);
if(numeraire == null) {
/*
* Calculate the numeraire for timeIndex
*/
// Initialize to 1.0
numeraire = getRandomVariableForConstant(1.0);
// Get the start and end of the product
int firstLiborIndex, lastLiborIndex;
if(measure == Measure.TERMINAL) {
firstLiborIndex = getLiborPeriodIndex(time);
if(firstLiborIndex < 0) {
throw new CalculationException("Simulation time discretization not part of forward rate tenor discretization.");
}
lastLiborIndex = liborPeriodDiscretization.getNumberOfTimeSteps()-1;
}
else if(measure == Measure.SPOT) {
// Spot measure
firstLiborIndex = 0;
lastLiborIndex = getLiborPeriodIndex(time)-1;
}
else {
throw new CalculationException("Numeraire not implemented for specified measure.");
}
// The product
for(int liborIndex = firstLiborIndex; liborIndex<=lastLiborIndex; liborIndex++) {
RandomVariableInterface libor = getLIBOR(getTimeIndex(Math.min(time,liborPeriodDiscretization.getTime(liborIndex))), liborIndex);
double periodLength = liborPeriodDiscretization.getTimeStep(liborIndex);
if(measure == Measure.SPOT) {
numeraire = numeraire.accrue(libor, periodLength);
}
else {
numeraire = numeraire.discount(libor, periodLength);
}
}
numeraires.put(timeIndex, numeraire);
}
/*
* Adjust for discounting, i.e. funding or collateralization
*/
if(discountCurve != null) {
// This includes a control for zero bonds
double deterministicNumeraireAdjustment = numeraire.invert().getAverage() / discountCurve.getDiscountFactor(curveModel, time);
numeraire = numeraire.mult(deterministicNumeraireAdjustment);
}
return numeraire;
} | class class_name[name] begin[{]
method[getNumeraire, return_type[type[RandomVariableInterface]], modifier[public], parameter[time]] begin[{]
local_variable[type[int], timeIndex]
if[binary_operation[member[.timeIndex], <, literal[0]]] begin[{]
local_variable[type[int], upperIndex]
local_variable[type[int], lowerIndex]
if[binary_operation[member[.lowerIndex], <, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Numeraire requested for time "), operandr=MemberReference(member=time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". Unsupported"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[double], alpha]
local_variable[type[RandomVariableInterface], numeraire]
if[binary_operation[member[.discountCurve], !=, literal[null]]] begin[{]
local_variable[type[double], deterministicNumeraireAdjustment]
assign[member[.numeraire], call[numeraire.mult, parameter[member[.deterministicNumeraireAdjustment]]]]
else begin[{]
None
end[}]
return[member[.numeraire]]
else begin[{]
None
end[}]
if[binary_operation[call[.getProcess, parameter[]], !=, member[.numerairesProcess]]] begin[{]
call[numeraires.clear, parameter[]]
assign[member[.numerairesProcess], call[.getProcess, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[RandomVariableInterface], numeraire]
if[binary_operation[member[.numeraire], ==, literal[null]]] begin[{]
assign[member[.numeraire], call[.getRandomVariableForConstant, parameter[literal[1.0]]]]
local_variable[type[int], firstLiborIndex]
if[binary_operation[member[.measure], ==, member[Measure.TERMINAL]]] begin[{]
assign[member[.firstLiborIndex], call[.getLiborPeriodIndex, parameter[member[.time]]]]
if[binary_operation[member[.firstLiborIndex], <, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Simulation time discretization not part of forward rate tenor discretization.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CalculationException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.lastLiborIndex], binary_operation[call[liborPeriodDiscretization.getNumberOfTimeSteps, parameter[]], -, literal[1]]]
else begin[{]
if[binary_operation[member[.measure], ==, member[Measure.SPOT]]] begin[{]
assign[member[.firstLiborIndex], literal[0]]
assign[member[.lastLiborIndex], binary_operation[call[.getLiborPeriodIndex, parameter[member[.time]]], -, literal[1]]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Numeraire not implemented for specified measure.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CalculationException, sub_type=None)), label=None)
end[}]
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=liborIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=liborPeriodDiscretization, selectors=[], type_arguments=None)], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)], member=getTimeIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=liborIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLIBOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=libor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RandomVariableInterface, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=liborIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTimeStep, postfix_operators=[], prefix_operators=[], qualifier=liborPeriodDiscretization, selectors=[], type_arguments=None), name=periodLength)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=measure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SPOT, postfix_operators=[], prefix_operators=[], qualifier=Measure, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=numeraire, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=libor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=periodLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=discount, postfix_operators=[], prefix_operators=[], qualifier=numeraire, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=numeraire, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=libor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=periodLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=accrue, postfix_operators=[], prefix_operators=[], qualifier=numeraire, selectors=[], type_arguments=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=liborIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=lastLiborIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=firstLiborIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=liborIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=liborIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[numeraires.put, parameter[member[.timeIndex], member[.numeraire]]]
else begin[{]
None
end[}]
if[binary_operation[member[.discountCurve], !=, literal[null]]] begin[{]
local_variable[type[double], deterministicNumeraireAdjustment]
assign[member[.numeraire], call[numeraire.mult, parameter[member[.deterministicNumeraireAdjustment]]]]
else begin[{]
None
end[}]
return[member[.numeraire]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[RandomVariableInterface] identifier[getNumeraire] operator[SEP] Keyword[double] identifier[time] operator[SEP] Keyword[throws] identifier[CalculationException] {
Keyword[int] identifier[timeIndex] operator[=] identifier[getLiborPeriodIndex] operator[SEP] identifier[time] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[timeIndex] operator[<] Other[0] operator[SEP] {
Keyword[int] identifier[upperIndex] operator[=] operator[-] identifier[timeIndex] operator[-] Other[1] operator[SEP] Keyword[int] identifier[lowerIndex] operator[=] identifier[upperIndex] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[lowerIndex] operator[<] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[time] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[double] identifier[alpha] operator[=] operator[SEP] identifier[time] operator[-] identifier[getLiborPeriod] operator[SEP] identifier[lowerIndex] operator[SEP] operator[SEP] operator[/] operator[SEP] identifier[getLiborPeriod] operator[SEP] identifier[upperIndex] operator[SEP] operator[-] identifier[getLiborPeriod] operator[SEP] identifier[lowerIndex] operator[SEP] operator[SEP] operator[SEP] identifier[RandomVariableInterface] identifier[numeraire] operator[=] identifier[getNumeraire] operator[SEP] identifier[getLiborPeriod] operator[SEP] identifier[upperIndex] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] operator[SEP] operator[SEP] identifier[mult] operator[SEP] identifier[alpha] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[getNumeraire] operator[SEP] identifier[getLiborPeriod] operator[SEP] identifier[lowerIndex] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] operator[SEP] operator[SEP] identifier[mult] operator[SEP] literal[Float] operator[-] identifier[alpha] operator[SEP] operator[SEP] operator[SEP] identifier[exp] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[discountCurve] operator[!=] Other[null] operator[SEP] {
Keyword[double] identifier[deterministicNumeraireAdjustment] operator[=] identifier[numeraire] operator[SEP] identifier[invert] operator[SEP] operator[SEP] operator[SEP] identifier[getAverage] operator[SEP] operator[SEP] operator[/] identifier[discountCurve] operator[SEP] identifier[getDiscountFactor] operator[SEP] identifier[curveModel] , identifier[time] operator[SEP] operator[SEP] identifier[numeraire] operator[=] identifier[numeraire] operator[SEP] identifier[mult] operator[SEP] identifier[deterministicNumeraireAdjustment] operator[SEP] operator[SEP]
}
Keyword[return] identifier[numeraire] operator[SEP]
}
Keyword[if] operator[SEP] identifier[getProcess] operator[SEP] operator[SEP] operator[!=] identifier[numerairesProcess] operator[SEP] {
identifier[numeraires] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[numerairesProcess] operator[=] identifier[getProcess] operator[SEP] operator[SEP] operator[SEP]
}
identifier[RandomVariableInterface] identifier[numeraire] operator[=] identifier[numeraires] operator[SEP] identifier[get] operator[SEP] identifier[timeIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[numeraire] operator[==] Other[null] operator[SEP] {
identifier[numeraire] operator[=] identifier[getRandomVariableForConstant] operator[SEP] literal[Float] operator[SEP] operator[SEP] Keyword[int] identifier[firstLiborIndex] , identifier[lastLiborIndex] operator[SEP] Keyword[if] operator[SEP] identifier[measure] operator[==] identifier[Measure] operator[SEP] identifier[TERMINAL] operator[SEP] {
identifier[firstLiborIndex] operator[=] identifier[getLiborPeriodIndex] operator[SEP] identifier[time] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[firstLiborIndex] operator[<] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CalculationException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[lastLiborIndex] operator[=] identifier[liborPeriodDiscretization] operator[SEP] identifier[getNumberOfTimeSteps] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[measure] operator[==] identifier[Measure] operator[SEP] identifier[SPOT] operator[SEP] {
identifier[firstLiborIndex] operator[=] Other[0] operator[SEP] identifier[lastLiborIndex] operator[=] identifier[getLiborPeriodIndex] operator[SEP] identifier[time] operator[SEP] operator[-] Other[1] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[CalculationException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[liborIndex] operator[=] identifier[firstLiborIndex] operator[SEP] identifier[liborIndex] operator[<=] identifier[lastLiborIndex] operator[SEP] identifier[liborIndex] operator[++] operator[SEP] {
identifier[RandomVariableInterface] identifier[libor] operator[=] identifier[getLIBOR] operator[SEP] identifier[getTimeIndex] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[time] , identifier[liborPeriodDiscretization] operator[SEP] identifier[getTime] operator[SEP] identifier[liborIndex] operator[SEP] operator[SEP] operator[SEP] , identifier[liborIndex] operator[SEP] operator[SEP] Keyword[double] identifier[periodLength] operator[=] identifier[liborPeriodDiscretization] operator[SEP] identifier[getTimeStep] operator[SEP] identifier[liborIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[measure] operator[==] identifier[Measure] operator[SEP] identifier[SPOT] operator[SEP] {
identifier[numeraire] operator[=] identifier[numeraire] operator[SEP] identifier[accrue] operator[SEP] identifier[libor] , identifier[periodLength] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[numeraire] operator[=] identifier[numeraire] operator[SEP] identifier[discount] operator[SEP] identifier[libor] , identifier[periodLength] operator[SEP] operator[SEP]
}
}
identifier[numeraires] operator[SEP] identifier[put] operator[SEP] identifier[timeIndex] , identifier[numeraire] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[discountCurve] operator[!=] Other[null] operator[SEP] {
Keyword[double] identifier[deterministicNumeraireAdjustment] operator[=] identifier[numeraire] operator[SEP] identifier[invert] operator[SEP] operator[SEP] operator[SEP] identifier[getAverage] operator[SEP] operator[SEP] operator[/] identifier[discountCurve] operator[SEP] identifier[getDiscountFactor] operator[SEP] identifier[curveModel] , identifier[time] operator[SEP] operator[SEP] identifier[numeraire] operator[=] identifier[numeraire] operator[SEP] identifier[mult] operator[SEP] identifier[deterministicNumeraireAdjustment] operator[SEP] operator[SEP]
}
Keyword[return] identifier[numeraire] operator[SEP]
}
|
protected int indexOf(final Object o) {
final int size = dataModel.getSize();
for (int i = 0; i < size; i++) {
if (comparator == null) {
if (o.equals(dataModel.getElementAt(i))) {
return i;
}
} else if (comparator.compare(o, dataModel.getElementAt(i)) == 0) {
return i;
}
}
return -1;
} | class class_name[name] begin[{]
method[indexOf, return_type[type[int]], modifier[protected], parameter[o]] begin[{]
local_variable[type[int], size]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=comparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getElementAt, postfix_operators=[], prefix_operators=[], qualifier=dataModel, selectors=[], type_arguments=None)], member=compare, postfix_operators=[], prefix_operators=[], qualifier=comparator, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getElementAt, postfix_operators=[], prefix_operators=[], qualifier=dataModel, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=o, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[1]]
end[}]
END[}] | Keyword[protected] Keyword[int] identifier[indexOf] operator[SEP] Keyword[final] identifier[Object] identifier[o] operator[SEP] {
Keyword[final] Keyword[int] identifier[size] operator[=] identifier[dataModel] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[comparator] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[o] operator[SEP] identifier[equals] operator[SEP] identifier[dataModel] operator[SEP] identifier[getElementAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[i] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[comparator] operator[SEP] identifier[compare] operator[SEP] identifier[o] , identifier[dataModel] operator[SEP] identifier[getElementAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[return] identifier[i] operator[SEP]
}
}
Keyword[return] operator[-] Other[1] operator[SEP]
}
|
public void marshall(DescribeInterconnectLoaRequest describeInterconnectLoaRequest, ProtocolMarshaller protocolMarshaller) {
if (describeInterconnectLoaRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(describeInterconnectLoaRequest.getInterconnectId(), INTERCONNECTID_BINDING);
protocolMarshaller.marshall(describeInterconnectLoaRequest.getProviderName(), PROVIDERNAME_BINDING);
protocolMarshaller.marshall(describeInterconnectLoaRequest.getLoaContentType(), LOACONTENTTYPE_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} | class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[describeInterconnectLoaRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.describeInterconnectLoaRequest], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getInterconnectId, postfix_operators=[], prefix_operators=[], qualifier=describeInterconnectLoaRequest, selectors=[], type_arguments=None), MemberReference(member=INTERCONNECTID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProviderName, postfix_operators=[], prefix_operators=[], qualifier=describeInterconnectLoaRequest, selectors=[], type_arguments=None), MemberReference(member=PROVIDERNAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLoaContentType, postfix_operators=[], prefix_operators=[], qualifier=describeInterconnectLoaRequest, selectors=[], type_arguments=None), MemberReference(member=LOACONTENTTYPE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[DescribeInterconnectLoaRequest] identifier[describeInterconnectLoaRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[describeInterconnectLoaRequest] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeInterconnectLoaRequest] operator[SEP] identifier[getInterconnectId] operator[SEP] operator[SEP] , identifier[INTERCONNECTID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeInterconnectLoaRequest] operator[SEP] identifier[getProviderName] operator[SEP] operator[SEP] , identifier[PROVIDERNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeInterconnectLoaRequest] operator[SEP] identifier[getLoaContentType] operator[SEP] operator[SEP] , identifier[LOACONTENTTYPE_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@POST
@Path("me")
@RolesAllowed({"ROLE_ADMIN", "ROLE_USER"})
public Response updateMe(@Context HttpServletRequest request,
@Context UriInfo uriInfo,
@Context SecurityContext securityContext,
DUser user) {
Long userId = (Long) request.getAttribute(OAuth2Filter.NAME_USER_ID);
if (null == user.getId()) {
user.setId(userId);
} else if (!user.getId().equals(userId)) {
throw new BadRequestRestException("User ids does not match");
}
return update(userId, uriInfo, securityContext, user);
} | class class_name[name] begin[{]
method[updateMe, return_type[type[Response]], modifier[public], parameter[request, uriInfo, securityContext, user]] begin[{]
local_variable[type[Long], userId]
if[binary_operation[literal[null], ==, call[user.getId, parameter[]]]] begin[{]
call[user.setId, parameter[member[.userId]]]
else begin[{]
if[call[user.getId, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="User ids does not match")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BadRequestRestException, sub_type=None)), label=None)
else begin[{]
None
end[}]
end[}]
return[call[.update, parameter[member[.userId], member[.uriInfo], member[.securityContext], member[.user]]]]
end[}]
END[}] | annotation[@] identifier[POST] annotation[@] identifier[Path] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[RolesAllowed] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] Keyword[public] identifier[Response] identifier[updateMe] operator[SEP] annotation[@] identifier[Context] identifier[HttpServletRequest] identifier[request] , annotation[@] identifier[Context] identifier[UriInfo] identifier[uriInfo] , annotation[@] identifier[Context] identifier[SecurityContext] identifier[securityContext] , identifier[DUser] identifier[user] operator[SEP] {
identifier[Long] identifier[userId] operator[=] operator[SEP] identifier[Long] operator[SEP] identifier[request] operator[SEP] identifier[getAttribute] operator[SEP] identifier[OAuth2Filter] operator[SEP] identifier[NAME_USER_ID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[user] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] {
identifier[user] operator[SEP] identifier[setId] operator[SEP] identifier[userId] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[user] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[userId] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[BadRequestRestException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[update] operator[SEP] identifier[userId] , identifier[uriInfo] , identifier[securityContext] , identifier[user] operator[SEP] operator[SEP]
}
|
protected Collection<String> getUserRoles(HttpServletRequest request) {
ArrayList<String> j2eeUserRolesList = new ArrayList<>();
for (String role : j2eeMappableRoles) {
if (request.isUserInRole(role)) {
j2eeUserRolesList.add(role);
}
}
return j2eeUserRolesList;
} | class class_name[name] begin[{]
method[getUserRoles, return_type[type[Collection]], modifier[protected], parameter[request]] begin[{]
local_variable[type[ArrayList], j2eeUserRolesList]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=role, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isUserInRole, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=role, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=j2eeUserRolesList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=j2eeMappableRoles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=role)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.j2eeUserRolesList]]
end[}]
END[}] | Keyword[protected] identifier[Collection] operator[<] identifier[String] operator[>] identifier[getUserRoles] operator[SEP] identifier[HttpServletRequest] identifier[request] operator[SEP] {
identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[j2eeUserRolesList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[role] operator[:] identifier[j2eeMappableRoles] operator[SEP] {
Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[isUserInRole] operator[SEP] identifier[role] operator[SEP] operator[SEP] {
identifier[j2eeUserRolesList] operator[SEP] identifier[add] operator[SEP] identifier[role] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[j2eeUserRolesList] operator[SEP]
}
|
public static PrefsTransform lookup(TypeName typeName) {
PrefsTransform transform = cache.get(typeName);
if (transform != null) {
return transform;
}
transform = getTransform(typeName);
AssertKripton.assertNotNull(transform, new UnsupportedFieldTypeException(typeName));
cache.put(typeName, transform);
return transform;
} | class class_name[name] begin[{]
method[lookup, return_type[type[PrefsTransform]], modifier[public static], parameter[typeName]] begin[{]
local_variable[type[PrefsTransform], transform]
if[binary_operation[member[.transform], !=, literal[null]]] begin[{]
return[member[.transform]]
else begin[{]
None
end[}]
assign[member[.transform], call[.getTransform, parameter[member[.typeName]]]]
call[AssertKripton.assertNotNull, parameter[member[.transform], ClassCreator(arguments=[MemberReference(member=typeName, 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=UnsupportedFieldTypeException, sub_type=None))]]
call[cache.put, parameter[member[.typeName], member[.transform]]]
return[member[.transform]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[PrefsTransform] identifier[lookup] operator[SEP] identifier[TypeName] identifier[typeName] operator[SEP] {
identifier[PrefsTransform] identifier[transform] operator[=] identifier[cache] operator[SEP] identifier[get] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[transform] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[transform] operator[SEP]
}
identifier[transform] operator[=] identifier[getTransform] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] identifier[AssertKripton] operator[SEP] identifier[assertNotNull] operator[SEP] identifier[transform] , Keyword[new] identifier[UnsupportedFieldTypeException] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[typeName] , identifier[transform] operator[SEP] operator[SEP] Keyword[return] identifier[transform] operator[SEP]
}
|
public static Date parseDate(String date, String pattern) {
try {
return org.apache.commons.lang.time.DateUtils.parseDate(date, new String[] {pattern});
} catch (ParseException e) {
return null;
}
} | class class_name[name] begin[{]
method[parseDate, return_type[type[Date]], modifier[public static], parameter[date, pattern]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=parseDate, postfix_operators=[], prefix_operators=[], qualifier=org.apache.commons.lang.time.DateUtils, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ParseException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Date] identifier[parseDate] operator[SEP] identifier[String] identifier[date] , identifier[String] identifier[pattern] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[commons] operator[SEP] identifier[lang] operator[SEP] identifier[time] operator[SEP] identifier[DateUtils] operator[SEP] identifier[parseDate] operator[SEP] identifier[date] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[pattern]
} operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ParseException] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
}
|
public void add(E element) throws IllegalStateException {
requireNonNull(element);
lock.lock();
try {
if (open) {
elements.addLast(element);
if (elements.size() == 1) {
nonEmpty.signalAll();
}
} else {
throw new IllegalStateException("queue is closed");
}
} finally {
lock.unlock();
}
} | class class_name[name] begin[{]
method[add, return_type[void], modifier[public], parameter[element]] begin[{]
call[.requireNonNull, parameter[member[.element]]]
call[lock.lock, parameter[]]
TryStatement(block=[IfStatement(condition=MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="queue is closed")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addLast, postfix_operators=[], prefix_operators=[], qualifier=elements, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=elements, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=signalAll, postfix_operators=[], prefix_operators=[], qualifier=nonEmpty, selectors=[], type_arguments=None), label=None)]))]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[add] operator[SEP] identifier[E] identifier[element] operator[SEP] Keyword[throws] identifier[IllegalStateException] {
identifier[requireNonNull] operator[SEP] identifier[element] operator[SEP] operator[SEP] identifier[lock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[open] operator[SEP] {
identifier[elements] operator[SEP] identifier[addLast] operator[SEP] identifier[element] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[elements] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[nonEmpty] operator[SEP] identifier[signalAll] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[finally] {
identifier[lock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public ExpressionBuilder greaterThan(final SubordinateTrigger trigger, final Object compare) {
BooleanExpression exp = new CompareExpression(CompareType.GREATER_THAN, trigger, compare);
appendExpression(exp);
return this;
} | class class_name[name] begin[{]
method[greaterThan, return_type[type[ExpressionBuilder]], modifier[public], parameter[trigger, compare]] begin[{]
local_variable[type[BooleanExpression], exp]
call[.appendExpression, parameter[member[.exp]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ExpressionBuilder] identifier[greaterThan] operator[SEP] Keyword[final] identifier[SubordinateTrigger] identifier[trigger] , Keyword[final] identifier[Object] identifier[compare] operator[SEP] {
identifier[BooleanExpression] identifier[exp] operator[=] Keyword[new] identifier[CompareExpression] operator[SEP] identifier[CompareType] operator[SEP] identifier[GREATER_THAN] , identifier[trigger] , identifier[compare] operator[SEP] operator[SEP] identifier[appendExpression] operator[SEP] identifier[exp] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public Observable<Void> moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
return moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[moveResourcesAsync, return_type[type[Observable]], modifier[public], parameter[sourceResourceGroupName, parameters]] begin[{]
return[call[.moveResourcesWithServiceResponseAsync, parameter[member[.sourceResourceGroupName], member[.parameters]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[Void] operator[>] identifier[moveResourcesAsync] operator[SEP] identifier[String] identifier[sourceResourceGroupName] , identifier[ResourcesMoveInfo] identifier[parameters] operator[SEP] {
Keyword[return] identifier[moveResourcesWithServiceResponseAsync] operator[SEP] identifier[sourceResourceGroupName] , identifier[parameters] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Void] operator[>] , identifier[Void] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Void] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Void] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
@Override
protected int writeBytesWireFormat ( byte[] dst, int dstIndex ) {
int start = dstIndex;
SMBUtil.writeInt2(57, dst, dstIndex);
dstIndex += 4;
SMBUtil.writeInt4(this.controlCode, dst, dstIndex);
dstIndex += 4;
System.arraycopy(this.fileId, 0, dst, dstIndex, 16);
dstIndex += 16;
int inputOffsetOffset = dstIndex;
dstIndex += 4;
int inputLengthOffset = dstIndex;
dstIndex += 4;
SMBUtil.writeInt4(this.maxInputResponse, dst, dstIndex);
dstIndex += 4;
int outputOffsetOffset = dstIndex;
dstIndex += 4;
int outputLengthOffset = dstIndex;
dstIndex += 4;
SMBUtil.writeInt4(this.maxOutputResponse, dst, dstIndex);
dstIndex += 4;
SMBUtil.writeInt4(this.flags, dst, dstIndex);
dstIndex += 4;
dstIndex += 4; // Reserved2
if ( this.inputData != null ) {
SMBUtil.writeInt4(dstIndex - getHeaderStart(), dst, inputOffsetOffset);
int len = this.inputData.encode(dst, dstIndex);
SMBUtil.writeInt4(len, dst, inputLengthOffset);
dstIndex += len;
}
else {
SMBUtil.writeInt4(0, dst, inputOffsetOffset);
SMBUtil.writeInt4(0, dst, inputLengthOffset);
}
if ( this.outputData != null ) {
SMBUtil.writeInt4(dstIndex - getHeaderStart(), dst, outputOffsetOffset);
int len = this.outputData.encode(dst, dstIndex);
SMBUtil.writeInt4(len, dst, outputLengthOffset);
dstIndex += len;
}
else {
SMBUtil.writeInt4(0, dst, outputOffsetOffset);
SMBUtil.writeInt4(0, dst, outputLengthOffset);
}
return dstIndex - start;
} | class class_name[name] begin[{]
method[writeBytesWireFormat, return_type[type[int]], modifier[protected], parameter[dst, dstIndex]] begin[{]
local_variable[type[int], start]
call[SMBUtil.writeInt2, parameter[literal[57], member[.dst], member[.dstIndex]]]
assign[member[.dstIndex], literal[4]]
call[SMBUtil.writeInt4, parameter[THIS[member[None.controlCode]], member[.dst], member[.dstIndex]]]
assign[member[.dstIndex], literal[4]]
call[System.arraycopy, parameter[THIS[member[None.fileId]], literal[0], member[.dst], member[.dstIndex], literal[16]]]
assign[member[.dstIndex], literal[16]]
local_variable[type[int], inputOffsetOffset]
assign[member[.dstIndex], literal[4]]
local_variable[type[int], inputLengthOffset]
assign[member[.dstIndex], literal[4]]
call[SMBUtil.writeInt4, parameter[THIS[member[None.maxInputResponse]], member[.dst], member[.dstIndex]]]
assign[member[.dstIndex], literal[4]]
local_variable[type[int], outputOffsetOffset]
assign[member[.dstIndex], literal[4]]
local_variable[type[int], outputLengthOffset]
assign[member[.dstIndex], literal[4]]
call[SMBUtil.writeInt4, parameter[THIS[member[None.maxOutputResponse]], member[.dst], member[.dstIndex]]]
assign[member[.dstIndex], literal[4]]
call[SMBUtil.writeInt4, parameter[THIS[member[None.flags]], member[.dst], member[.dstIndex]]]
assign[member[.dstIndex], literal[4]]
assign[member[.dstIndex], literal[4]]
if[binary_operation[THIS[member[None.inputData]], !=, literal[null]]] begin[{]
call[SMBUtil.writeInt4, parameter[binary_operation[member[.dstIndex], -, call[.getHeaderStart, parameter[]]], member[.dst], member[.inputOffsetOffset]]]
local_variable[type[int], len]
call[SMBUtil.writeInt4, parameter[member[.len], member[.dst], member[.inputLengthOffset]]]
assign[member[.dstIndex], member[.len]]
else begin[{]
call[SMBUtil.writeInt4, parameter[literal[0], member[.dst], member[.inputOffsetOffset]]]
call[SMBUtil.writeInt4, parameter[literal[0], member[.dst], member[.inputLengthOffset]]]
end[}]
if[binary_operation[THIS[member[None.outputData]], !=, literal[null]]] begin[{]
call[SMBUtil.writeInt4, parameter[binary_operation[member[.dstIndex], -, call[.getHeaderStart, parameter[]]], member[.dst], member[.outputOffsetOffset]]]
local_variable[type[int], len]
call[SMBUtil.writeInt4, parameter[member[.len], member[.dst], member[.outputLengthOffset]]]
assign[member[.dstIndex], member[.len]]
else begin[{]
call[SMBUtil.writeInt4, parameter[literal[0], member[.dst], member[.outputOffsetOffset]]]
call[SMBUtil.writeInt4, parameter[literal[0], member[.dst], member[.outputLengthOffset]]]
end[}]
return[binary_operation[member[.dstIndex], -, member[.start]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[int] identifier[writeBytesWireFormat] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[dst] , Keyword[int] identifier[dstIndex] operator[SEP] {
Keyword[int] identifier[start] operator[=] identifier[dstIndex] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt2] operator[SEP] Other[57] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] Keyword[this] operator[SEP] identifier[controlCode] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] Keyword[this] operator[SEP] identifier[fileId] , Other[0] , identifier[dst] , identifier[dstIndex] , Other[16] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[16] operator[SEP] Keyword[int] identifier[inputOffsetOffset] operator[=] identifier[dstIndex] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] Keyword[int] identifier[inputLengthOffset] operator[=] identifier[dstIndex] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] Keyword[this] operator[SEP] identifier[maxInputResponse] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] Keyword[int] identifier[outputOffsetOffset] operator[=] identifier[dstIndex] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] Keyword[int] identifier[outputLengthOffset] operator[=] identifier[dstIndex] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] Keyword[this] operator[SEP] identifier[maxOutputResponse] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] Keyword[this] operator[SEP] identifier[flags] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[inputData] operator[!=] Other[null] operator[SEP] {
identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] identifier[dstIndex] operator[-] identifier[getHeaderStart] operator[SEP] operator[SEP] , identifier[dst] , identifier[inputOffsetOffset] operator[SEP] operator[SEP] Keyword[int] identifier[len] operator[=] Keyword[this] operator[SEP] identifier[inputData] operator[SEP] identifier[encode] operator[SEP] identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] identifier[len] , identifier[dst] , identifier[inputLengthOffset] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] identifier[len] operator[SEP]
}
Keyword[else] {
identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] Other[0] , identifier[dst] , identifier[inputOffsetOffset] operator[SEP] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] Other[0] , identifier[dst] , identifier[inputLengthOffset] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[outputData] operator[!=] Other[null] operator[SEP] {
identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] identifier[dstIndex] operator[-] identifier[getHeaderStart] operator[SEP] operator[SEP] , identifier[dst] , identifier[outputOffsetOffset] operator[SEP] operator[SEP] Keyword[int] identifier[len] operator[=] Keyword[this] operator[SEP] identifier[outputData] operator[SEP] identifier[encode] operator[SEP] identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] identifier[len] , identifier[dst] , identifier[outputLengthOffset] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] identifier[len] operator[SEP]
}
Keyword[else] {
identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] Other[0] , identifier[dst] , identifier[outputOffsetOffset] operator[SEP] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] Other[0] , identifier[dst] , identifier[outputLengthOffset] operator[SEP] operator[SEP]
}
Keyword[return] identifier[dstIndex] operator[-] identifier[start] operator[SEP]
}
|
public static <T> List<T[]> divideArray(T[] arr, Integer... cuts) {
Arrays.sort(cuts);
int c = cuts.length;
if (cuts[0] < 0 || cuts[c - 1] > arr.length - 1)
throw new IllegalArgumentException("cut position out of bounds.");
int startIndex = cuts[0] == 0 ? 1 : 0;
if (cuts[c - 1] != arr.length - 1) {
cuts = Arrays.copyOf(cuts, cuts.length + 1);
cuts[cuts.length - 1] = arr.length - 1;
c++;
}
List<T[]> result = new ArrayList<>(c - startIndex);
int lastEnd = 0;
for (int i = startIndex; i <= c - 1; i++) {
int c2 = i < c - 1 ? 0 : 1;
result.add(Arrays.copyOfRange(arr, lastEnd, cuts[i] + c2));
lastEnd = cuts[i];
}
return result;
} | class class_name[name] begin[{]
method[divideArray, return_type[type[List]], modifier[public static], parameter[arr, cuts]] begin[{]
call[Arrays.sort, parameter[member[.cuts]]]
local_variable[type[int], c]
if[binary_operation[binary_operation[member[.cuts], <, literal[0]], ||, binary_operation[member[.cuts], >, binary_operation[member[arr.length], -, literal[1]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cut position out of bounds.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], startIndex]
if[binary_operation[member[.cuts], !=, binary_operation[member[arr.length], -, literal[1]]]] begin[{]
assign[member[.cuts], call[Arrays.copyOf, parameter[member[.cuts], binary_operation[member[cuts.length], +, literal[1]]]]]
assign[member[.cuts], binary_operation[member[arr.length], -, literal[1]]]
member[.c]
else begin[{]
None
end[}]
local_variable[type[List], result]
local_variable[type[int], lastEnd]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), name=c2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=arr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lastEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=cuts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=c2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=copyOfRange, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=cuts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[SEP] operator[SEP] operator[>] identifier[divideArray] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[arr] , identifier[Integer] operator[...] identifier[cuts] operator[SEP] {
identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[cuts] operator[SEP] operator[SEP] Keyword[int] identifier[c] operator[=] identifier[cuts] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[cuts] operator[SEP] Other[0] operator[SEP] operator[<] Other[0] operator[||] identifier[cuts] operator[SEP] identifier[c] operator[-] Other[1] operator[SEP] operator[>] identifier[arr] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[startIndex] operator[=] identifier[cuts] operator[SEP] Other[0] operator[SEP] operator[==] Other[0] operator[?] Other[1] operator[:] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[cuts] operator[SEP] identifier[c] operator[-] Other[1] operator[SEP] operator[!=] identifier[arr] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] {
identifier[cuts] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] identifier[cuts] , identifier[cuts] operator[SEP] identifier[length] operator[+] Other[1] operator[SEP] operator[SEP] identifier[cuts] operator[SEP] identifier[cuts] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[=] identifier[arr] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[c] operator[++] operator[SEP]
}
identifier[List] operator[<] identifier[T] operator[SEP] operator[SEP] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[c] operator[-] identifier[startIndex] operator[SEP] operator[SEP] Keyword[int] identifier[lastEnd] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[startIndex] operator[SEP] identifier[i] operator[<=] identifier[c] operator[-] Other[1] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[int] identifier[c2] operator[=] identifier[i] operator[<] identifier[c] operator[-] Other[1] operator[?] Other[0] operator[:] Other[1] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[Arrays] operator[SEP] identifier[copyOfRange] operator[SEP] identifier[arr] , identifier[lastEnd] , identifier[cuts] operator[SEP] identifier[i] operator[SEP] operator[+] identifier[c2] operator[SEP] operator[SEP] operator[SEP] identifier[lastEnd] operator[=] identifier[cuts] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
@Pure
@Inline(value = "PhysicsUtil.getPhysicsEngine().motionNewtonEuler1Law2D5(($1), ($2), ($3), ($4), ($5))",
imported = {PhysicsUtil.class})
public static void motionNewtonEuler1Law2D5(
Vector3D<?, ?> velocity,
double minSpeed,
double maxSpeed,
double dt,
Vector3D<?, ?> result) {
engine.motionNewtonEuler1Law2D5(velocity, minSpeed, maxSpeed, dt, result);
} | class class_name[name] begin[{]
method[motionNewtonEuler1Law2D5, return_type[void], modifier[public static], parameter[velocity, minSpeed, maxSpeed, dt, result]] begin[{]
call[engine.motionNewtonEuler1Law2D5, parameter[member[.velocity], member[.minSpeed], member[.maxSpeed], member[.dt], member[.result]]]
end[}]
END[}] | annotation[@] identifier[Pure] annotation[@] identifier[Inline] operator[SEP] identifier[value] operator[=] literal[String] , identifier[imported] operator[=] {
identifier[PhysicsUtil] operator[SEP] Keyword[class]
} operator[SEP] Keyword[public] Keyword[static] Keyword[void] identifier[motionNewtonEuler1Law2D5] operator[SEP] identifier[Vector3D] operator[<] operator[?] , operator[?] operator[>] identifier[velocity] , Keyword[double] identifier[minSpeed] , Keyword[double] identifier[maxSpeed] , Keyword[double] identifier[dt] , identifier[Vector3D] operator[<] operator[?] , operator[?] operator[>] identifier[result] operator[SEP] {
identifier[engine] operator[SEP] identifier[motionNewtonEuler1Law2D5] operator[SEP] identifier[velocity] , identifier[minSpeed] , identifier[maxSpeed] , identifier[dt] , identifier[result] operator[SEP] operator[SEP]
}
|
public static MapReduceSettings getSettings(String bucket, String queue, String module) {
// [START mapReduceSettings]
MapReduceSettings settings = new MapReduceSettings.Builder()
.setBucketName(bucket)
.setWorkerQueueName(queue)
.setModule(module) // if queue is null will use the current queue or "default" if none
.build();
// [END mapReduceSettings]
return settings;
} | class class_name[name] begin[{]
method[getSettings, return_type[type[MapReduceSettings]], modifier[public static], parameter[bucket, queue, module]] begin[{]
local_variable[type[MapReduceSettings], settings]
return[member[.settings]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[MapReduceSettings] identifier[getSettings] operator[SEP] identifier[String] identifier[bucket] , identifier[String] identifier[queue] , identifier[String] identifier[module] operator[SEP] {
identifier[MapReduceSettings] identifier[settings] operator[=] Keyword[new] identifier[MapReduceSettings] operator[SEP] identifier[Builder] operator[SEP] operator[SEP] operator[SEP] identifier[setBucketName] operator[SEP] identifier[bucket] operator[SEP] operator[SEP] identifier[setWorkerQueueName] operator[SEP] identifier[queue] operator[SEP] operator[SEP] identifier[setModule] operator[SEP] identifier[module] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[settings] operator[SEP]
}
|
public void error(final Marker marker, final String message) {
log.error(marker, sanitize(message));
} | class class_name[name] begin[{]
method[error, return_type[void], modifier[public], parameter[marker, message]] begin[{]
call[log.error, parameter[member[.marker], call[.sanitize, parameter[member[.message]]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[error] operator[SEP] Keyword[final] identifier[Marker] identifier[marker] , Keyword[final] identifier[String] identifier[message] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] identifier[marker] , identifier[sanitize] operator[SEP] identifier[message] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public List<PayloadType> getPayloads() {
List<PayloadType> list = new ArrayList<>();
if (preferredPayloadType != null) list.add(preferredPayloadType);
for (JingleMediaManager manager : managers) {
for (PayloadType payloadType : manager.getPayloads()) {
if (!list.contains(payloadType) && !payloadType.equals(preferredPayloadType))
list.add(payloadType);
}
}
return list;
} | class class_name[name] begin[{]
method[getPayloads, return_type[type[List]], modifier[public], parameter[]] begin[{]
local_variable[type[List], list]
if[binary_operation[member[.preferredPayloadType], !=, literal[null]]] begin[{]
call[list.add, parameter[member[.preferredPayloadType]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=payloadType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=list, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=preferredPayloadType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=payloadType, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=payloadType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getPayloads, postfix_operators=[], prefix_operators=[], qualifier=manager, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=payloadType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PayloadType, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=managers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=manager)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JingleMediaManager, sub_type=None))), label=None)
return[member[.list]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[PayloadType] operator[>] identifier[getPayloads] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[PayloadType] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[preferredPayloadType] operator[!=] Other[null] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[preferredPayloadType] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[JingleMediaManager] identifier[manager] operator[:] identifier[managers] operator[SEP] {
Keyword[for] operator[SEP] identifier[PayloadType] identifier[payloadType] operator[:] identifier[manager] operator[SEP] identifier[getPayloads] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[list] operator[SEP] identifier[contains] operator[SEP] identifier[payloadType] operator[SEP] operator[&&] operator[!] identifier[payloadType] operator[SEP] identifier[equals] operator[SEP] identifier[preferredPayloadType] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[payloadType] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[list] operator[SEP]
}
|
public static String infoAll(AerospikeClient client, String cmd) {
Node[] nodes = client.getNodes();
StringBuilder results = new StringBuilder();
for (Node node : nodes) {
results.append(Info.request(node.getHost().name, node.getHost().port, cmd)).append("\n");
}
return results.toString();
} | class class_name[name] begin[{]
method[infoAll, return_type[type[String]], modifier[public static], parameter[client, cmd]] begin[{]
local_variable[type[Node], nodes]
local_variable[type[StringBuilder], results]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHost, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), MethodInvocation(arguments=[], member=getHost, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[MemberReference(member=port, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), MemberReference(member=cmd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=request, postfix_operators=[], prefix_operators=[], qualifier=Info, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None)
return[call[results.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[infoAll] operator[SEP] identifier[AerospikeClient] identifier[client] , identifier[String] identifier[cmd] operator[SEP] {
identifier[Node] operator[SEP] operator[SEP] identifier[nodes] operator[=] identifier[client] operator[SEP] identifier[getNodes] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[results] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Node] identifier[node] operator[:] identifier[nodes] operator[SEP] {
identifier[results] operator[SEP] identifier[append] operator[SEP] identifier[Info] operator[SEP] identifier[request] operator[SEP] identifier[node] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[SEP] identifier[name] , identifier[node] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[SEP] identifier[port] , identifier[cmd] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[results] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
private static String removeCorruptCharacters(final String input) {
if (Util.empty(input)) {
return input;
}
return ESCAPE_BAD_XML10.translate(input);
} | class class_name[name] begin[{]
method[removeCorruptCharacters, return_type[type[String]], modifier[private static], parameter[input]] begin[{]
if[call[Util.empty, parameter[member[.input]]]] begin[{]
return[member[.input]]
else begin[{]
None
end[}]
return[call[ESCAPE_BAD_XML10.translate, parameter[member[.input]]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] identifier[removeCorruptCharacters] operator[SEP] Keyword[final] identifier[String] identifier[input] operator[SEP] {
Keyword[if] operator[SEP] identifier[Util] operator[SEP] identifier[empty] operator[SEP] identifier[input] operator[SEP] operator[SEP] {
Keyword[return] identifier[input] operator[SEP]
}
Keyword[return] identifier[ESCAPE_BAD_XML10] operator[SEP] identifier[translate] operator[SEP] identifier[input] operator[SEP] operator[SEP]
}
|
double collectGraphLastValue(String graph) throws IOException {
final URL lastValueUrl = new URL(url.toString() + '&' + HttpParameter.PART + '='
+ HttpPart.LAST_VALUE + '&' + HttpParameter.GRAPH + '=' + graph);
return collectForUrl(lastValueUrl);
} | class class_name[name] begin[{]
method[collectGraphLastValue, return_type[type[double]], modifier[default], parameter[graph]] begin[{]
local_variable[type[URL], lastValueUrl]
return[call[.collectForUrl, parameter[member[.lastValueUrl]]]]
end[}]
END[}] | Keyword[double] identifier[collectGraphLastValue] operator[SEP] identifier[String] identifier[graph] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[final] identifier[URL] identifier[lastValueUrl] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[url] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[HttpParameter] operator[SEP] identifier[PART] operator[+] literal[String] operator[+] identifier[HttpPart] operator[SEP] identifier[LAST_VALUE] operator[+] literal[String] operator[+] identifier[HttpParameter] operator[SEP] identifier[GRAPH] operator[+] literal[String] operator[+] identifier[graph] operator[SEP] operator[SEP] Keyword[return] identifier[collectForUrl] operator[SEP] identifier[lastValueUrl] operator[SEP] operator[SEP]
}
|
public void updateIf (T value)
{
if (value == null || !value.equals(_value)) {
update(value);
}
} | class class_name[name] begin[{]
method[updateIf, return_type[void], modifier[public], parameter[value]] begin[{]
if[binary_operation[binary_operation[member[.value], ==, literal[null]], ||, call[value.equals, parameter[member[._value]]]]] begin[{]
call[.update, parameter[member[.value]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[updateIf] operator[SEP] identifier[T] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[||] operator[!] identifier[value] operator[SEP] identifier[equals] operator[SEP] identifier[_value] operator[SEP] operator[SEP] {
identifier[update] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
|
synchronized void setDefaultParent(final Actor defaultParent) {
if (defaultParent != null && this.defaultParent != null) {
throw new IllegalStateException("Default parent already exists.");
}
this.defaultParent = defaultParent;
} | class class_name[name] begin[{]
method[setDefaultParent, return_type[void], modifier[synchronized], parameter[defaultParent]] begin[{]
if[binary_operation[binary_operation[member[.defaultParent], !=, literal[null]], &&, binary_operation[THIS[member[None.defaultParent]], !=, literal[null]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Default parent already exists.")], 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[}]
assign[THIS[member[None.defaultParent]], member[.defaultParent]]
end[}]
END[}] | Keyword[synchronized] Keyword[void] identifier[setDefaultParent] operator[SEP] Keyword[final] identifier[Actor] identifier[defaultParent] operator[SEP] {
Keyword[if] operator[SEP] identifier[defaultParent] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[defaultParent] operator[!=] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[defaultParent] operator[=] identifier[defaultParent] operator[SEP]
}
|
public List<Post> selectPosts(final Post.Type type,
final Post.Status status,
final Post.Sort sort,
final Paging paging,
final boolean withResolve) throws SQLException {
return selectPosts(type != null ? EnumSet.of(type) : null, status, sort, paging, withResolve);
} | class class_name[name] begin[{]
method[selectPosts, return_type[type[List]], modifier[public], parameter[type, status, sort, paging, withResolve]] begin[{]
return[call[.selectPosts, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=EnumSet, selectors=[], type_arguments=None)), member[.status], member[.sort], member[.paging], member[.withResolve]]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[Post] operator[>] identifier[selectPosts] operator[SEP] Keyword[final] identifier[Post] operator[SEP] identifier[Type] identifier[type] , Keyword[final] identifier[Post] operator[SEP] identifier[Status] identifier[status] , Keyword[final] identifier[Post] operator[SEP] identifier[Sort] identifier[sort] , Keyword[final] identifier[Paging] identifier[paging] , Keyword[final] Keyword[boolean] identifier[withResolve] operator[SEP] Keyword[throws] identifier[SQLException] {
Keyword[return] identifier[selectPosts] operator[SEP] identifier[type] operator[!=] Other[null] operator[?] identifier[EnumSet] operator[SEP] identifier[of] operator[SEP] identifier[type] operator[SEP] operator[:] Other[null] , identifier[status] , identifier[sort] , identifier[paging] , identifier[withResolve] operator[SEP] operator[SEP]
}
|
public void addUndoableMove(int moveThreadIndex, int stepIndex, int moveIndex, Move<Solution_> move) {
MoveResult<Solution_> result = new MoveResult<>(moveThreadIndex, stepIndex, moveIndex, move, false, null);
synchronized (this) {
if (result.getStepIndex() != filterStepIndex) {
// Discard element from previous step
return;
}
innerQueue.add(result);
}
} | class class_name[name] begin[{]
method[addUndoableMove, return_type[void], modifier[public], parameter[moveThreadIndex, stepIndex, moveIndex, move]] begin[{]
local_variable[type[MoveResult], result]
SYNCHRONIZED[THIS[]] BEGIN[{]
if[binary_operation[call[result.getStepIndex, parameter[]], !=, member[.filterStepIndex]]] begin[{]
return[None]
else begin[{]
None
end[}]
call[innerQueue.add, parameter[member[.result]]]
END[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addUndoableMove] operator[SEP] Keyword[int] identifier[moveThreadIndex] , Keyword[int] identifier[stepIndex] , Keyword[int] identifier[moveIndex] , identifier[Move] operator[<] identifier[Solution_] operator[>] identifier[move] operator[SEP] {
identifier[MoveResult] operator[<] identifier[Solution_] operator[>] identifier[result] operator[=] Keyword[new] identifier[MoveResult] operator[<] operator[>] operator[SEP] identifier[moveThreadIndex] , identifier[stepIndex] , identifier[moveIndex] , identifier[move] , literal[boolean] , Other[null] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] {
Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[getStepIndex] operator[SEP] operator[SEP] operator[!=] identifier[filterStepIndex] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[innerQueue] operator[SEP] identifier[add] operator[SEP] identifier[result] operator[SEP] operator[SEP]
}
}
|
public Iterable<ObjectResult> getFailedObjectResults() {
List<ObjectResult> result = new ArrayList<>();
for (ObjectResult objResult : m_objResultList) {
if (objResult.isFailed()) {
result.add(objResult);
}
}
return result;
} | class class_name[name] begin[{]
method[getFailedObjectResults, return_type[type[Iterable]], modifier[public], parameter[]] begin[{]
local_variable[type[List], result]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isFailed, postfix_operators=[], prefix_operators=[], qualifier=objResult, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=objResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=m_objResultList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=objResult)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectResult, sub_type=None))), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[Iterable] operator[<] identifier[ObjectResult] operator[>] identifier[getFailedObjectResults] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[ObjectResult] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ObjectResult] identifier[objResult] operator[:] identifier[m_objResultList] operator[SEP] {
Keyword[if] operator[SEP] identifier[objResult] operator[SEP] identifier[isFailed] operator[SEP] operator[SEP] operator[SEP] {
identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[objResult] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
protected void processRelationship(final ParserData parserData, final SpecNodeWithRelationships specNode,
final Relationship relationship) {
final String relatedId = relationship.getSecondaryRelationshipId();
// The relationship points to a target so it must be a level or topic
if (relatedId.toUpperCase(Locale.ENGLISH).matches(ProcessorConstants.TARGET_REGEX)) {
if (parserData.getTargetTopics().containsKey(relatedId) && !parserData.getTargetLevels().containsKey(relatedId)) {
specNode.addRelationshipToTarget(parserData.getTargetTopics().get(relatedId), relationship.getType(),
relationship.getRelationshipTitle());
} else if (!parserData.getTargetTopics().containsKey(relatedId) && parserData.getTargetLevels().containsKey(relatedId)) {
specNode.addRelationshipToTarget(parserData.getTargetLevels().get(relatedId), relationship.getType(),
relationship.getRelationshipTitle());
} else {
final SpecTopic dummyTopic = new SpecTopic(-1, "");
dummyTopic.setTargetId(relatedId);
dummyTopic.setUniqueId("-1");
specNode.addRelationshipToTarget(dummyTopic, relationship.getType(), relationship.getRelationshipTitle());
}
}
// The relationship isn't a target so it must point to a topic directly
else {
if (!CSConstants.NEW_TOPIC_ID_PATTERN.matcher(relatedId).matches()) {
// The relationship isn't a unique new topic so it will contain the line number in front of
// the topic ID
if (!relatedId.startsWith("X")) {
int count = 0;
SpecTopic relatedTopic = null;
// Get the related topic and count if more then one is found
for (final Map.Entry<String, SpecTopic> specTopicEntry : parserData.getSpecTopics().entrySet()) {
if (specTopicEntry.getKey().matches("^[\\w\\d]+-" + relatedId + "$")) {
relatedTopic = specTopicEntry.getValue();
count++;
}
}
/*
* Add the relationship to the node even if the relationship isn't duplicated
* and the related topic isn't the current topic. This is so it shows up in the
* output.
*/
if (count > 0) {
specNode.addRelationshipToTopic(relatedTopic, relationship.getType(), relationship.getRelationshipTitle());
} else {
final SpecTopic dummyTopic = new SpecTopic(-1, "");
dummyTopic.setId(relatedId);
dummyTopic.setUniqueId("-1");
specNode.addRelationshipToTopic(dummyTopic, relationship.getType(), relationship.getRelationshipTitle());
}
} else {
final SpecTopic dummyTopic = new SpecTopic(-1, "");
dummyTopic.setId(relatedId);
dummyTopic.setUniqueId("-1");
specNode.addRelationshipToTopic(dummyTopic, relationship.getType(), relationship.getRelationshipTitle());
}
} else {
if (parserData.getSpecTopics().containsKey(relatedId)) {
final SpecTopic relatedSpecTopic = parserData.getSpecTopics().get(relatedId);
// Check that a duplicate doesn't exist, because if it does the new topic isn't unique
String duplicatedId = "X" + relatedId.substring(1);
boolean duplicateExists = false;
for (String uniqueTopicId : parserData.getSpecTopics().keySet()) {
if (uniqueTopicId.matches("^[\\w\\d]+-" + duplicatedId + "$")) {
duplicateExists = true;
break;
}
}
if (relatedSpecTopic != specNode) {
if (!duplicateExists) {
specNode.addRelationshipToTopic(relatedSpecTopic, relationship.getType(), relationship.getRelationshipTitle());
} else {
// Only create a new target if one doesn't already exist
if (relatedSpecTopic.getTargetId() == null) {
String targetId = ContentSpecUtilities.generateRandomTargetId(relatedSpecTopic.getUniqueId());
while (parserData.getTargetTopics().containsKey(targetId) || parserData.getTargetLevels().containsKey(
targetId)) {
targetId = ContentSpecUtilities.generateRandomTargetId(relatedSpecTopic.getUniqueId());
}
parserData.getSpecTopics().get(relatedId).setTargetId(targetId);
parserData.getTargetTopics().put(targetId, relatedSpecTopic);
}
specNode.addRelationshipToTopic(relatedSpecTopic, relationship.getType(), relationship.getRelationshipTitle());
}
}
} else {
final SpecTopic dummyTopic = new SpecTopic(-1, "");
dummyTopic.setId(relatedId);
dummyTopic.setUniqueId("-1");
specNode.addRelationshipToTopic(dummyTopic, relationship.getType(), relationship.getRelationshipTitle());
}
}
}
} | class class_name[name] begin[{]
method[processRelationship, return_type[void], modifier[protected], parameter[parserData, specNode, relationship]] begin[{]
local_variable[type[String], relatedId]
if[call[relatedId.toUpperCase, parameter[member[Locale.ENGLISH]]]] begin[{]
if[binary_operation[call[parserData.getTargetTopics, parameter[]], &&, call[parserData.getTargetLevels, parameter[]]]] begin[{]
call[specNode.addRelationshipToTarget, parameter[call[parserData.getTargetTopics, parameter[]], call[relationship.getType, parameter[]], call[relationship.getRelationshipTitle, parameter[]]]]
else begin[{]
if[binary_operation[call[parserData.getTargetTopics, parameter[]], &&, call[parserData.getTargetLevels, parameter[]]]] begin[{]
call[specNode.addRelationshipToTarget, parameter[call[parserData.getTargetLevels, parameter[]], call[relationship.getType, parameter[]], call[relationship.getRelationshipTitle, parameter[]]]]
else begin[{]
local_variable[type[SpecTopic], dummyTopic]
call[dummyTopic.setTargetId, parameter[member[.relatedId]]]
call[dummyTopic.setUniqueId, parameter[literal["-1"]]]
call[specNode.addRelationshipToTarget, parameter[member[.dummyTopic], call[relationship.getType, parameter[]], call[relationship.getRelationshipTitle, parameter[]]]]
end[}]
end[}]
else begin[{]
if[call[CSConstants.NEW_TOPIC_ID_PATTERN.matcher, parameter[member[.relatedId]]]] begin[{]
if[call[relatedId.startsWith, parameter[literal["X"]]]] begin[{]
local_variable[type[int], count]
local_variable[type[SpecTopic], relatedTopic]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=specTopicEntry, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="^[\\w\\d]+-"), operandr=MemberReference(member=relatedId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="$"), operator=+)], member=matches, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=relatedTopic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=specTopicEntry, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=count, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getSpecTopics, postfix_operators=[], prefix_operators=[], qualifier=parserData, selectors=[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=specTopicEntry)], 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=SpecTopic, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
if[binary_operation[member[.count], >, literal[0]]] begin[{]
call[specNode.addRelationshipToTopic, parameter[member[.relatedTopic], call[relationship.getType, parameter[]], call[relationship.getRelationshipTitle, parameter[]]]]
else begin[{]
local_variable[type[SpecTopic], dummyTopic]
call[dummyTopic.setId, parameter[member[.relatedId]]]
call[dummyTopic.setUniqueId, parameter[literal["-1"]]]
call[specNode.addRelationshipToTopic, parameter[member[.dummyTopic], call[relationship.getType, parameter[]], call[relationship.getRelationshipTitle, parameter[]]]]
end[}]
else begin[{]
local_variable[type[SpecTopic], dummyTopic]
call[dummyTopic.setId, parameter[member[.relatedId]]]
call[dummyTopic.setUniqueId, parameter[literal["-1"]]]
call[specNode.addRelationshipToTopic, parameter[member[.dummyTopic], call[relationship.getType, parameter[]], call[relationship.getRelationshipTitle, parameter[]]]]
end[}]
else begin[{]
if[call[parserData.getSpecTopics, parameter[]]] begin[{]
local_variable[type[SpecTopic], relatedSpecTopic]
local_variable[type[String], duplicatedId]
local_variable[type[boolean], duplicateExists]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="^[\\w\\d]+-"), operandr=MemberReference(member=duplicatedId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="$"), operator=+)], member=matches, postfix_operators=[], prefix_operators=[], qualifier=uniqueTopicId, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=duplicateExists, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getSpecTopics, postfix_operators=[], prefix_operators=[], qualifier=parserData, selectors=[MethodInvocation(arguments=[], member=keySet, 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=uniqueTopicId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
if[binary_operation[member[.relatedSpecTopic], !=, member[.specNode]]] begin[{]
if[member[.duplicateExists]] begin[{]
call[specNode.addRelationshipToTopic, parameter[member[.relatedSpecTopic], call[relationship.getType, parameter[]], call[relationship.getRelationshipTitle, parameter[]]]]
else begin[{]
if[binary_operation[call[relatedSpecTopic.getTargetId, parameter[]], ==, literal[null]]] begin[{]
local_variable[type[String], targetId]
while[binary_operation[call[parserData.getTargetTopics, parameter[]], ||, call[parserData.getTargetLevels, parameter[]]]] begin[{]
assign[member[.targetId], call[ContentSpecUtilities.generateRandomTargetId, parameter[call[relatedSpecTopic.getUniqueId, parameter[]]]]]
end[}]
call[parserData.getSpecTopics, parameter[]]
call[parserData.getTargetTopics, parameter[]]
else begin[{]
None
end[}]
call[specNode.addRelationshipToTopic, parameter[member[.relatedSpecTopic], call[relationship.getType, parameter[]], call[relationship.getRelationshipTitle, parameter[]]]]
end[}]
else begin[{]
None
end[}]
else begin[{]
local_variable[type[SpecTopic], dummyTopic]
call[dummyTopic.setId, parameter[member[.relatedId]]]
call[dummyTopic.setUniqueId, parameter[literal["-1"]]]
call[specNode.addRelationshipToTopic, parameter[member[.dummyTopic], call[relationship.getType, parameter[]], call[relationship.getRelationshipTitle, parameter[]]]]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[processRelationship] operator[SEP] Keyword[final] identifier[ParserData] identifier[parserData] , Keyword[final] identifier[SpecNodeWithRelationships] identifier[specNode] , Keyword[final] identifier[Relationship] identifier[relationship] operator[SEP] {
Keyword[final] identifier[String] identifier[relatedId] operator[=] identifier[relationship] operator[SEP] identifier[getSecondaryRelationshipId] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[relatedId] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ENGLISH] operator[SEP] operator[SEP] identifier[matches] operator[SEP] identifier[ProcessorConstants] operator[SEP] identifier[TARGET_REGEX] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[parserData] operator[SEP] identifier[getTargetTopics] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[relatedId] operator[SEP] operator[&&] operator[!] identifier[parserData] operator[SEP] identifier[getTargetLevels] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[relatedId] operator[SEP] operator[SEP] {
identifier[specNode] operator[SEP] identifier[addRelationshipToTarget] operator[SEP] identifier[parserData] operator[SEP] identifier[getTargetTopics] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[relatedId] operator[SEP] , identifier[relationship] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[relationship] operator[SEP] identifier[getRelationshipTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[parserData] operator[SEP] identifier[getTargetTopics] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[relatedId] operator[SEP] operator[&&] identifier[parserData] operator[SEP] identifier[getTargetLevels] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[relatedId] operator[SEP] operator[SEP] {
identifier[specNode] operator[SEP] identifier[addRelationshipToTarget] operator[SEP] identifier[parserData] operator[SEP] identifier[getTargetLevels] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[relatedId] operator[SEP] , identifier[relationship] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[relationship] operator[SEP] identifier[getRelationshipTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[final] identifier[SpecTopic] identifier[dummyTopic] operator[=] Keyword[new] identifier[SpecTopic] operator[SEP] operator[-] Other[1] , literal[String] operator[SEP] operator[SEP] identifier[dummyTopic] operator[SEP] identifier[setTargetId] operator[SEP] identifier[relatedId] operator[SEP] operator[SEP] identifier[dummyTopic] operator[SEP] identifier[setUniqueId] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[specNode] operator[SEP] identifier[addRelationshipToTarget] operator[SEP] identifier[dummyTopic] , identifier[relationship] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[relationship] operator[SEP] identifier[getRelationshipTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] operator[!] identifier[CSConstants] operator[SEP] identifier[NEW_TOPIC_ID_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[relatedId] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[relatedId] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[int] identifier[count] operator[=] Other[0] operator[SEP] identifier[SpecTopic] identifier[relatedTopic] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[SpecTopic] operator[>] identifier[specTopicEntry] operator[:] identifier[parserData] operator[SEP] identifier[getSpecTopics] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[specTopicEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[+] identifier[relatedId] operator[+] literal[String] operator[SEP] operator[SEP] {
identifier[relatedTopic] operator[=] identifier[specTopicEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[count] operator[++] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[count] operator[>] Other[0] operator[SEP] {
identifier[specNode] operator[SEP] identifier[addRelationshipToTopic] operator[SEP] identifier[relatedTopic] , identifier[relationship] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[relationship] operator[SEP] identifier[getRelationshipTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[final] identifier[SpecTopic] identifier[dummyTopic] operator[=] Keyword[new] identifier[SpecTopic] operator[SEP] operator[-] Other[1] , literal[String] operator[SEP] operator[SEP] identifier[dummyTopic] operator[SEP] identifier[setId] operator[SEP] identifier[relatedId] operator[SEP] operator[SEP] identifier[dummyTopic] operator[SEP] identifier[setUniqueId] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[specNode] operator[SEP] identifier[addRelationshipToTopic] operator[SEP] identifier[dummyTopic] , identifier[relationship] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[relationship] operator[SEP] identifier[getRelationshipTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[final] identifier[SpecTopic] identifier[dummyTopic] operator[=] Keyword[new] identifier[SpecTopic] operator[SEP] operator[-] Other[1] , literal[String] operator[SEP] operator[SEP] identifier[dummyTopic] operator[SEP] identifier[setId] operator[SEP] identifier[relatedId] operator[SEP] operator[SEP] identifier[dummyTopic] operator[SEP] identifier[setUniqueId] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[specNode] operator[SEP] identifier[addRelationshipToTopic] operator[SEP] identifier[dummyTopic] , identifier[relationship] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[relationship] operator[SEP] identifier[getRelationshipTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[parserData] operator[SEP] identifier[getSpecTopics] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[relatedId] operator[SEP] operator[SEP] {
Keyword[final] identifier[SpecTopic] identifier[relatedSpecTopic] operator[=] identifier[parserData] operator[SEP] identifier[getSpecTopics] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[relatedId] operator[SEP] operator[SEP] identifier[String] identifier[duplicatedId] operator[=] literal[String] operator[+] identifier[relatedId] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[boolean] identifier[duplicateExists] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[uniqueTopicId] operator[:] identifier[parserData] operator[SEP] identifier[getSpecTopics] operator[SEP] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[uniqueTopicId] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[+] identifier[duplicatedId] operator[+] literal[String] operator[SEP] operator[SEP] {
identifier[duplicateExists] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[relatedSpecTopic] operator[!=] identifier[specNode] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[duplicateExists] operator[SEP] {
identifier[specNode] operator[SEP] identifier[addRelationshipToTopic] operator[SEP] identifier[relatedSpecTopic] , identifier[relationship] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[relationship] operator[SEP] identifier[getRelationshipTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[relatedSpecTopic] operator[SEP] identifier[getTargetId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[String] identifier[targetId] operator[=] identifier[ContentSpecUtilities] operator[SEP] identifier[generateRandomTargetId] operator[SEP] identifier[relatedSpecTopic] operator[SEP] identifier[getUniqueId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[parserData] operator[SEP] identifier[getTargetTopics] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[targetId] operator[SEP] operator[||] identifier[parserData] operator[SEP] identifier[getTargetLevels] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[targetId] operator[SEP] operator[SEP] {
identifier[targetId] operator[=] identifier[ContentSpecUtilities] operator[SEP] identifier[generateRandomTargetId] operator[SEP] identifier[relatedSpecTopic] operator[SEP] identifier[getUniqueId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[parserData] operator[SEP] identifier[getSpecTopics] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[relatedId] operator[SEP] operator[SEP] identifier[setTargetId] operator[SEP] identifier[targetId] operator[SEP] operator[SEP] identifier[parserData] operator[SEP] identifier[getTargetTopics] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[targetId] , identifier[relatedSpecTopic] operator[SEP] operator[SEP]
}
identifier[specNode] operator[SEP] identifier[addRelationshipToTopic] operator[SEP] identifier[relatedSpecTopic] , identifier[relationship] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[relationship] operator[SEP] identifier[getRelationshipTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
Keyword[final] identifier[SpecTopic] identifier[dummyTopic] operator[=] Keyword[new] identifier[SpecTopic] operator[SEP] operator[-] Other[1] , literal[String] operator[SEP] operator[SEP] identifier[dummyTopic] operator[SEP] identifier[setId] operator[SEP] identifier[relatedId] operator[SEP] operator[SEP] identifier[dummyTopic] operator[SEP] identifier[setUniqueId] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[specNode] operator[SEP] identifier[addRelationshipToTopic] operator[SEP] identifier[dummyTopic] , identifier[relationship] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[relationship] operator[SEP] identifier[getRelationshipTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
|
private static Definition inputFromCommandLine() throws IOException
{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
Definition def = new Definition();
Set<String> classes = new HashSet<String>();
//profile version
String version;
do
{
System.out.print(rb.getString("profile.version") + " " +
rb.getString("profile.version.values") + " [1.7]: ");
version = in.readLine();
if (version == null || version.equals(""))
version = "1.7";
} while (!(version.equals("1.7") || version.equals("1.6") || version.equals("1.5") || version.equals("1.0")));
def.setVersion(version);
//by default, support outbound, but not inbound
def.setSupportOutbound(true);
def.setSupportInbound(false);
//bound
if (!version.equals("1.0"))
{
System.out.print(rb.getString("support.bound") + " " + rb.getString("support.bound.values") + " [O]: ");
String bound = in.readLine();
if (bound == null || bound.equals("") || bound.equals("O") || bound.equals("o") || bound.equals("Outbound"))
{
//keep default bound
}
else if (bound.equals("I") || bound.equals("i") || bound.equals("Inbound"))
{
def.setSupportOutbound(false);
def.setSupportInbound(true);
}
else if (bound.equals("B") || bound.equals("b") || bound.equals("Bidirectional"))
{
def.setSupportOutbound(true);
def.setSupportInbound(true);
}
}
//package name
String packageName;
do
{
System.out.print(rb.getString("package.name") + ": ");
packageName = in.readLine();
if (packageName.contains(".") && Pattern.matches(PACKAGE_NAME_PATTERN, packageName))
break;
System.out.println(rb.getString("package.name.validated"));
} while (true);
def.setRaPackage(packageName);
//transaction
if (def.isSupportOutbound())
{
System.out.print(rb.getString("support.transaction") + " " +
rb.getString("support.transaction.values") + " [N]: ");
String trans = in.readLine();
if (trans == null || trans.equals(""))
def.setSupportTransaction("NoTransaction");
else if (trans.equals("L") || trans.equals("l") || trans.equals("LocalTransaction"))
{
def.setSupportTransaction("LocalTransaction");
}
else if (trans.equals("X") || trans.equals("x") || trans.equals("XATransaction"))
{
def.setSupportTransaction("XATransaction");
}
else
{
def.setSupportTransaction("NoTransaction");
}
}
//reauthentication
if (def.isSupportOutbound() && !version.equals("1.0"))
{
System.out.print(rb.getString("support.reauthentication") + " " + rb.getString("yesno") + " [N]: ");
String reauth = in.readLine();
if (reauth == null || reauth.equals(""))
def.setSupportReauthen(false);
else if (reauth.equals("Y") || reauth.equals("y") || reauth.equals("Yes"))
{
def.setSupportReauthen(true);
}
else
{
def.setSupportReauthen(false);
}
}
//support annotation
if (version.equals("1.7") || version.equals("1.6"))
{
System.out.print(rb.getString("use.annotation") + " " + rb.getString("yesno") + " [Y]: ");
String useAnnotation = in.readLine();
if (useAnnotation == null)
def.setUseAnnotation(true);
else
{
if (useAnnotation.equals("N") || useAnnotation.equals("n") || useAnnotation.equals("No"))
def.setUseAnnotation(false);
else
def.setUseAnnotation(true);
}
}
else
{
def.setUseAnnotation(false);
}
//use resource adapter
if (def.isSupportOutbound() && !def.isSupportInbound() &&
(version.equals("1.7") || version.equals("1.6") || version.equals("1.5")))
{
System.out.print(rb.getString("use.ra") + " " + rb.getString("yesno") + " [Y]: ");
String useRa = in.readLine();
if (useRa == null)
def.setUseRa(true);
else
{
if (useRa.equals("N") || useRa.equals("n") || useRa.equals("No"))
def.setUseRa(false);
else
def.setUseRa(true);
}
}
else if (version.equals("1.0"))
{
def.setUseRa(false);
}
else
{
def.setUseRa(true);
}
//input ra class name
if (def.isUseRa() || def.isSupportInbound())
{
String raClassName;
do
{
System.out.print(rb.getString("ra.class.name"));
System.out.print(" [" + def.getRaClass() + "]: ");
raClassName = in.readLine();
if (raClassName != null && !raClassName.equals(""))
{
if (!Pattern.matches(CLASS_NAME_PATTERN, raClassName))
{
System.out.println(rb.getString("class.name.validated"));
continue;
}
def.setRaClass(raClassName);
classes.add(raClassName);
setDefaultValue(def, raClassName, "ResourceAdapter");
setDefaultValue(def, raClassName, "Ra");
}
break;
} while (true);
System.out.print(rb.getString("ra.serial") + " " + rb.getString("yesno") + " [Y]: ");
String raSerial = in.readLine();
if (raSerial == null)
def.setRaSerial(true);
else
{
if (raSerial.equals("N") || raSerial.equals("n") || raSerial.equals("No"))
def.setRaSerial(false);
else
def.setRaSerial(true);
}
List<ConfigPropType> raProps = inputProperties("ra", in, false);
def.setRaConfigProps(raProps);
}
//outbound
if (def.isSupportOutbound())
{
List<McfDef> mcfDefs = new ArrayList<>();
def.setMcfDefs(mcfDefs);
int mcfID = 1;
boolean moreMcf;
do
{
McfDef mcfdef = new McfDef(mcfID, def);
String mcfClassName = "";
do
{
System.out.print(rb.getString("mcf.class.name"));
System.out.print(" [" + mcfdef.getMcfClass() + "]: ");
mcfClassName = in.readLine();
if (!mcfClassName.equals("") && !Pattern.matches(CLASS_NAME_PATTERN, mcfClassName))
{
System.out.println(rb.getString("class.name.validated"));
}
} while ((classes.contains(mcfClassName) || !Pattern.matches(CLASS_NAME_PATTERN, mcfClassName))
&& !mcfClassName.equals(""));
classes.add(mcfClassName);
if (!mcfClassName.equals(""))
{
mcfdef.setMcfClass(mcfClassName);
setDefaultValue(def, mcfClassName, "ManagedConnectionFactory");
setDefaultValue(def, mcfClassName, "Mcf");
}
List<ConfigPropType> mcfProps = inputProperties("mcf", in, false);
mcfdef.setMcfConfigProps(mcfProps);
if (def.isUseRa())
{
System.out.print(rb.getString("mcf.impl.raa") + " " + rb.getString("yesno") + " [Y]: ");
String raAssociation = in.readLine();
if (raAssociation == null || raAssociation.equals(""))
mcfdef.setImplRaAssociation(true);
else
{
if (raAssociation.equals("Y") || raAssociation.equals("y") || raAssociation.equals("Yes"))
mcfdef.setImplRaAssociation(true);
else
mcfdef.setImplRaAssociation(false);
}
}
String mcClassName = "";
do
{
System.out.print(rb.getString("mc.class.name"));
System.out.print(" [" + mcfdef.getMcClass() + "]: ");
mcClassName = in.readLine();
if (!mcClassName.equals("") && !Pattern.matches(CLASS_NAME_PATTERN, mcClassName))
{
System.out.println(rb.getString("class.name.validated"));
}
} while ((classes.contains(mcClassName) || !Pattern.matches(CLASS_NAME_PATTERN, mcClassName))
&& !mcClassName.equals(""));
classes.add(mcClassName);
if (mcClassName != null && !mcClassName.equals(""))
mcfdef.setMcClass(mcClassName);
System.out.print(rb.getString("mcf.use.cci") + " " + rb.getString("yesno") + " [N]: ");
String useCciConnection = in.readLine();
if (useCciConnection == null)
mcfdef.setUseCciConnection(false);
else
{
if (useCciConnection.equals("Y") || useCciConnection.equals("y") || useCciConnection.equals("Yes"))
mcfdef.setUseCciConnection(true);
else
mcfdef.setUseCciConnection(false);
}
if (!mcfdef.isUseCciConnection())
{
String cfInterfaceName = "";
do
{
System.out.print(rb.getString("cf.interface.name"));
System.out.print(" [" + mcfdef.getCfInterfaceClass() + "]: ");
cfInterfaceName = in.readLine();
if (!cfInterfaceName.equals("") && !Pattern.matches(CLASS_NAME_PATTERN, cfInterfaceName))
{
System.out.println(rb.getString("class.name.validated"));
}
} while ((classes.contains(cfInterfaceName) || !Pattern.matches(CLASS_NAME_PATTERN, cfInterfaceName))
&& !cfInterfaceName.equals(""));
classes.add(cfInterfaceName);
if (cfInterfaceName != null && !cfInterfaceName.equals(""))
mcfdef.setCfInterfaceClass(cfInterfaceName);
String cfClassName = "";
do
{
System.out.print(rb.getString("cf.class.name"));
System.out.print(" [" + mcfdef.getCfClass() + "]: ");
cfClassName = in.readLine();
if (!cfClassName.equals("") && !Pattern.matches(CLASS_NAME_PATTERN, cfClassName))
{
System.out.println(rb.getString("class.name.validated"));
}
} while ((classes.contains(cfClassName) || !Pattern.matches(CLASS_NAME_PATTERN, cfClassName))
&& !cfClassName.equals(""));
classes.add(cfClassName);
if (cfClassName != null && !cfClassName.equals(""))
mcfdef.setCfClass(cfClassName);
String connInterfaceName = "";
do
{
System.out.print(rb.getString("conn.interface.name"));
System.out.print(" [" + mcfdef.getConnInterfaceClass() + "]: ");
connInterfaceName = in.readLine();
if (!connInterfaceName.equals("") && !Pattern.matches(CLASS_NAME_PATTERN, connInterfaceName))
{
System.out.println(rb.getString("class.name.validated"));
}
} while ((classes.contains(connInterfaceName) || !Pattern.matches(CLASS_NAME_PATTERN, connInterfaceName))
&& !connInterfaceName.equals(""));
classes.add(connInterfaceName);
if (connInterfaceName != null && !connInterfaceName.equals(""))
mcfdef.setConnInterfaceClass(connInterfaceName);
String connImplName = "";
do
{
System.out.print(rb.getString("conn.class.name"));
System.out.print(" [" + mcfdef.getConnImplClass() + "]: ");
connImplName = in.readLine();
if (!connImplName.equals("") && !Pattern.matches(CLASS_NAME_PATTERN, connImplName))
{
System.out.println(rb.getString("class.name.validated"));
}
} while ((classes.contains(connImplName) || !Pattern.matches(CLASS_NAME_PATTERN, connImplName))
&& !connImplName.equals(""));
classes.add(connImplName);
if (connImplName != null && !connImplName.equals(""))
mcfdef.setConnImplClass(connImplName);
System.out.print(rb.getString("connection.method.support") + " " + rb.getString("yesno") + " [N]: ");
String supportMethod = in.readLine();
if (supportMethod == null)
mcfdef.setDefineMethodInConnection(false);
else
{
if (supportMethod.equals("Y") || supportMethod.equals("y") || supportMethod.equals("Yes"))
mcfdef.setDefineMethodInConnection(true);
else
mcfdef.setDefineMethodInConnection(false);
}
if (mcfdef.isDefineMethodInConnection())
{
mcfdef.setMethods(inputMethod(in));
}
}
mcfDefs.add(mcfdef);
mcfID++;
moreMcf = false;
if (def.getVersion().equals("1.5") || def.getVersion().equals("1.6") || def.getVersion().equals("1.7"))
{
System.out.print(rb.getString("more.mcf") + " " + rb.getString("yesno") + " [N]: ");
String inputMoreMcf = in.readLine();
if (inputMoreMcf != null && (inputMoreMcf.equals("Y") || inputMoreMcf.equals("y") || inputMoreMcf
.equals("Yes")))
moreMcf = true;
}
} while (moreMcf);
}
//inbound
if (def.isSupportInbound())
{
String mlClassName = "";
do
{
System.out.print(rb.getString("ml.interface.name"));
System.out.print(" [" + def.getMlClass() + "]: ");
mlClassName = in.readLine();
if (!mlClassName.equals("") && !Pattern.matches(CLASS_NAME_PATTERN, mlClassName))
{
System.out.println(rb.getString("class.name.validated"));
}
} while ((classes.contains(mlClassName) || !Pattern.matches(CLASS_NAME_PATTERN, mlClassName)) && !mlClassName
.equals(""));
classes.add(mlClassName);
boolean defaultPackage = true;
if (mlClassName != null && !mlClassName.equals(""))
{
def.setMlClass(mlClassName);
if (mlClassName.contains("."))
defaultPackage = false;
else
{
setDefaultValue(def, mlClassName, "MessageListener");
setDefaultValue(def, mlClassName, "Ml");
}
}
def.setDefaultPackageInbound(defaultPackage);
String asClassName = "";
do
{
System.out.print(rb.getString("as.class.name"));
System.out.print(" [" + def.getAsClass() + "]: ");
asClassName = in.readLine();
if (!asClassName.equals("") && !Pattern.matches(CLASS_NAME_PATTERN, asClassName))
{
System.out.println(rb.getString("class.name.validated"));
}
} while ((classes.contains(asClassName) || !Pattern.matches(CLASS_NAME_PATTERN, asClassName)) && !asClassName
.equals(""));
classes.add(asClassName);
if (asClassName != null && !asClassName.equals(""))
def.setAsClass(asClassName);
List<ConfigPropType> asProps = inputProperties("as", in, true);
def.setAsConfigProps(asProps);
String actiClassName = "";
do
{
System.out.print(rb.getString("acti.class.name"));
System.out.print(" [" + def.getActivationClass() + "]: ");
actiClassName = in.readLine();
if (!actiClassName.equals("") && !Pattern.matches(CLASS_NAME_PATTERN, actiClassName))
{
System.out.println(rb.getString("class.name.validated"));
}
} while ((classes.contains(actiClassName) || !Pattern.matches(CLASS_NAME_PATTERN, actiClassName))
&& !actiClassName.equals(""));
classes.add(actiClassName);
if (actiClassName != null && !actiClassName.equals(""))
def.setActivationClass(actiClassName);
}
//admin object
System.out.print(rb.getString("gen.adminobject") + " " + rb.getString("yesno") + " [N]: ");
String genAo = in.readLine();
if (genAo == null)
def.setGenAdminObject(false);
else
{
if (genAo.equals("Y") || genAo.equals("y") || genAo.equals("Yes"))
def.setGenAdminObject(true);
else
def.setGenAdminObject(false);
}
if (def.isGenAdminObject())
{
System.out.print(rb.getString("adminobject.raa") + " " + rb.getString("yesno") + " [Y]: ");
String aoRaAssociation = in.readLine();
if (aoRaAssociation == null || aoRaAssociation.equals(""))
def.setAdminObjectImplRaAssociation(true);
else
{
if (aoRaAssociation.equals("Y") || aoRaAssociation.equals("y") || aoRaAssociation.equals("Yes"))
def.setAdminObjectImplRaAssociation(true);
else
def.setAdminObjectImplRaAssociation(false);
}
}
int numOfAo = 0;
while (numOfAo >= 0 && def.isGenAdminObject())
{
String strOrder = numOfAo > 0 ? Integer.valueOf(numOfAo).toString() : "";
AdminObjectType aoType = new AdminObjectType();
String aoInterfaceName = "";
do
{
System.out.print(rb.getString("adminobject.interface.name"));
System.out.print(" [" + def.getDefaultValue() + strOrder + "AdminObject]: ");
aoInterfaceName = in.readLine();
if (!aoInterfaceName.equals("") && !Pattern.matches(CLASS_NAME_PATTERN, aoInterfaceName))
{
System.out.println(rb.getString("class.name.validated"));
}
} while ((classes.contains(aoInterfaceName) || !Pattern.matches(CLASS_NAME_PATTERN, aoInterfaceName))
&& !aoInterfaceName.equals(""));
classes.add(aoInterfaceName);
if (aoInterfaceName != null && !aoInterfaceName.equals(""))
{
aoType.setAdminObjectInterface(aoInterfaceName);
}
else
{
aoType.setAdminObjectInterface(def.getDefaultValue() + strOrder + "AdminObject");
}
String aoClassName = "";
do
{
System.out.print(rb.getString("adminobject.class.name"));
System.out.print(" [" + def.getDefaultValue() + strOrder + "AdminObjectImpl]: ");
aoClassName = in.readLine();
if (!aoClassName.equals("") && !Pattern.matches(CLASS_NAME_PATTERN, aoClassName))
{
System.out.println(rb.getString("class.name.validated"));
}
} while ((classes.contains(aoClassName) || !Pattern.matches(CLASS_NAME_PATTERN, aoClassName)) && !aoClassName
.equals(""));
classes.add(aoClassName);
if (aoClassName != null && !aoClassName.equals(""))
{
aoType.setAdminObjectClass(aoClassName);
}
else
{
aoType.setAdminObjectClass(def.getDefaultValue() + strOrder + "AdminObjectImpl");
}
List<ConfigPropType> aoProps = inputProperties("adminobject", in, false);
aoType.setAoConfigProps(aoProps);
if (def.getAdminObjects() == null)
def.setAdminObjects(new ArrayList<AdminObjectType>());
def.getAdminObjects().add(aoType);
System.out.print(rb.getString("gen.adminobject.other") + " " + rb.getString("yesno") + " [N]: ");
String genAoAgain = in.readLine();
if (genAoAgain == null)
numOfAo = -1;
else
{
if (genAoAgain.equals("Y") || genAoAgain.equals("y") || genAoAgain.equals("Yes"))
numOfAo++;
else
numOfAo = -1;
}
}
if (!def.getVersion().equals("1.0") &&
def.isSupportOutbound() &&
!def.getMcfDefs().get(0).isUseCciConnection())
{
//generate mbean classes
System.out.print(rb.getString("gen.mbean") + " " + rb.getString("yesno") + " [Y]: ");
String genMbean = in.readLine();
if (genMbean == null)
def.setGenMbean(true);
else
{
if (genMbean.equals("N") || genMbean.equals("n") || genMbean.equals("No"))
def.setGenMbean(false);
else
def.setGenMbean(true);
}
//generate eis test server support
System.out.print(rb.getString("gen.eis") + " " + rb.getString("yesno") + " [N]: ");
String genEis = in.readLine();
if (genEis == null)
def.setSupportEis(false);
else
{
if (genEis.equals("Y") || genEis.equals("y") || genEis.equals("Yes"))
def.setSupportEis(true);
else
def.setSupportEis(false);
}
if (def.isSupportEis())
{
//add default host and post for eis server
if (def.getMcfDefs().get(0).getMcfConfigProps() == null)
{
def.getMcfDefs().get(0).setMcfConfigProps(new ArrayList<ConfigPropType>());
}
List<ConfigPropType> props = def.getMcfDefs().get(0).getMcfConfigProps();
ConfigPropType host = new ConfigPropType("host", "String", "localhost", false);
props.add(host);
ConfigPropType port = new ConfigPropType("port", "Integer", "1400", false);
props.add(port);
}
}
//generate logging support
System.out.print(rb.getString("support.jbosslogging") + " " + rb.getString("yesno") + " [N]: ");
String supportJbossLogging = in.readLine();
if (supportJbossLogging == null)
def.setSupportJbossLogging(false);
else
{
if (supportJbossLogging.equals("Y") || supportJbossLogging.equals("y") || supportJbossLogging.equals("Yes"))
def.setSupportJbossLogging(true);
else
def.setSupportJbossLogging(false);
}
//build environment
System.out.print(rb.getString("build.env") + " " + rb.getString("build.env.values"));
System.out.print(" [" + def.getBuild() + "]: ");
String buildEnv = in.readLine();
if (buildEnv != null && !buildEnv.equals(""))
{
if (buildEnv.equalsIgnoreCase("i") ||
buildEnv.equalsIgnoreCase("ant+ivy") ||
buildEnv.equalsIgnoreCase("ivy"))
{
def.setBuild("ivy");
}
else if (buildEnv.equalsIgnoreCase("m") || buildEnv.equalsIgnoreCase("maven"))
{
def.setBuild("maven");
}
else if (buildEnv.equalsIgnoreCase("g") || buildEnv.equalsIgnoreCase("gradle"))
{
def.setBuild("gradle");
}
else
def.setBuild("ant");
}
else
def.setBuild("ant");
return def;
} | class class_name[name] begin[{]
method[inputFromCommandLine, return_type[type[Definition]], modifier[private static], parameter[]] begin[{]
local_variable[type[BufferedReader], in]
local_variable[type[Definition], def]
local_variable[type[Set], classes]
local_variable[type[String], version]
do[binary_operation[binary_operation[binary_operation[call[version.equals, parameter[literal["1.7"]]], ||, call[version.equals, parameter[literal["1.6"]]]], ||, call[version.equals, parameter[literal["1.5"]]]], ||, call[version.equals, parameter[literal["1.0"]]]]] begin[{]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["profile.version"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["profile.version.values"]]]], +, literal[" [1.7]: "]]]]
assign[member[.version], call[in.readLine, parameter[]]]
if[binary_operation[binary_operation[member[.version], ==, literal[null]], ||, call[version.equals, parameter[literal[""]]]]] begin[{]
assign[member[.version], literal["1.7"]]
else begin[{]
None
end[}]
end[}]
call[def.setVersion, parameter[member[.version]]]
call[def.setSupportOutbound, parameter[literal[true]]]
call[def.setSupportInbound, parameter[literal[false]]]
if[call[version.equals, parameter[literal["1.0"]]]] begin[{]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["support.bound"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["support.bound.values"]]]], +, literal[" [O]: "]]]]
local_variable[type[String], bound]
if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.bound], ==, literal[null]], ||, call[bound.equals, parameter[literal[""]]]], ||, call[bound.equals, parameter[literal["O"]]]], ||, call[bound.equals, parameter[literal["o"]]]], ||, call[bound.equals, parameter[literal["Outbound"]]]]] begin[{]
else begin[{]
if[binary_operation[binary_operation[call[bound.equals, parameter[literal["I"]]], ||, call[bound.equals, parameter[literal["i"]]]], ||, call[bound.equals, parameter[literal["Inbound"]]]]] begin[{]
call[def.setSupportOutbound, parameter[literal[false]]]
call[def.setSupportInbound, parameter[literal[true]]]
else begin[{]
if[binary_operation[binary_operation[call[bound.equals, parameter[literal["B"]]], ||, call[bound.equals, parameter[literal["b"]]]], ||, call[bound.equals, parameter[literal["Bidirectional"]]]]] begin[{]
call[def.setSupportOutbound, parameter[literal[true]]]
call[def.setSupportInbound, parameter[literal[true]]]
else begin[{]
None
end[}]
end[}]
end[}]
else begin[{]
None
end[}]
local_variable[type[String], packageName]
do[literal[true]] begin[{]
call[System.out.print, parameter[binary_operation[call[rb.getString, parameter[literal["package.name"]]], +, literal[": "]]]]
assign[member[.packageName], call[in.readLine, parameter[]]]
if[binary_operation[call[packageName.contains, parameter[literal["."]]], &&, call[Pattern.matches, parameter[member[.PACKAGE_NAME_PATTERN], member[.packageName]]]]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
call[System.out.println, parameter[call[rb.getString, parameter[literal["package.name.validated"]]]]]
end[}]
call[def.setRaPackage, parameter[member[.packageName]]]
if[call[def.isSupportOutbound, parameter[]]] begin[{]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["support.transaction"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["support.transaction.values"]]]], +, literal[" [N]: "]]]]
local_variable[type[String], trans]
if[binary_operation[binary_operation[member[.trans], ==, literal[null]], ||, call[trans.equals, parameter[literal[""]]]]] begin[{]
call[def.setSupportTransaction, parameter[literal["NoTransaction"]]]
else begin[{]
if[binary_operation[binary_operation[call[trans.equals, parameter[literal["L"]]], ||, call[trans.equals, parameter[literal["l"]]]], ||, call[trans.equals, parameter[literal["LocalTransaction"]]]]] begin[{]
call[def.setSupportTransaction, parameter[literal["LocalTransaction"]]]
else begin[{]
if[binary_operation[binary_operation[call[trans.equals, parameter[literal["X"]]], ||, call[trans.equals, parameter[literal["x"]]]], ||, call[trans.equals, parameter[literal["XATransaction"]]]]] begin[{]
call[def.setSupportTransaction, parameter[literal["XATransaction"]]]
else begin[{]
call[def.setSupportTransaction, parameter[literal["NoTransaction"]]]
end[}]
end[}]
end[}]
else begin[{]
None
end[}]
if[binary_operation[call[def.isSupportOutbound, parameter[]], &&, call[version.equals, parameter[literal["1.0"]]]]] begin[{]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["support.reauthentication"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["yesno"]]]], +, literal[" [N]: "]]]]
local_variable[type[String], reauth]
if[binary_operation[binary_operation[member[.reauth], ==, literal[null]], ||, call[reauth.equals, parameter[literal[""]]]]] begin[{]
call[def.setSupportReauthen, parameter[literal[false]]]
else begin[{]
if[binary_operation[binary_operation[call[reauth.equals, parameter[literal["Y"]]], ||, call[reauth.equals, parameter[literal["y"]]]], ||, call[reauth.equals, parameter[literal["Yes"]]]]] begin[{]
call[def.setSupportReauthen, parameter[literal[true]]]
else begin[{]
call[def.setSupportReauthen, parameter[literal[false]]]
end[}]
end[}]
else begin[{]
None
end[}]
if[binary_operation[call[version.equals, parameter[literal["1.7"]]], ||, call[version.equals, parameter[literal["1.6"]]]]] begin[{]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["use.annotation"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["yesno"]]]], +, literal[" [Y]: "]]]]
local_variable[type[String], useAnnotation]
if[binary_operation[member[.useAnnotation], ==, literal[null]]] begin[{]
call[def.setUseAnnotation, parameter[literal[true]]]
else begin[{]
if[binary_operation[binary_operation[call[useAnnotation.equals, parameter[literal["N"]]], ||, call[useAnnotation.equals, parameter[literal["n"]]]], ||, call[useAnnotation.equals, parameter[literal["No"]]]]] begin[{]
call[def.setUseAnnotation, parameter[literal[false]]]
else begin[{]
call[def.setUseAnnotation, parameter[literal[true]]]
end[}]
end[}]
else begin[{]
call[def.setUseAnnotation, parameter[literal[false]]]
end[}]
if[binary_operation[binary_operation[call[def.isSupportOutbound, parameter[]], &&, call[def.isSupportInbound, parameter[]]], &&, binary_operation[binary_operation[call[version.equals, parameter[literal["1.7"]]], ||, call[version.equals, parameter[literal["1.6"]]]], ||, call[version.equals, parameter[literal["1.5"]]]]]] begin[{]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["use.ra"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["yesno"]]]], +, literal[" [Y]: "]]]]
local_variable[type[String], useRa]
if[binary_operation[member[.useRa], ==, literal[null]]] begin[{]
call[def.setUseRa, parameter[literal[true]]]
else begin[{]
if[binary_operation[binary_operation[call[useRa.equals, parameter[literal["N"]]], ||, call[useRa.equals, parameter[literal["n"]]]], ||, call[useRa.equals, parameter[literal["No"]]]]] begin[{]
call[def.setUseRa, parameter[literal[false]]]
else begin[{]
call[def.setUseRa, parameter[literal[true]]]
end[}]
end[}]
else begin[{]
if[call[version.equals, parameter[literal["1.0"]]]] begin[{]
call[def.setUseRa, parameter[literal[false]]]
else begin[{]
call[def.setUseRa, parameter[literal[true]]]
end[}]
end[}]
if[binary_operation[call[def.isUseRa, parameter[]], ||, call[def.isSupportInbound, parameter[]]]] begin[{]
local_variable[type[String], raClassName]
do[literal[true]] begin[{]
call[System.out.print, parameter[call[rb.getString, parameter[literal["ra.class.name"]]]]]
call[System.out.print, parameter[binary_operation[binary_operation[literal[" ["], +, call[def.getRaClass, parameter[]]], +, literal["]: "]]]]
assign[member[.raClassName], call[in.readLine, parameter[]]]
if[binary_operation[binary_operation[member[.raClassName], !=, literal[null]], &&, call[raClassName.equals, parameter[literal[""]]]]] begin[{]
if[call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.raClassName]]]] begin[{]
call[System.out.println, parameter[call[rb.getString, parameter[literal["class.name.validated"]]]]]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
call[def.setRaClass, parameter[member[.raClassName]]]
call[classes.add, parameter[member[.raClassName]]]
call[.setDefaultValue, parameter[member[.def], member[.raClassName], literal["ResourceAdapter"]]]
call[.setDefaultValue, parameter[member[.def], member[.raClassName], literal["Ra"]]]
else begin[{]
None
end[}]
BreakStatement(goto=None, label=None)
end[}]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["ra.serial"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["yesno"]]]], +, literal[" [Y]: "]]]]
local_variable[type[String], raSerial]
if[binary_operation[member[.raSerial], ==, literal[null]]] begin[{]
call[def.setRaSerial, parameter[literal[true]]]
else begin[{]
if[binary_operation[binary_operation[call[raSerial.equals, parameter[literal["N"]]], ||, call[raSerial.equals, parameter[literal["n"]]]], ||, call[raSerial.equals, parameter[literal["No"]]]]] begin[{]
call[def.setRaSerial, parameter[literal[false]]]
else begin[{]
call[def.setRaSerial, parameter[literal[true]]]
end[}]
end[}]
local_variable[type[List], raProps]
call[def.setRaConfigProps, parameter[member[.raProps]]]
else begin[{]
None
end[}]
if[call[def.isSupportOutbound, parameter[]]] begin[{]
local_variable[type[List], mcfDefs]
call[def.setMcfDefs, parameter[member[.mcfDefs]]]
local_variable[type[int], mcfID]
local_variable[type[boolean], moreMcf]
do[member[.moreMcf]] begin[{]
local_variable[type[McfDef], mcfdef]
local_variable[type[String], mcfClassName]
do[binary_operation[binary_operation[call[classes.contains, parameter[member[.mcfClassName]]], ||, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.mcfClassName]]]], &&, call[mcfClassName.equals, parameter[literal[""]]]]] begin[{]
call[System.out.print, parameter[call[rb.getString, parameter[literal["mcf.class.name"]]]]]
call[System.out.print, parameter[binary_operation[binary_operation[literal[" ["], +, call[mcfdef.getMcfClass, parameter[]]], +, literal["]: "]]]]
assign[member[.mcfClassName], call[in.readLine, parameter[]]]
if[binary_operation[call[mcfClassName.equals, parameter[literal[""]]], &&, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.mcfClassName]]]]] begin[{]
call[System.out.println, parameter[call[rb.getString, parameter[literal["class.name.validated"]]]]]
else begin[{]
None
end[}]
end[}]
call[classes.add, parameter[member[.mcfClassName]]]
if[call[mcfClassName.equals, parameter[literal[""]]]] begin[{]
call[mcfdef.setMcfClass, parameter[member[.mcfClassName]]]
call[.setDefaultValue, parameter[member[.def], member[.mcfClassName], literal["ManagedConnectionFactory"]]]
call[.setDefaultValue, parameter[member[.def], member[.mcfClassName], literal["Mcf"]]]
else begin[{]
None
end[}]
local_variable[type[List], mcfProps]
call[mcfdef.setMcfConfigProps, parameter[member[.mcfProps]]]
if[call[def.isUseRa, parameter[]]] begin[{]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["mcf.impl.raa"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["yesno"]]]], +, literal[" [Y]: "]]]]
local_variable[type[String], raAssociation]
if[binary_operation[binary_operation[member[.raAssociation], ==, literal[null]], ||, call[raAssociation.equals, parameter[literal[""]]]]] begin[{]
call[mcfdef.setImplRaAssociation, parameter[literal[true]]]
else begin[{]
if[binary_operation[binary_operation[call[raAssociation.equals, parameter[literal["Y"]]], ||, call[raAssociation.equals, parameter[literal["y"]]]], ||, call[raAssociation.equals, parameter[literal["Yes"]]]]] begin[{]
call[mcfdef.setImplRaAssociation, parameter[literal[true]]]
else begin[{]
call[mcfdef.setImplRaAssociation, parameter[literal[false]]]
end[}]
end[}]
else begin[{]
None
end[}]
local_variable[type[String], mcClassName]
do[binary_operation[binary_operation[call[classes.contains, parameter[member[.mcClassName]]], ||, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.mcClassName]]]], &&, call[mcClassName.equals, parameter[literal[""]]]]] begin[{]
call[System.out.print, parameter[call[rb.getString, parameter[literal["mc.class.name"]]]]]
call[System.out.print, parameter[binary_operation[binary_operation[literal[" ["], +, call[mcfdef.getMcClass, parameter[]]], +, literal["]: "]]]]
assign[member[.mcClassName], call[in.readLine, parameter[]]]
if[binary_operation[call[mcClassName.equals, parameter[literal[""]]], &&, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.mcClassName]]]]] begin[{]
call[System.out.println, parameter[call[rb.getString, parameter[literal["class.name.validated"]]]]]
else begin[{]
None
end[}]
end[}]
call[classes.add, parameter[member[.mcClassName]]]
if[binary_operation[binary_operation[member[.mcClassName], !=, literal[null]], &&, call[mcClassName.equals, parameter[literal[""]]]]] begin[{]
call[mcfdef.setMcClass, parameter[member[.mcClassName]]]
else begin[{]
None
end[}]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["mcf.use.cci"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["yesno"]]]], +, literal[" [N]: "]]]]
local_variable[type[String], useCciConnection]
if[binary_operation[member[.useCciConnection], ==, literal[null]]] begin[{]
call[mcfdef.setUseCciConnection, parameter[literal[false]]]
else begin[{]
if[binary_operation[binary_operation[call[useCciConnection.equals, parameter[literal["Y"]]], ||, call[useCciConnection.equals, parameter[literal["y"]]]], ||, call[useCciConnection.equals, parameter[literal["Yes"]]]]] begin[{]
call[mcfdef.setUseCciConnection, parameter[literal[true]]]
else begin[{]
call[mcfdef.setUseCciConnection, parameter[literal[false]]]
end[}]
end[}]
if[call[mcfdef.isUseCciConnection, parameter[]]] begin[{]
local_variable[type[String], cfInterfaceName]
do[binary_operation[binary_operation[call[classes.contains, parameter[member[.cfInterfaceName]]], ||, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.cfInterfaceName]]]], &&, call[cfInterfaceName.equals, parameter[literal[""]]]]] begin[{]
call[System.out.print, parameter[call[rb.getString, parameter[literal["cf.interface.name"]]]]]
call[System.out.print, parameter[binary_operation[binary_operation[literal[" ["], +, call[mcfdef.getCfInterfaceClass, parameter[]]], +, literal["]: "]]]]
assign[member[.cfInterfaceName], call[in.readLine, parameter[]]]
if[binary_operation[call[cfInterfaceName.equals, parameter[literal[""]]], &&, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.cfInterfaceName]]]]] begin[{]
call[System.out.println, parameter[call[rb.getString, parameter[literal["class.name.validated"]]]]]
else begin[{]
None
end[}]
end[}]
call[classes.add, parameter[member[.cfInterfaceName]]]
if[binary_operation[binary_operation[member[.cfInterfaceName], !=, literal[null]], &&, call[cfInterfaceName.equals, parameter[literal[""]]]]] begin[{]
call[mcfdef.setCfInterfaceClass, parameter[member[.cfInterfaceName]]]
else begin[{]
None
end[}]
local_variable[type[String], cfClassName]
do[binary_operation[binary_operation[call[classes.contains, parameter[member[.cfClassName]]], ||, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.cfClassName]]]], &&, call[cfClassName.equals, parameter[literal[""]]]]] begin[{]
call[System.out.print, parameter[call[rb.getString, parameter[literal["cf.class.name"]]]]]
call[System.out.print, parameter[binary_operation[binary_operation[literal[" ["], +, call[mcfdef.getCfClass, parameter[]]], +, literal["]: "]]]]
assign[member[.cfClassName], call[in.readLine, parameter[]]]
if[binary_operation[call[cfClassName.equals, parameter[literal[""]]], &&, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.cfClassName]]]]] begin[{]
call[System.out.println, parameter[call[rb.getString, parameter[literal["class.name.validated"]]]]]
else begin[{]
None
end[}]
end[}]
call[classes.add, parameter[member[.cfClassName]]]
if[binary_operation[binary_operation[member[.cfClassName], !=, literal[null]], &&, call[cfClassName.equals, parameter[literal[""]]]]] begin[{]
call[mcfdef.setCfClass, parameter[member[.cfClassName]]]
else begin[{]
None
end[}]
local_variable[type[String], connInterfaceName]
do[binary_operation[binary_operation[call[classes.contains, parameter[member[.connInterfaceName]]], ||, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.connInterfaceName]]]], &&, call[connInterfaceName.equals, parameter[literal[""]]]]] begin[{]
call[System.out.print, parameter[call[rb.getString, parameter[literal["conn.interface.name"]]]]]
call[System.out.print, parameter[binary_operation[binary_operation[literal[" ["], +, call[mcfdef.getConnInterfaceClass, parameter[]]], +, literal["]: "]]]]
assign[member[.connInterfaceName], call[in.readLine, parameter[]]]
if[binary_operation[call[connInterfaceName.equals, parameter[literal[""]]], &&, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.connInterfaceName]]]]] begin[{]
call[System.out.println, parameter[call[rb.getString, parameter[literal["class.name.validated"]]]]]
else begin[{]
None
end[}]
end[}]
call[classes.add, parameter[member[.connInterfaceName]]]
if[binary_operation[binary_operation[member[.connInterfaceName], !=, literal[null]], &&, call[connInterfaceName.equals, parameter[literal[""]]]]] begin[{]
call[mcfdef.setConnInterfaceClass, parameter[member[.connInterfaceName]]]
else begin[{]
None
end[}]
local_variable[type[String], connImplName]
do[binary_operation[binary_operation[call[classes.contains, parameter[member[.connImplName]]], ||, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.connImplName]]]], &&, call[connImplName.equals, parameter[literal[""]]]]] begin[{]
call[System.out.print, parameter[call[rb.getString, parameter[literal["conn.class.name"]]]]]
call[System.out.print, parameter[binary_operation[binary_operation[literal[" ["], +, call[mcfdef.getConnImplClass, parameter[]]], +, literal["]: "]]]]
assign[member[.connImplName], call[in.readLine, parameter[]]]
if[binary_operation[call[connImplName.equals, parameter[literal[""]]], &&, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.connImplName]]]]] begin[{]
call[System.out.println, parameter[call[rb.getString, parameter[literal["class.name.validated"]]]]]
else begin[{]
None
end[}]
end[}]
call[classes.add, parameter[member[.connImplName]]]
if[binary_operation[binary_operation[member[.connImplName], !=, literal[null]], &&, call[connImplName.equals, parameter[literal[""]]]]] begin[{]
call[mcfdef.setConnImplClass, parameter[member[.connImplName]]]
else begin[{]
None
end[}]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["connection.method.support"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["yesno"]]]], +, literal[" [N]: "]]]]
local_variable[type[String], supportMethod]
if[binary_operation[member[.supportMethod], ==, literal[null]]] begin[{]
call[mcfdef.setDefineMethodInConnection, parameter[literal[false]]]
else begin[{]
if[binary_operation[binary_operation[call[supportMethod.equals, parameter[literal["Y"]]], ||, call[supportMethod.equals, parameter[literal["y"]]]], ||, call[supportMethod.equals, parameter[literal["Yes"]]]]] begin[{]
call[mcfdef.setDefineMethodInConnection, parameter[literal[true]]]
else begin[{]
call[mcfdef.setDefineMethodInConnection, parameter[literal[false]]]
end[}]
end[}]
if[call[mcfdef.isDefineMethodInConnection, parameter[]]] begin[{]
call[mcfdef.setMethods, parameter[call[.inputMethod, parameter[member[.in]]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[mcfDefs.add, parameter[member[.mcfdef]]]
member[.mcfID]
assign[member[.moreMcf], literal[false]]
if[binary_operation[binary_operation[call[def.getVersion, parameter[]], ||, call[def.getVersion, parameter[]]], ||, call[def.getVersion, parameter[]]]] begin[{]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["more.mcf"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["yesno"]]]], +, literal[" [N]: "]]]]
local_variable[type[String], inputMoreMcf]
if[binary_operation[binary_operation[member[.inputMoreMcf], !=, literal[null]], &&, binary_operation[binary_operation[call[inputMoreMcf.equals, parameter[literal["Y"]]], ||, call[inputMoreMcf.equals, parameter[literal["y"]]]], ||, call[inputMoreMcf.equals, parameter[literal["Yes"]]]]]] begin[{]
assign[member[.moreMcf], literal[true]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
if[call[def.isSupportInbound, parameter[]]] begin[{]
local_variable[type[String], mlClassName]
do[binary_operation[binary_operation[call[classes.contains, parameter[member[.mlClassName]]], ||, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.mlClassName]]]], &&, call[mlClassName.equals, parameter[literal[""]]]]] begin[{]
call[System.out.print, parameter[call[rb.getString, parameter[literal["ml.interface.name"]]]]]
call[System.out.print, parameter[binary_operation[binary_operation[literal[" ["], +, call[def.getMlClass, parameter[]]], +, literal["]: "]]]]
assign[member[.mlClassName], call[in.readLine, parameter[]]]
if[binary_operation[call[mlClassName.equals, parameter[literal[""]]], &&, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.mlClassName]]]]] begin[{]
call[System.out.println, parameter[call[rb.getString, parameter[literal["class.name.validated"]]]]]
else begin[{]
None
end[}]
end[}]
call[classes.add, parameter[member[.mlClassName]]]
local_variable[type[boolean], defaultPackage]
if[binary_operation[binary_operation[member[.mlClassName], !=, literal[null]], &&, call[mlClassName.equals, parameter[literal[""]]]]] begin[{]
call[def.setMlClass, parameter[member[.mlClassName]]]
if[call[mlClassName.contains, parameter[literal["."]]]] begin[{]
assign[member[.defaultPackage], literal[false]]
else begin[{]
call[.setDefaultValue, parameter[member[.def], member[.mlClassName], literal["MessageListener"]]]
call[.setDefaultValue, parameter[member[.def], member[.mlClassName], literal["Ml"]]]
end[}]
else begin[{]
None
end[}]
call[def.setDefaultPackageInbound, parameter[member[.defaultPackage]]]
local_variable[type[String], asClassName]
do[binary_operation[binary_operation[call[classes.contains, parameter[member[.asClassName]]], ||, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.asClassName]]]], &&, call[asClassName.equals, parameter[literal[""]]]]] begin[{]
call[System.out.print, parameter[call[rb.getString, parameter[literal["as.class.name"]]]]]
call[System.out.print, parameter[binary_operation[binary_operation[literal[" ["], +, call[def.getAsClass, parameter[]]], +, literal["]: "]]]]
assign[member[.asClassName], call[in.readLine, parameter[]]]
if[binary_operation[call[asClassName.equals, parameter[literal[""]]], &&, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.asClassName]]]]] begin[{]
call[System.out.println, parameter[call[rb.getString, parameter[literal["class.name.validated"]]]]]
else begin[{]
None
end[}]
end[}]
call[classes.add, parameter[member[.asClassName]]]
if[binary_operation[binary_operation[member[.asClassName], !=, literal[null]], &&, call[asClassName.equals, parameter[literal[""]]]]] begin[{]
call[def.setAsClass, parameter[member[.asClassName]]]
else begin[{]
None
end[}]
local_variable[type[List], asProps]
call[def.setAsConfigProps, parameter[member[.asProps]]]
local_variable[type[String], actiClassName]
do[binary_operation[binary_operation[call[classes.contains, parameter[member[.actiClassName]]], ||, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.actiClassName]]]], &&, call[actiClassName.equals, parameter[literal[""]]]]] begin[{]
call[System.out.print, parameter[call[rb.getString, parameter[literal["acti.class.name"]]]]]
call[System.out.print, parameter[binary_operation[binary_operation[literal[" ["], +, call[def.getActivationClass, parameter[]]], +, literal["]: "]]]]
assign[member[.actiClassName], call[in.readLine, parameter[]]]
if[binary_operation[call[actiClassName.equals, parameter[literal[""]]], &&, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.actiClassName]]]]] begin[{]
call[System.out.println, parameter[call[rb.getString, parameter[literal["class.name.validated"]]]]]
else begin[{]
None
end[}]
end[}]
call[classes.add, parameter[member[.actiClassName]]]
if[binary_operation[binary_operation[member[.actiClassName], !=, literal[null]], &&, call[actiClassName.equals, parameter[literal[""]]]]] begin[{]
call[def.setActivationClass, parameter[member[.actiClassName]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["gen.adminobject"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["yesno"]]]], +, literal[" [N]: "]]]]
local_variable[type[String], genAo]
if[binary_operation[member[.genAo], ==, literal[null]]] begin[{]
call[def.setGenAdminObject, parameter[literal[false]]]
else begin[{]
if[binary_operation[binary_operation[call[genAo.equals, parameter[literal["Y"]]], ||, call[genAo.equals, parameter[literal["y"]]]], ||, call[genAo.equals, parameter[literal["Yes"]]]]] begin[{]
call[def.setGenAdminObject, parameter[literal[true]]]
else begin[{]
call[def.setGenAdminObject, parameter[literal[false]]]
end[}]
end[}]
if[call[def.isGenAdminObject, parameter[]]] begin[{]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["adminobject.raa"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["yesno"]]]], +, literal[" [Y]: "]]]]
local_variable[type[String], aoRaAssociation]
if[binary_operation[binary_operation[member[.aoRaAssociation], ==, literal[null]], ||, call[aoRaAssociation.equals, parameter[literal[""]]]]] begin[{]
call[def.setAdminObjectImplRaAssociation, parameter[literal[true]]]
else begin[{]
if[binary_operation[binary_operation[call[aoRaAssociation.equals, parameter[literal["Y"]]], ||, call[aoRaAssociation.equals, parameter[literal["y"]]]], ||, call[aoRaAssociation.equals, parameter[literal["Yes"]]]]] begin[{]
call[def.setAdminObjectImplRaAssociation, parameter[literal[true]]]
else begin[{]
call[def.setAdminObjectImplRaAssociation, parameter[literal[false]]]
end[}]
end[}]
else begin[{]
None
end[}]
local_variable[type[int], numOfAo]
while[binary_operation[binary_operation[member[.numOfAo], >=, literal[0]], &&, call[def.isGenAdminObject, parameter[]]]] begin[{]
local_variable[type[String], strOrder]
local_variable[type[AdminObjectType], aoType]
local_variable[type[String], aoInterfaceName]
do[binary_operation[binary_operation[call[classes.contains, parameter[member[.aoInterfaceName]]], ||, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.aoInterfaceName]]]], &&, call[aoInterfaceName.equals, parameter[literal[""]]]]] begin[{]
call[System.out.print, parameter[call[rb.getString, parameter[literal["adminobject.interface.name"]]]]]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[literal[" ["], +, call[def.getDefaultValue, parameter[]]], +, member[.strOrder]], +, literal["AdminObject]: "]]]]
assign[member[.aoInterfaceName], call[in.readLine, parameter[]]]
if[binary_operation[call[aoInterfaceName.equals, parameter[literal[""]]], &&, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.aoInterfaceName]]]]] begin[{]
call[System.out.println, parameter[call[rb.getString, parameter[literal["class.name.validated"]]]]]
else begin[{]
None
end[}]
end[}]
call[classes.add, parameter[member[.aoInterfaceName]]]
if[binary_operation[binary_operation[member[.aoInterfaceName], !=, literal[null]], &&, call[aoInterfaceName.equals, parameter[literal[""]]]]] begin[{]
call[aoType.setAdminObjectInterface, parameter[member[.aoInterfaceName]]]
else begin[{]
call[aoType.setAdminObjectInterface, parameter[binary_operation[binary_operation[call[def.getDefaultValue, parameter[]], +, member[.strOrder]], +, literal["AdminObject"]]]]
end[}]
local_variable[type[String], aoClassName]
do[binary_operation[binary_operation[call[classes.contains, parameter[member[.aoClassName]]], ||, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.aoClassName]]]], &&, call[aoClassName.equals, parameter[literal[""]]]]] begin[{]
call[System.out.print, parameter[call[rb.getString, parameter[literal["adminobject.class.name"]]]]]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[literal[" ["], +, call[def.getDefaultValue, parameter[]]], +, member[.strOrder]], +, literal["AdminObjectImpl]: "]]]]
assign[member[.aoClassName], call[in.readLine, parameter[]]]
if[binary_operation[call[aoClassName.equals, parameter[literal[""]]], &&, call[Pattern.matches, parameter[member[.CLASS_NAME_PATTERN], member[.aoClassName]]]]] begin[{]
call[System.out.println, parameter[call[rb.getString, parameter[literal["class.name.validated"]]]]]
else begin[{]
None
end[}]
end[}]
call[classes.add, parameter[member[.aoClassName]]]
if[binary_operation[binary_operation[member[.aoClassName], !=, literal[null]], &&, call[aoClassName.equals, parameter[literal[""]]]]] begin[{]
call[aoType.setAdminObjectClass, parameter[member[.aoClassName]]]
else begin[{]
call[aoType.setAdminObjectClass, parameter[binary_operation[binary_operation[call[def.getDefaultValue, parameter[]], +, member[.strOrder]], +, literal["AdminObjectImpl"]]]]
end[}]
local_variable[type[List], aoProps]
call[aoType.setAoConfigProps, parameter[member[.aoProps]]]
if[binary_operation[call[def.getAdminObjects, parameter[]], ==, literal[null]]] begin[{]
call[def.setAdminObjects, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AdminObjectType, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]]
else begin[{]
None
end[}]
call[def.getAdminObjects, parameter[]]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["gen.adminobject.other"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["yesno"]]]], +, literal[" [N]: "]]]]
local_variable[type[String], genAoAgain]
if[binary_operation[member[.genAoAgain], ==, literal[null]]] begin[{]
assign[member[.numOfAo], literal[1]]
else begin[{]
if[binary_operation[binary_operation[call[genAoAgain.equals, parameter[literal["Y"]]], ||, call[genAoAgain.equals, parameter[literal["y"]]]], ||, call[genAoAgain.equals, parameter[literal["Yes"]]]]] begin[{]
member[.numOfAo]
else begin[{]
assign[member[.numOfAo], literal[1]]
end[}]
end[}]
end[}]
if[binary_operation[binary_operation[call[def.getVersion, parameter[]], &&, call[def.isSupportOutbound, parameter[]]], &&, call[def.getMcfDefs, parameter[]]]] begin[{]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["gen.mbean"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["yesno"]]]], +, literal[" [Y]: "]]]]
local_variable[type[String], genMbean]
if[binary_operation[member[.genMbean], ==, literal[null]]] begin[{]
call[def.setGenMbean, parameter[literal[true]]]
else begin[{]
if[binary_operation[binary_operation[call[genMbean.equals, parameter[literal["N"]]], ||, call[genMbean.equals, parameter[literal["n"]]]], ||, call[genMbean.equals, parameter[literal["No"]]]]] begin[{]
call[def.setGenMbean, parameter[literal[false]]]
else begin[{]
call[def.setGenMbean, parameter[literal[true]]]
end[}]
end[}]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["gen.eis"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["yesno"]]]], +, literal[" [N]: "]]]]
local_variable[type[String], genEis]
if[binary_operation[member[.genEis], ==, literal[null]]] begin[{]
call[def.setSupportEis, parameter[literal[false]]]
else begin[{]
if[binary_operation[binary_operation[call[genEis.equals, parameter[literal["Y"]]], ||, call[genEis.equals, parameter[literal["y"]]]], ||, call[genEis.equals, parameter[literal["Yes"]]]]] begin[{]
call[def.setSupportEis, parameter[literal[true]]]
else begin[{]
call[def.setSupportEis, parameter[literal[false]]]
end[}]
end[}]
if[call[def.isSupportEis, parameter[]]] begin[{]
if[binary_operation[call[def.getMcfDefs, parameter[]], ==, literal[null]]] begin[{]
call[def.getMcfDefs, parameter[]]
else begin[{]
None
end[}]
local_variable[type[List], props]
local_variable[type[ConfigPropType], host]
call[props.add, parameter[member[.host]]]
local_variable[type[ConfigPropType], port]
call[props.add, parameter[member[.port]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[call[rb.getString, parameter[literal["support.jbosslogging"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["yesno"]]]], +, literal[" [N]: "]]]]
local_variable[type[String], supportJbossLogging]
if[binary_operation[member[.supportJbossLogging], ==, literal[null]]] begin[{]
call[def.setSupportJbossLogging, parameter[literal[false]]]
else begin[{]
if[binary_operation[binary_operation[call[supportJbossLogging.equals, parameter[literal["Y"]]], ||, call[supportJbossLogging.equals, parameter[literal["y"]]]], ||, call[supportJbossLogging.equals, parameter[literal["Yes"]]]]] begin[{]
call[def.setSupportJbossLogging, parameter[literal[true]]]
else begin[{]
call[def.setSupportJbossLogging, parameter[literal[false]]]
end[}]
end[}]
call[System.out.print, parameter[binary_operation[binary_operation[call[rb.getString, parameter[literal["build.env"]]], +, literal[" "]], +, call[rb.getString, parameter[literal["build.env.values"]]]]]]
call[System.out.print, parameter[binary_operation[binary_operation[literal[" ["], +, call[def.getBuild, parameter[]]], +, literal["]: "]]]]
local_variable[type[String], buildEnv]
if[binary_operation[binary_operation[member[.buildEnv], !=, literal[null]], &&, call[buildEnv.equals, parameter[literal[""]]]]] begin[{]
if[binary_operation[binary_operation[call[buildEnv.equalsIgnoreCase, parameter[literal["i"]]], ||, call[buildEnv.equalsIgnoreCase, parameter[literal["ant+ivy"]]]], ||, call[buildEnv.equalsIgnoreCase, parameter[literal["ivy"]]]]] begin[{]
call[def.setBuild, parameter[literal["ivy"]]]
else begin[{]
if[binary_operation[call[buildEnv.equalsIgnoreCase, parameter[literal["m"]]], ||, call[buildEnv.equalsIgnoreCase, parameter[literal["maven"]]]]] begin[{]
call[def.setBuild, parameter[literal["maven"]]]
else begin[{]
if[binary_operation[call[buildEnv.equalsIgnoreCase, parameter[literal["g"]]], ||, call[buildEnv.equalsIgnoreCase, parameter[literal["gradle"]]]]] begin[{]
call[def.setBuild, parameter[literal["gradle"]]]
else begin[{]
call[def.setBuild, parameter[literal["ant"]]]
end[}]
end[}]
end[}]
else begin[{]
call[def.setBuild, parameter[literal["ant"]]]
end[}]
return[member[.def]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Definition] identifier[inputFromCommandLine] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[BufferedReader] identifier[in] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[System] operator[SEP] identifier[in] operator[SEP] operator[SEP] operator[SEP] identifier[Definition] identifier[def] operator[=] Keyword[new] identifier[Definition] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[classes] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[version] operator[SEP] Keyword[do] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[version] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[version] operator[==] Other[null] operator[||] identifier[version] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[version] operator[=] literal[String] operator[SEP]
}
Keyword[while] operator[SEP] operator[!] operator[SEP] identifier[version] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[version] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[version] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[version] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setVersion] operator[SEP] identifier[version] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setSupportOutbound] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setSupportInbound] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[version] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[bound] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bound] operator[==] Other[null] operator[||] identifier[bound] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[bound] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[bound] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[bound] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
}
Keyword[else] Keyword[if] operator[SEP] identifier[bound] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[bound] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[bound] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[def] operator[SEP] identifier[setSupportOutbound] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setSupportInbound] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[bound] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[bound] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[bound] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[def] operator[SEP] identifier[setSupportOutbound] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setSupportInbound] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
identifier[String] identifier[packageName] operator[SEP] Keyword[do] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[packageName] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[packageName] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[PACKAGE_NAME_PATTERN] , identifier[packageName] operator[SEP] operator[SEP] Keyword[break] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[while] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setRaPackage] operator[SEP] identifier[packageName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[def] operator[SEP] identifier[isSupportOutbound] operator[SEP] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[trans] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trans] operator[==] Other[null] operator[||] identifier[trans] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setSupportTransaction] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[trans] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[trans] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[trans] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[def] operator[SEP] identifier[setSupportTransaction] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[trans] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[trans] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[trans] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[def] operator[SEP] identifier[setSupportTransaction] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[def] operator[SEP] identifier[setSupportTransaction] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[def] operator[SEP] identifier[isSupportOutbound] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[version] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[reauth] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reauth] operator[==] Other[null] operator[||] identifier[reauth] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setSupportReauthen] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[reauth] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[reauth] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[reauth] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[def] operator[SEP] identifier[setSupportReauthen] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[def] operator[SEP] identifier[setSupportReauthen] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[version] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[version] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[useAnnotation] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[useAnnotation] operator[==] Other[null] operator[SEP] identifier[def] operator[SEP] identifier[setUseAnnotation] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] {
Keyword[if] operator[SEP] identifier[useAnnotation] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[useAnnotation] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[useAnnotation] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setUseAnnotation] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] identifier[def] operator[SEP] identifier[setUseAnnotation] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[def] operator[SEP] identifier[setUseAnnotation] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[def] operator[SEP] identifier[isSupportOutbound] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[def] operator[SEP] identifier[isSupportInbound] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[version] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[version] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[version] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[useRa] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[useRa] operator[==] Other[null] operator[SEP] identifier[def] operator[SEP] identifier[setUseRa] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] {
Keyword[if] operator[SEP] identifier[useRa] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[useRa] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[useRa] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setUseRa] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] identifier[def] operator[SEP] identifier[setUseRa] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[version] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[def] operator[SEP] identifier[setUseRa] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[def] operator[SEP] identifier[setUseRa] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[def] operator[SEP] identifier[isUseRa] operator[SEP] operator[SEP] operator[||] identifier[def] operator[SEP] identifier[isSupportInbound] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[raClassName] operator[SEP] Keyword[do] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[def] operator[SEP] identifier[getRaClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[raClassName] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[raClassName] operator[!=] Other[null] operator[&&] operator[!] identifier[raClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[raClassName] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
identifier[def] operator[SEP] identifier[setRaClass] operator[SEP] identifier[raClassName] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[add] operator[SEP] identifier[raClassName] operator[SEP] operator[SEP] identifier[setDefaultValue] operator[SEP] identifier[def] , identifier[raClassName] , literal[String] operator[SEP] operator[SEP] identifier[setDefaultValue] operator[SEP] identifier[def] , identifier[raClassName] , literal[String] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP]
}
Keyword[while] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[raSerial] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[raSerial] operator[==] Other[null] operator[SEP] identifier[def] operator[SEP] identifier[setRaSerial] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] {
Keyword[if] operator[SEP] identifier[raSerial] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[raSerial] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[raSerial] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setRaSerial] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] identifier[def] operator[SEP] identifier[setRaSerial] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[ConfigPropType] operator[>] identifier[raProps] operator[=] identifier[inputProperties] operator[SEP] literal[String] , identifier[in] , literal[boolean] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setRaConfigProps] operator[SEP] identifier[raProps] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[def] operator[SEP] identifier[isSupportOutbound] operator[SEP] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[McfDef] operator[>] identifier[mcfDefs] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setMcfDefs] operator[SEP] identifier[mcfDefs] operator[SEP] operator[SEP] Keyword[int] identifier[mcfID] operator[=] Other[1] operator[SEP] Keyword[boolean] identifier[moreMcf] operator[SEP] Keyword[do] {
identifier[McfDef] identifier[mcfdef] operator[=] Keyword[new] identifier[McfDef] operator[SEP] identifier[mcfID] , identifier[def] operator[SEP] operator[SEP] identifier[String] identifier[mcfClassName] operator[=] literal[String] operator[SEP] Keyword[do] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[mcfdef] operator[SEP] identifier[getMcfClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[mcfClassName] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[mcfClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[mcfClassName] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[contains] operator[SEP] identifier[mcfClassName] operator[SEP] operator[||] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[mcfClassName] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[mcfClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[add] operator[SEP] identifier[mcfClassName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[mcfClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[mcfdef] operator[SEP] identifier[setMcfClass] operator[SEP] identifier[mcfClassName] operator[SEP] operator[SEP] identifier[setDefaultValue] operator[SEP] identifier[def] , identifier[mcfClassName] , literal[String] operator[SEP] operator[SEP] identifier[setDefaultValue] operator[SEP] identifier[def] , identifier[mcfClassName] , literal[String] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[ConfigPropType] operator[>] identifier[mcfProps] operator[=] identifier[inputProperties] operator[SEP] literal[String] , identifier[in] , literal[boolean] operator[SEP] operator[SEP] identifier[mcfdef] operator[SEP] identifier[setMcfConfigProps] operator[SEP] identifier[mcfProps] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[def] operator[SEP] identifier[isUseRa] operator[SEP] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[raAssociation] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[raAssociation] operator[==] Other[null] operator[||] identifier[raAssociation] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mcfdef] operator[SEP] identifier[setImplRaAssociation] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] {
Keyword[if] operator[SEP] identifier[raAssociation] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[raAssociation] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[raAssociation] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mcfdef] operator[SEP] identifier[setImplRaAssociation] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] identifier[mcfdef] operator[SEP] identifier[setImplRaAssociation] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
identifier[String] identifier[mcClassName] operator[=] literal[String] operator[SEP] Keyword[do] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[mcfdef] operator[SEP] identifier[getMcClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[mcClassName] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[mcClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[mcClassName] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[contains] operator[SEP] identifier[mcClassName] operator[SEP] operator[||] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[mcClassName] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[mcClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[add] operator[SEP] identifier[mcClassName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mcClassName] operator[!=] Other[null] operator[&&] operator[!] identifier[mcClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mcfdef] operator[SEP] identifier[setMcClass] operator[SEP] identifier[mcClassName] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[useCciConnection] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[useCciConnection] operator[==] Other[null] operator[SEP] identifier[mcfdef] operator[SEP] identifier[setUseCciConnection] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] {
Keyword[if] operator[SEP] identifier[useCciConnection] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[useCciConnection] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[useCciConnection] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mcfdef] operator[SEP] identifier[setUseCciConnection] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] identifier[mcfdef] operator[SEP] identifier[setUseCciConnection] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[mcfdef] operator[SEP] identifier[isUseCciConnection] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[cfInterfaceName] operator[=] literal[String] operator[SEP] Keyword[do] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[mcfdef] operator[SEP] identifier[getCfInterfaceClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[cfInterfaceName] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[cfInterfaceName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[cfInterfaceName] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[contains] operator[SEP] identifier[cfInterfaceName] operator[SEP] operator[||] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[cfInterfaceName] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[cfInterfaceName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[add] operator[SEP] identifier[cfInterfaceName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cfInterfaceName] operator[!=] Other[null] operator[&&] operator[!] identifier[cfInterfaceName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mcfdef] operator[SEP] identifier[setCfInterfaceClass] operator[SEP] identifier[cfInterfaceName] operator[SEP] operator[SEP] identifier[String] identifier[cfClassName] operator[=] literal[String] operator[SEP] Keyword[do] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[mcfdef] operator[SEP] identifier[getCfClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[cfClassName] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[cfClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[cfClassName] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[contains] operator[SEP] identifier[cfClassName] operator[SEP] operator[||] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[cfClassName] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[cfClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[add] operator[SEP] identifier[cfClassName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cfClassName] operator[!=] Other[null] operator[&&] operator[!] identifier[cfClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mcfdef] operator[SEP] identifier[setCfClass] operator[SEP] identifier[cfClassName] operator[SEP] operator[SEP] identifier[String] identifier[connInterfaceName] operator[=] literal[String] operator[SEP] Keyword[do] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[mcfdef] operator[SEP] identifier[getConnInterfaceClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[connInterfaceName] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[connInterfaceName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[connInterfaceName] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[contains] operator[SEP] identifier[connInterfaceName] operator[SEP] operator[||] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[connInterfaceName] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[connInterfaceName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[add] operator[SEP] identifier[connInterfaceName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[connInterfaceName] operator[!=] Other[null] operator[&&] operator[!] identifier[connInterfaceName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mcfdef] operator[SEP] identifier[setConnInterfaceClass] operator[SEP] identifier[connInterfaceName] operator[SEP] operator[SEP] identifier[String] identifier[connImplName] operator[=] literal[String] operator[SEP] Keyword[do] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[mcfdef] operator[SEP] identifier[getConnImplClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[connImplName] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[connImplName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[connImplName] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[contains] operator[SEP] identifier[connImplName] operator[SEP] operator[||] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[connImplName] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[connImplName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[add] operator[SEP] identifier[connImplName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[connImplName] operator[!=] Other[null] operator[&&] operator[!] identifier[connImplName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mcfdef] operator[SEP] identifier[setConnImplClass] operator[SEP] identifier[connImplName] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[supportMethod] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[supportMethod] operator[==] Other[null] operator[SEP] identifier[mcfdef] operator[SEP] identifier[setDefineMethodInConnection] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] {
Keyword[if] operator[SEP] identifier[supportMethod] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[supportMethod] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[supportMethod] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mcfdef] operator[SEP] identifier[setDefineMethodInConnection] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] identifier[mcfdef] operator[SEP] identifier[setDefineMethodInConnection] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[mcfdef] operator[SEP] identifier[isDefineMethodInConnection] operator[SEP] operator[SEP] operator[SEP] {
identifier[mcfdef] operator[SEP] identifier[setMethods] operator[SEP] identifier[inputMethod] operator[SEP] identifier[in] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[mcfDefs] operator[SEP] identifier[add] operator[SEP] identifier[mcfdef] operator[SEP] operator[SEP] identifier[mcfID] operator[++] operator[SEP] identifier[moreMcf] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[def] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[def] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[def] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[inputMoreMcf] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inputMoreMcf] operator[!=] Other[null] operator[&&] operator[SEP] identifier[inputMoreMcf] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[inputMoreMcf] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[inputMoreMcf] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[moreMcf] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[while] operator[SEP] identifier[moreMcf] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[def] operator[SEP] identifier[isSupportInbound] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[mlClassName] operator[=] literal[String] operator[SEP] Keyword[do] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[def] operator[SEP] identifier[getMlClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[mlClassName] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[mlClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[mlClassName] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[contains] operator[SEP] identifier[mlClassName] operator[SEP] operator[||] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[mlClassName] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[mlClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[add] operator[SEP] identifier[mlClassName] operator[SEP] operator[SEP] Keyword[boolean] identifier[defaultPackage] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[mlClassName] operator[!=] Other[null] operator[&&] operator[!] identifier[mlClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[def] operator[SEP] identifier[setMlClass] operator[SEP] identifier[mlClassName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mlClassName] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[defaultPackage] operator[=] literal[boolean] operator[SEP] Keyword[else] {
identifier[setDefaultValue] operator[SEP] identifier[def] , identifier[mlClassName] , literal[String] operator[SEP] operator[SEP] identifier[setDefaultValue] operator[SEP] identifier[def] , identifier[mlClassName] , literal[String] operator[SEP] operator[SEP]
}
}
identifier[def] operator[SEP] identifier[setDefaultPackageInbound] operator[SEP] identifier[defaultPackage] operator[SEP] operator[SEP] identifier[String] identifier[asClassName] operator[=] literal[String] operator[SEP] Keyword[do] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[def] operator[SEP] identifier[getAsClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[asClassName] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[asClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[asClassName] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[contains] operator[SEP] identifier[asClassName] operator[SEP] operator[||] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[asClassName] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[asClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[add] operator[SEP] identifier[asClassName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[asClassName] operator[!=] Other[null] operator[&&] operator[!] identifier[asClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setAsClass] operator[SEP] identifier[asClassName] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ConfigPropType] operator[>] identifier[asProps] operator[=] identifier[inputProperties] operator[SEP] literal[String] , identifier[in] , literal[boolean] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setAsConfigProps] operator[SEP] identifier[asProps] operator[SEP] operator[SEP] identifier[String] identifier[actiClassName] operator[=] literal[String] operator[SEP] Keyword[do] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[def] operator[SEP] identifier[getActivationClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[actiClassName] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[actiClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[actiClassName] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[contains] operator[SEP] identifier[actiClassName] operator[SEP] operator[||] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[actiClassName] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[actiClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[add] operator[SEP] identifier[actiClassName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[actiClassName] operator[!=] Other[null] operator[&&] operator[!] identifier[actiClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setActivationClass] operator[SEP] identifier[actiClassName] operator[SEP] operator[SEP]
}
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[genAo] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[genAo] operator[==] Other[null] operator[SEP] identifier[def] operator[SEP] identifier[setGenAdminObject] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] {
Keyword[if] operator[SEP] identifier[genAo] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[genAo] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[genAo] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setGenAdminObject] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] identifier[def] operator[SEP] identifier[setGenAdminObject] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[def] operator[SEP] identifier[isGenAdminObject] operator[SEP] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[aoRaAssociation] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aoRaAssociation] operator[==] Other[null] operator[||] identifier[aoRaAssociation] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setAdminObjectImplRaAssociation] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] {
Keyword[if] operator[SEP] identifier[aoRaAssociation] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[aoRaAssociation] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[aoRaAssociation] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setAdminObjectImplRaAssociation] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] identifier[def] operator[SEP] identifier[setAdminObjectImplRaAssociation] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[int] identifier[numOfAo] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[numOfAo] operator[>=] Other[0] operator[&&] identifier[def] operator[SEP] identifier[isGenAdminObject] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[strOrder] operator[=] identifier[numOfAo] operator[>] Other[0] operator[?] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[numOfAo] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[:] literal[String] operator[SEP] identifier[AdminObjectType] identifier[aoType] operator[=] Keyword[new] identifier[AdminObjectType] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[aoInterfaceName] operator[=] literal[String] operator[SEP] Keyword[do] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[def] operator[SEP] identifier[getDefaultValue] operator[SEP] operator[SEP] operator[+] identifier[strOrder] operator[+] literal[String] operator[SEP] operator[SEP] identifier[aoInterfaceName] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[aoInterfaceName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[aoInterfaceName] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[contains] operator[SEP] identifier[aoInterfaceName] operator[SEP] operator[||] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[aoInterfaceName] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[aoInterfaceName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[add] operator[SEP] identifier[aoInterfaceName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aoInterfaceName] operator[!=] Other[null] operator[&&] operator[!] identifier[aoInterfaceName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[aoType] operator[SEP] identifier[setAdminObjectInterface] operator[SEP] identifier[aoInterfaceName] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[aoType] operator[SEP] identifier[setAdminObjectInterface] operator[SEP] identifier[def] operator[SEP] identifier[getDefaultValue] operator[SEP] operator[SEP] operator[+] identifier[strOrder] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[String] identifier[aoClassName] operator[=] literal[String] operator[SEP] Keyword[do] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[def] operator[SEP] identifier[getDefaultValue] operator[SEP] operator[SEP] operator[+] identifier[strOrder] operator[+] literal[String] operator[SEP] operator[SEP] identifier[aoClassName] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[aoClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[aoClassName] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[contains] operator[SEP] identifier[aoClassName] operator[SEP] operator[||] operator[!] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] identifier[CLASS_NAME_PATTERN] , identifier[aoClassName] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[aoClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[add] operator[SEP] identifier[aoClassName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aoClassName] operator[!=] Other[null] operator[&&] operator[!] identifier[aoClassName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[aoType] operator[SEP] identifier[setAdminObjectClass] operator[SEP] identifier[aoClassName] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[aoType] operator[SEP] identifier[setAdminObjectClass] operator[SEP] identifier[def] operator[SEP] identifier[getDefaultValue] operator[SEP] operator[SEP] operator[+] identifier[strOrder] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[ConfigPropType] operator[>] identifier[aoProps] operator[=] identifier[inputProperties] operator[SEP] literal[String] , identifier[in] , literal[boolean] operator[SEP] operator[SEP] identifier[aoType] operator[SEP] identifier[setAoConfigProps] operator[SEP] identifier[aoProps] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[def] operator[SEP] identifier[getAdminObjects] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] identifier[def] operator[SEP] identifier[setAdminObjects] operator[SEP] Keyword[new] identifier[ArrayList] operator[<] identifier[AdminObjectType] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[getAdminObjects] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[aoType] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[genAoAgain] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[genAoAgain] operator[==] Other[null] operator[SEP] identifier[numOfAo] operator[=] operator[-] Other[1] operator[SEP] Keyword[else] {
Keyword[if] operator[SEP] identifier[genAoAgain] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[genAoAgain] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[genAoAgain] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[numOfAo] operator[++] operator[SEP] Keyword[else] identifier[numOfAo] operator[=] operator[-] Other[1] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[def] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[def] operator[SEP] identifier[isSupportOutbound] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[def] operator[SEP] identifier[getMcfDefs] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[isUseCciConnection] operator[SEP] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[genMbean] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[genMbean] operator[==] Other[null] operator[SEP] identifier[def] operator[SEP] identifier[setGenMbean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] {
Keyword[if] operator[SEP] identifier[genMbean] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[genMbean] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[genMbean] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setGenMbean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] identifier[def] operator[SEP] identifier[setGenMbean] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[genEis] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[genEis] operator[==] Other[null] operator[SEP] identifier[def] operator[SEP] identifier[setSupportEis] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] {
Keyword[if] operator[SEP] identifier[genEis] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[genEis] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[genEis] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setSupportEis] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] identifier[def] operator[SEP] identifier[setSupportEis] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[def] operator[SEP] identifier[isSupportEis] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[def] operator[SEP] identifier[getMcfDefs] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getMcfConfigProps] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[def] operator[SEP] identifier[getMcfDefs] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[setMcfConfigProps] operator[SEP] Keyword[new] identifier[ArrayList] operator[<] identifier[ConfigPropType] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[ConfigPropType] operator[>] identifier[props] operator[=] identifier[def] operator[SEP] identifier[getMcfDefs] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getMcfConfigProps] operator[SEP] operator[SEP] operator[SEP] identifier[ConfigPropType] identifier[host] operator[=] Keyword[new] identifier[ConfigPropType] operator[SEP] literal[String] , literal[String] , literal[String] , literal[boolean] operator[SEP] operator[SEP] identifier[props] operator[SEP] identifier[add] operator[SEP] identifier[host] operator[SEP] operator[SEP] identifier[ConfigPropType] identifier[port] operator[=] Keyword[new] identifier[ConfigPropType] operator[SEP] literal[String] , literal[String] , literal[String] , literal[boolean] operator[SEP] operator[SEP] identifier[props] operator[SEP] identifier[add] operator[SEP] identifier[port] operator[SEP] operator[SEP]
}
}
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[supportJbossLogging] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[supportJbossLogging] operator[==] Other[null] operator[SEP] identifier[def] operator[SEP] identifier[setSupportJbossLogging] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] {
Keyword[if] operator[SEP] identifier[supportJbossLogging] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[supportJbossLogging] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[supportJbossLogging] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[def] operator[SEP] identifier[setSupportJbossLogging] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[else] identifier[def] operator[SEP] identifier[setSupportJbossLogging] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[rb] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[def] operator[SEP] identifier[getBuild] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[buildEnv] operator[=] identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[buildEnv] operator[!=] Other[null] operator[&&] operator[!] identifier[buildEnv] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[buildEnv] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[||] identifier[buildEnv] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[||] identifier[buildEnv] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[def] operator[SEP] identifier[setBuild] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[buildEnv] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[||] identifier[buildEnv] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[def] operator[SEP] identifier[setBuild] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[buildEnv] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[||] identifier[buildEnv] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[def] operator[SEP] identifier[setBuild] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] identifier[def] operator[SEP] identifier[setBuild] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] identifier[def] operator[SEP] identifier[setBuild] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[def] operator[SEP]
}
|
private Address createAddress(String host, int port) {
SipUri sipUri = new SipUri();
try {
sipUri.setHost(host);
} catch (ParseException e) {
logger.logError("Bad load balancer host " + host, e);
return null;
}
sipUri.setPort(port);
return addressFactory.createAddress(sipUri);
} | class class_name[name] begin[{]
method[createAddress, return_type[type[Address]], modifier[private], parameter[host, port]] begin[{]
local_variable[type[SipUri], sipUri]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setHost, postfix_operators=[], prefix_operators=[], qualifier=sipUri, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Bad load balancer host "), operandr=MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logError, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ParseException']))], finally_block=None, label=None, resources=None)
call[sipUri.setPort, parameter[member[.port]]]
return[call[addressFactory.createAddress, parameter[member[.sipUri]]]]
end[}]
END[}] | Keyword[private] identifier[Address] identifier[createAddress] operator[SEP] identifier[String] identifier[host] , Keyword[int] identifier[port] operator[SEP] {
identifier[SipUri] identifier[sipUri] operator[=] Keyword[new] identifier[SipUri] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[sipUri] operator[SEP] identifier[setHost] operator[SEP] identifier[host] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ParseException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[logError] operator[SEP] literal[String] operator[+] identifier[host] , identifier[e] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
identifier[sipUri] operator[SEP] identifier[setPort] operator[SEP] identifier[port] operator[SEP] operator[SEP] Keyword[return] identifier[addressFactory] operator[SEP] identifier[createAddress] operator[SEP] identifier[sipUri] operator[SEP] operator[SEP]
}
|
@Override
public ProtoNetworkDescriptor writeProtoNetwork(ProtoNetwork protoNetwork,
String protoNetworkRootPath) throws ProtoNetworkError {
final String filename = PROTO_NETWORK_FILENAME;
final File file = new File(asPath(protoNetworkRootPath, filename));
ObjectOutputStream oos = null;
try {
oos = new ObjectOutputStream(new FileOutputStream(file));
protoNetwork.writeExternal(oos);
return new BinaryProtoNetworkDescriptor(file);
} catch (IOException e) {
final String name = file.getAbsolutePath();
final String msg =
"Cannot create temporary binary file for proto-network";
throw new ProtoNetworkError(name, msg, e);
} finally {
// clean up IO resources
IOUtils.closeQuietly(oos);
}
} | class class_name[name] begin[{]
method[writeProtoNetwork, return_type[type[ProtoNetworkDescriptor]], modifier[public], parameter[protoNetwork, protoNetworkRootPath]] begin[{]
local_variable[type[String], filename]
local_variable[type[File], file]
local_variable[type[ObjectOutputStream], oos]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=oos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectOutputStream, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=oos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeExternal, postfix_operators=[], prefix_operators=[], qualifier=protoNetwork, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=file, 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=BinaryProtoNetworkDescriptor, sub_type=None)), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), name=name)], modifiers={'final'}, 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="Cannot create temporary binary file for proto-network"), name=msg)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=msg, 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=ProtoNetworkError, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=oos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ProtoNetworkDescriptor] identifier[writeProtoNetwork] operator[SEP] identifier[ProtoNetwork] identifier[protoNetwork] , identifier[String] identifier[protoNetworkRootPath] operator[SEP] Keyword[throws] identifier[ProtoNetworkError] {
Keyword[final] identifier[String] identifier[filename] operator[=] identifier[PROTO_NETWORK_FILENAME] operator[SEP] Keyword[final] identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[asPath] operator[SEP] identifier[protoNetworkRootPath] , identifier[filename] operator[SEP] operator[SEP] operator[SEP] identifier[ObjectOutputStream] identifier[oos] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[oos] operator[=] Keyword[new] identifier[ObjectOutputStream] operator[SEP] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] operator[SEP] identifier[protoNetwork] operator[SEP] identifier[writeExternal] operator[SEP] identifier[oos] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[BinaryProtoNetworkDescriptor] operator[SEP] identifier[file] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[final] identifier[String] identifier[name] operator[=] identifier[file] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[msg] operator[=] literal[String] operator[SEP] Keyword[throw] Keyword[new] identifier[ProtoNetworkError] operator[SEP] identifier[name] , identifier[msg] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[IOUtils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[oos] operator[SEP] operator[SEP]
}
}
|
protected static void addTxManagementInterceptorForView(ViewDescription view) {
// add a Tx configurator
view.getConfigurators().add(new ViewConfigurator() {
@Override
public void configure(DeploymentPhaseContext context, ComponentConfiguration componentConfiguration, ViewDescription description, ViewConfiguration configuration) throws DeploymentUnitProcessingException {
EJBComponentDescription ejbComponentDescription = (EJBComponentDescription) componentConfiguration.getComponentDescription();
// Add CMT interceptor factory
if (TransactionManagementType.CONTAINER.equals(ejbComponentDescription.getTransactionManagementType())) {
configuration.addViewInterceptor(CMTTxInterceptor.FACTORY, InterceptorOrder.View.CMT_TRANSACTION_INTERCEPTOR);
}
}
});
} | class class_name[name] begin[{]
method[addTxManagementInterceptorForView, return_type[void], modifier[static protected], parameter[view]] begin[{]
call[view.getConfigurators, parameter[]]
end[}]
END[}] | Keyword[protected] Keyword[static] Keyword[void] identifier[addTxManagementInterceptorForView] operator[SEP] identifier[ViewDescription] identifier[view] operator[SEP] {
identifier[view] operator[SEP] identifier[getConfigurators] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ViewConfigurator] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[configure] operator[SEP] identifier[DeploymentPhaseContext] identifier[context] , identifier[ComponentConfiguration] identifier[componentConfiguration] , identifier[ViewDescription] identifier[description] , identifier[ViewConfiguration] identifier[configuration] operator[SEP] Keyword[throws] identifier[DeploymentUnitProcessingException] {
identifier[EJBComponentDescription] identifier[ejbComponentDescription] operator[=] operator[SEP] identifier[EJBComponentDescription] operator[SEP] identifier[componentConfiguration] operator[SEP] identifier[getComponentDescription] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TransactionManagementType] operator[SEP] identifier[CONTAINER] operator[SEP] identifier[equals] operator[SEP] identifier[ejbComponentDescription] operator[SEP] identifier[getTransactionManagementType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[configuration] operator[SEP] identifier[addViewInterceptor] operator[SEP] identifier[CMTTxInterceptor] operator[SEP] identifier[FACTORY] , identifier[InterceptorOrder] operator[SEP] identifier[View] operator[SEP] identifier[CMT_TRANSACTION_INTERCEPTOR] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
|
@Override
@FFDCIgnore(IllegalStateException.class)
public Collection<URL> getURLs() {
try {
URL u = this.bundle.getEntry("/");
return Collections.singleton(u);
} catch (IllegalStateException ise) {
return Collections.emptyList();
}
} | class class_name[name] begin[{]
method[getURLs, return_type[type[Collection]], modifier[public], parameter[]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=bundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], member=getEntry, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=u)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=singleton, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=emptyList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ise, types=['IllegalStateException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] annotation[@] identifier[FFDCIgnore] operator[SEP] identifier[IllegalStateException] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[Collection] operator[<] identifier[URL] operator[>] identifier[getURLs] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[URL] identifier[u] operator[=] Keyword[this] operator[SEP] identifier[bundle] operator[SEP] identifier[getEntry] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[singleton] operator[SEP] identifier[u] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalStateException] identifier[ise] operator[SEP] {
Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static String[] getAvailableIDs(int rawOffset) {
Set<String> ids = getAvailableIDs(SystemTimeZoneType.ANY, null, Integer.valueOf(rawOffset));
return ids.toArray(new String[0]);
} | class class_name[name] begin[{]
method[getAvailableIDs, return_type[type[String]], modifier[public static], parameter[rawOffset]] begin[{]
local_variable[type[Set], ids]
return[call[ids.toArray, parameter[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[getAvailableIDs] operator[SEP] Keyword[int] identifier[rawOffset] operator[SEP] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[ids] operator[=] identifier[getAvailableIDs] operator[SEP] identifier[SystemTimeZoneType] operator[SEP] identifier[ANY] , Other[null] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[rawOffset] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ids] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
|
public ServiceFuture<VirtualNetworkPeeringInner> createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters, final ServiceCallback<VirtualNetworkPeeringInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), serviceCallback);
} | class class_name[name] begin[{]
method[createOrUpdateAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.createOrUpdateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.virtualNetworkName], member[.virtualNetworkPeeringName], member[.virtualNetworkPeeringParameters]]], member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[VirtualNetworkPeeringInner] operator[>] identifier[createOrUpdateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[virtualNetworkName] , identifier[String] identifier[virtualNetworkPeeringName] , identifier[VirtualNetworkPeeringInner] identifier[virtualNetworkPeeringParameters] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[VirtualNetworkPeeringInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[createOrUpdateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[virtualNetworkName] , identifier[virtualNetworkPeeringName] , identifier[virtualNetworkPeeringParameters] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
public void setRES1(Integer newRES1) {
Integer oldRES1 = res1;
res1 = newRES1;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.GSPCOL__RES1, oldRES1, res1));
} | class class_name[name] begin[{]
method[setRES1, return_type[void], modifier[public], parameter[newRES1]] begin[{]
local_variable[type[Integer], oldRES1]
assign[member[.res1], member[.newRES1]]
if[call[.eNotificationRequired, parameter[]]] begin[{]
call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=GSPCOL__RES1, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[]), MemberReference(member=oldRES1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=res1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ENotificationImpl, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setRES1] operator[SEP] identifier[Integer] identifier[newRES1] operator[SEP] {
identifier[Integer] identifier[oldRES1] operator[=] identifier[res1] operator[SEP] identifier[res1] operator[=] identifier[newRES1] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[AfplibPackage] operator[SEP] identifier[GSPCOL__RES1] , identifier[oldRES1] , identifier[res1] operator[SEP] operator[SEP] operator[SEP]
}
|
public void reallocate(boolean allMsgs) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "reallocate");
// There will not be a reallocator if this streamSet is used for PubSub
if( pointTopoint )
{
// Force the reallocator to delete mesages from the ItemStream
// when it finishes if it has removed them from the stream
reallocator.reallocateMsgs(this.destinationHandler, allMsgs, true);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "reallocate");
} | class class_name[name] begin[{]
method[reallocate, return_type[void], modifier[public], parameter[allMsgs]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["reallocate"]]]
else begin[{]
None
end[}]
if[member[.pointTopoint]] begin[{]
call[reallocator.reallocateMsgs, parameter[THIS[member[None.destinationHandler]], member[.allMsgs], literal[true]]]
else begin[{]
None
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["reallocate"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[reallocate] operator[SEP] Keyword[boolean] identifier[allMsgs] operator[SEP] Keyword[throws] identifier[SIResourceException] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pointTopoint] operator[SEP] {
identifier[reallocator] operator[SEP] identifier[reallocateMsgs] operator[SEP] Keyword[this] operator[SEP] identifier[destinationHandler] , identifier[allMsgs] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
@Override
public <T> Parameter<T> getParameter(String paramString, Class<T> paramClass)
{
onNativeCondition();
Parameter parameter = getParameterByName(paramString);
return onTypeCheck(paramClass, parameter);
} | class class_name[name] begin[{]
method[getParameter, return_type[type[Parameter]], modifier[public], parameter[paramString, paramClass]] begin[{]
call[.onNativeCondition, parameter[]]
local_variable[type[Parameter], parameter]
return[call[.onTypeCheck, parameter[member[.paramClass], member[.parameter]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[Parameter] operator[<] identifier[T] operator[>] identifier[getParameter] operator[SEP] identifier[String] identifier[paramString] , identifier[Class] operator[<] identifier[T] operator[>] identifier[paramClass] operator[SEP] {
identifier[onNativeCondition] operator[SEP] operator[SEP] operator[SEP] identifier[Parameter] identifier[parameter] operator[=] identifier[getParameterByName] operator[SEP] identifier[paramString] operator[SEP] operator[SEP] Keyword[return] identifier[onTypeCheck] operator[SEP] identifier[paramClass] , identifier[parameter] operator[SEP] operator[SEP]
}
|
public void doProgressText(StaplerRequest req, StaplerResponse rsp) throws IOException {
rsp.setContentType("text/plain");
rsp.setStatus(HttpServletResponse.SC_OK);
if(!source.exists()) {
// file doesn't exist yet
rsp.addHeader("X-Text-Size","0");
rsp.addHeader("X-More-Data","true");
return;
}
long start = 0;
String s = req.getParameter("start");
if(s!=null)
start = Long.parseLong(s);
if(source.length() < start )
start = 0; // text rolled over
CharSpool spool = new CharSpool();
long r = writeLogTo(start,spool);
rsp.addHeader("X-Text-Size",String.valueOf(r));
if(!completed)
rsp.addHeader("X-More-Data","true");
// when sending big text, try compression. don't bother if it's small
Writer w;
if(r-start>4096)
w = rsp.getCompressedWriter(req);
else
w = rsp.getWriter();
spool.writeTo(new LineEndNormalizingWriter(w));
w.close();
} | class class_name[name] begin[{]
method[doProgressText, return_type[void], modifier[public], parameter[req, rsp]] begin[{]
call[rsp.setContentType, parameter[literal["text/plain"]]]
call[rsp.setStatus, parameter[member[HttpServletResponse.SC_OK]]]
if[call[source.exists, parameter[]]] begin[{]
call[rsp.addHeader, parameter[literal["X-Text-Size"], literal["0"]]]
call[rsp.addHeader, parameter[literal["X-More-Data"], literal["true"]]]
return[None]
else begin[{]
None
end[}]
local_variable[type[long], start]
local_variable[type[String], s]
if[binary_operation[member[.s], !=, literal[null]]] begin[{]
assign[member[.start], call[Long.parseLong, parameter[member[.s]]]]
else begin[{]
None
end[}]
if[binary_operation[call[source.length, parameter[]], <, member[.start]]] begin[{]
assign[member[.start], literal[0]]
else begin[{]
None
end[}]
local_variable[type[CharSpool], spool]
local_variable[type[long], r]
call[rsp.addHeader, parameter[literal["X-Text-Size"], call[String.valueOf, parameter[member[.r]]]]]
if[member[.completed]] begin[{]
call[rsp.addHeader, parameter[literal["X-More-Data"], literal["true"]]]
else begin[{]
None
end[}]
local_variable[type[Writer], w]
if[binary_operation[binary_operation[member[.r], -, member[.start]], >, literal[4096]]] begin[{]
assign[member[.w], call[rsp.getCompressedWriter, parameter[member[.req]]]]
else begin[{]
assign[member[.w], call[rsp.getWriter, parameter[]]]
end[}]
call[spool.writeTo, parameter[ClassCreator(arguments=[MemberReference(member=w, 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=LineEndNormalizingWriter, sub_type=None))]]
call[w.close, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[doProgressText] operator[SEP] identifier[StaplerRequest] identifier[req] , identifier[StaplerResponse] identifier[rsp] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[rsp] operator[SEP] identifier[setContentType] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[rsp] operator[SEP] identifier[setStatus] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[SC_OK] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[source] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[rsp] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[rsp] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[long] identifier[start] operator[=] Other[0] operator[SEP] identifier[String] identifier[s] operator[=] identifier[req] operator[SEP] identifier[getParameter] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[!=] Other[null] operator[SEP] identifier[start] operator[=] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[source] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] identifier[start] operator[SEP] identifier[start] operator[=] Other[0] operator[SEP] identifier[CharSpool] identifier[spool] operator[=] Keyword[new] identifier[CharSpool] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[r] operator[=] identifier[writeLogTo] operator[SEP] identifier[start] , identifier[spool] operator[SEP] operator[SEP] identifier[rsp] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[r] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[completed] operator[SEP] identifier[rsp] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[Writer] identifier[w] operator[SEP] Keyword[if] operator[SEP] identifier[r] operator[-] identifier[start] operator[>] Other[4096] operator[SEP] identifier[w] operator[=] identifier[rsp] operator[SEP] identifier[getCompressedWriter] operator[SEP] identifier[req] operator[SEP] operator[SEP] Keyword[else] identifier[w] operator[=] identifier[rsp] operator[SEP] identifier[getWriter] operator[SEP] operator[SEP] operator[SEP] identifier[spool] operator[SEP] identifier[writeTo] operator[SEP] Keyword[new] identifier[LineEndNormalizingWriter] operator[SEP] identifier[w] operator[SEP] operator[SEP] operator[SEP] identifier[w] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
|
public <U> TransactionLog<U> map(Function<T, U> mapper) {
return new TransactionLog<>(transactionId, version, Lists.transform(records, mapper::apply));
} | class class_name[name] begin[{]
method[map, return_type[type[TransactionLog]], modifier[public], parameter[mapper]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=transactionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=records, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodReference(expression=MemberReference(member=mapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=apply, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=transform, postfix_operators=[], prefix_operators=[], qualifier=Lists, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=TransactionLog, sub_type=None))]
end[}]
END[}] | Keyword[public] operator[<] identifier[U] operator[>] identifier[TransactionLog] operator[<] identifier[U] operator[>] identifier[map] operator[SEP] identifier[Function] operator[<] identifier[T] , identifier[U] operator[>] identifier[mapper] operator[SEP] {
Keyword[return] Keyword[new] identifier[TransactionLog] operator[<] operator[>] operator[SEP] identifier[transactionId] , identifier[version] , identifier[Lists] operator[SEP] identifier[transform] operator[SEP] identifier[records] , identifier[mapper] operator[::] identifier[apply] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public URI getLocationURI(HttpRequest request, HttpResponse response, HttpContext context) throws ProtocolException {
URI uri = this.redirectStrategy.getLocationURI(request, response, context);
String resultingPageUrl = uri.toString();
DriverRequest driverRequest = ((OutgoingRequest) request).getOriginalRequest();
// Remove context if present
if (StringUtils.startsWith(resultingPageUrl, driverRequest.getVisibleBaseUrl())) {
resultingPageUrl =
"/"
+ StringUtils.stripStart(
StringUtils.replace(resultingPageUrl, driverRequest.getVisibleBaseUrl(), ""), "/");
}
resultingPageUrl = ResourceUtils.getHttpUrlWithQueryString(resultingPageUrl, driverRequest, false);
return UriUtils.createURI(ResourceUtils.getHttpUrlWithQueryString(resultingPageUrl, driverRequest, false));
} | class class_name[name] begin[{]
method[getLocationURI, return_type[type[URI]], modifier[public], parameter[request, response, context]] begin[{]
local_variable[type[URI], uri]
local_variable[type[String], resultingPageUrl]
local_variable[type[DriverRequest], driverRequest]
if[call[StringUtils.startsWith, parameter[member[.resultingPageUrl], call[driverRequest.getVisibleBaseUrl, parameter[]]]]] begin[{]
assign[member[.resultingPageUrl], binary_operation[literal["/"], +, call[StringUtils.stripStart, parameter[call[StringUtils.replace, parameter[member[.resultingPageUrl], call[driverRequest.getVisibleBaseUrl, parameter[]], literal[""]]], literal["/"]]]]]
else begin[{]
None
end[}]
assign[member[.resultingPageUrl], call[ResourceUtils.getHttpUrlWithQueryString, parameter[member[.resultingPageUrl], member[.driverRequest], literal[false]]]]
return[call[UriUtils.createURI, parameter[call[ResourceUtils.getHttpUrlWithQueryString, parameter[member[.resultingPageUrl], member[.driverRequest], literal[false]]]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[URI] identifier[getLocationURI] operator[SEP] identifier[HttpRequest] identifier[request] , identifier[HttpResponse] identifier[response] , identifier[HttpContext] identifier[context] operator[SEP] Keyword[throws] identifier[ProtocolException] {
identifier[URI] identifier[uri] operator[=] Keyword[this] operator[SEP] identifier[redirectStrategy] operator[SEP] identifier[getLocationURI] operator[SEP] identifier[request] , identifier[response] , identifier[context] operator[SEP] operator[SEP] identifier[String] identifier[resultingPageUrl] operator[=] identifier[uri] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[DriverRequest] identifier[driverRequest] operator[=] operator[SEP] operator[SEP] identifier[OutgoingRequest] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[getOriginalRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[startsWith] operator[SEP] identifier[resultingPageUrl] , identifier[driverRequest] operator[SEP] identifier[getVisibleBaseUrl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[resultingPageUrl] operator[=] literal[String] operator[+] identifier[StringUtils] operator[SEP] identifier[stripStart] operator[SEP] identifier[StringUtils] operator[SEP] identifier[replace] operator[SEP] identifier[resultingPageUrl] , identifier[driverRequest] operator[SEP] identifier[getVisibleBaseUrl] operator[SEP] operator[SEP] , literal[String] operator[SEP] , literal[String] operator[SEP] operator[SEP]
}
identifier[resultingPageUrl] operator[=] identifier[ResourceUtils] operator[SEP] identifier[getHttpUrlWithQueryString] operator[SEP] identifier[resultingPageUrl] , identifier[driverRequest] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[UriUtils] operator[SEP] identifier[createURI] operator[SEP] identifier[ResourceUtils] operator[SEP] identifier[getHttpUrlWithQueryString] operator[SEP] identifier[resultingPageUrl] , identifier[driverRequest] , literal[boolean] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public int getLocationX() throws WidgetException {
try {
Point p = findElement().getLocation();
return p.getX();
} catch (Exception e) {
throw new WidgetException("Error while fetching X location", locator, e);
}
} | class class_name[name] begin[{]
method[getLocationX, return_type[type[int]], modifier[public], parameter[]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=findElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getLocation, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Point, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=getX, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while fetching X location"), MemberReference(member=locator, 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=WidgetException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[getLocationX] operator[SEP] operator[SEP] Keyword[throws] identifier[WidgetException] {
Keyword[try] {
identifier[Point] identifier[p] operator[=] identifier[findElement] operator[SEP] operator[SEP] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[p] operator[SEP] identifier[getX] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[WidgetException] operator[SEP] literal[String] , identifier[locator] , identifier[e] operator[SEP] operator[SEP]
}
}
|
private InputStream filterTag(InputStream in) throws IOException {
BufferedReader buffIn = new BufferedReader(new InputStreamReader(in, CDM.UTF8));
ByteArrayOutputStream bos = new ByteArrayOutputStream(10000);
String line = buffIn.readLine();
while (line != null) {
String lline = line.toLowerCase();
if (lline.contains("<meta ")) // skip meta tags
continue;
//System.out.println("--"+line);
bos.write(line.getBytes(CDM.utf8Charset));
line = buffIn.readLine();
}
buffIn.close();
return new ByteArrayInputStream(bos.toByteArray());
} | class class_name[name] begin[{]
method[filterTag, return_type[type[InputStream]], modifier[private], parameter[in]] begin[{]
local_variable[type[BufferedReader], buffIn]
local_variable[type[ByteArrayOutputStream], bos]
local_variable[type[String], line]
while[binary_operation[member[.line], !=, literal[null]]] begin[{]
local_variable[type[String], lline]
if[call[lline.contains, parameter[literal["<meta "]]]] begin[{]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
call[bos.write, parameter[call[line.getBytes, parameter[member[CDM.utf8Charset]]]]]
assign[member[.line], call[buffIn.readLine, parameter[]]]
end[}]
call[buffIn.close, parameter[]]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=bos, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None))]
end[}]
END[}] | Keyword[private] identifier[InputStream] identifier[filterTag] operator[SEP] identifier[InputStream] identifier[in] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[BufferedReader] identifier[buffIn] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[in] , identifier[CDM] operator[SEP] identifier[UTF8] operator[SEP] operator[SEP] operator[SEP] identifier[ByteArrayOutputStream] identifier[bos] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] Other[10000] operator[SEP] operator[SEP] identifier[String] identifier[line] operator[=] identifier[buffIn] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[line] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[lline] operator[=] identifier[line] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lline] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[bos] operator[SEP] identifier[write] operator[SEP] identifier[line] operator[SEP] identifier[getBytes] operator[SEP] identifier[CDM] operator[SEP] identifier[utf8Charset] operator[SEP] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[buffIn] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP]
}
identifier[buffIn] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[bos] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void addStatsError(boolean moreResultAvailable) {
if (cmdInformation == null) {
if (batch) {
cmdInformation = new CmdInformationBatch(expectedSize, autoIncrement);
} else if (moreResultAvailable) {
cmdInformation = new CmdInformationMultiple(expectedSize, autoIncrement);
} else {
cmdInformation = new CmdInformationSingle(0, Statement.EXECUTE_FAILED, autoIncrement);
return;
}
}
cmdInformation.addErrorStat();
} | class class_name[name] begin[{]
method[addStatsError, return_type[void], modifier[public], parameter[moreResultAvailable]] begin[{]
if[binary_operation[member[.cmdInformation], ==, literal[null]]] begin[{]
if[member[.batch]] begin[{]
assign[member[.cmdInformation], ClassCreator(arguments=[MemberReference(member=expectedSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=autoIncrement, 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=CmdInformationBatch, sub_type=None))]
else begin[{]
if[member[.moreResultAvailable]] begin[{]
assign[member[.cmdInformation], ClassCreator(arguments=[MemberReference(member=expectedSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=autoIncrement, 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=CmdInformationMultiple, sub_type=None))]
else begin[{]
assign[member[.cmdInformation], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=EXECUTE_FAILED, postfix_operators=[], prefix_operators=[], qualifier=Statement, selectors=[]), MemberReference(member=autoIncrement, 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=CmdInformationSingle, sub_type=None))]
return[None]
end[}]
end[}]
else begin[{]
None
end[}]
call[cmdInformation.addErrorStat, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addStatsError] operator[SEP] Keyword[boolean] identifier[moreResultAvailable] operator[SEP] {
Keyword[if] operator[SEP] identifier[cmdInformation] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[batch] operator[SEP] {
identifier[cmdInformation] operator[=] Keyword[new] identifier[CmdInformationBatch] operator[SEP] identifier[expectedSize] , identifier[autoIncrement] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[moreResultAvailable] operator[SEP] {
identifier[cmdInformation] operator[=] Keyword[new] identifier[CmdInformationMultiple] operator[SEP] identifier[expectedSize] , identifier[autoIncrement] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[cmdInformation] operator[=] Keyword[new] identifier[CmdInformationSingle] operator[SEP] Other[0] , identifier[Statement] operator[SEP] identifier[EXECUTE_FAILED] , identifier[autoIncrement] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
}
identifier[cmdInformation] operator[SEP] identifier[addErrorStat] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Condition[] buildConditions(Entity entity) {
if (null == entity || entity.isEmpty()) {
return null;
}
final Condition[] conditions = new Condition[entity.size()];
int i = 0;
Object value;
for (Entry<String, Object> entry : entity.entrySet()) {
value = entry.getValue();
if (value instanceof Condition) {
conditions[i++] = (Condition) value;
} else {
conditions[i++] = new Condition(entry.getKey(), value);
}
}
return conditions;
} | class class_name[name] begin[{]
method[buildConditions, return_type[type[Condition]], modifier[public static], parameter[entity]] begin[{]
if[binary_operation[binary_operation[literal[null], ==, member[.entity]], ||, call[entity.isEmpty, parameter[]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[Condition], conditions]
local_variable[type[int], i]
local_variable[type[Object], value]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Condition, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=conditions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Condition, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=conditions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Condition, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None)
return[member[.conditions]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Condition] operator[SEP] operator[SEP] identifier[buildConditions] operator[SEP] identifier[Entity] identifier[entity] operator[SEP] {
Keyword[if] operator[SEP] Other[null] operator[==] identifier[entity] operator[||] identifier[entity] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[final] identifier[Condition] operator[SEP] operator[SEP] identifier[conditions] operator[=] Keyword[new] identifier[Condition] operator[SEP] identifier[entity] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[Object] identifier[value] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[entry] operator[:] identifier[entity] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[value] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Condition] operator[SEP] {
identifier[conditions] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] operator[SEP] identifier[Condition] operator[SEP] identifier[value] operator[SEP]
}
Keyword[else] {
identifier[conditions] operator[SEP] identifier[i] operator[++] operator[SEP] operator[=] Keyword[new] identifier[Condition] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[conditions] operator[SEP]
}
|
public OperationFuture<List<Server>> addSecondaryNetwork(List<Server> servers, AddNetworkConfig config) {
List<JobFuture> futures = servers.stream()
.map(server -> addSecondaryNetwork(server, config).jobFuture())
.collect(toList());
return new OperationFuture<>(
servers,
new ParallelJobsFuture(futures)
);
} | class class_name[name] begin[{]
method[addSecondaryNetwork, return_type[type[OperationFuture]], modifier[public], parameter[servers, config]] begin[{]
local_variable[type[List], futures]
return[ClassCreator(arguments=[MemberReference(member=servers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=futures, 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=ParallelJobsFuture, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=OperationFuture, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[OperationFuture] operator[<] identifier[List] operator[<] identifier[Server] operator[>] operator[>] identifier[addSecondaryNetwork] operator[SEP] identifier[List] operator[<] identifier[Server] operator[>] identifier[servers] , identifier[AddNetworkConfig] identifier[config] operator[SEP] {
identifier[List] operator[<] identifier[JobFuture] operator[>] identifier[futures] operator[=] identifier[servers] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[server] operator[->] identifier[addSecondaryNetwork] operator[SEP] identifier[server] , identifier[config] operator[SEP] operator[SEP] identifier[jobFuture] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[OperationFuture] operator[<] operator[>] operator[SEP] identifier[servers] , Keyword[new] identifier[ParallelJobsFuture] operator[SEP] identifier[futures] operator[SEP] operator[SEP] operator[SEP]
}
|
public SyndFeed build(final org.w3c.dom.Document document) throws IllegalArgumentException, FeedException {
return new SyndFeedImpl(feedInput.build(document), preserveWireFeed);
} | class class_name[name] begin[{]
method[build, return_type[type[SyndFeed]], modifier[public], parameter[document]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=document, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=build, postfix_operators=[], prefix_operators=[], qualifier=feedInput, selectors=[], type_arguments=None), MemberReference(member=preserveWireFeed, 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=SyndFeedImpl, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[SyndFeed] identifier[build] operator[SEP] Keyword[final] identifier[org] operator[SEP] identifier[w3c] operator[SEP] identifier[dom] operator[SEP] identifier[Document] identifier[document] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] , identifier[FeedException] {
Keyword[return] Keyword[new] identifier[SyndFeedImpl] operator[SEP] identifier[feedInput] operator[SEP] identifier[build] operator[SEP] identifier[document] operator[SEP] , identifier[preserveWireFeed] operator[SEP] operator[SEP]
}
|
public static String unmask(final String mask, final String value) throws ParseException
{
return maskFormat(mask).parse(value);
} | class class_name[name] begin[{]
method[unmask, return_type[type[String]], modifier[public static], parameter[mask, value]] begin[{]
return[call[.maskFormat, parameter[member[.mask]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[unmask] operator[SEP] Keyword[final] identifier[String] identifier[mask] , Keyword[final] identifier[String] identifier[value] operator[SEP] Keyword[throws] identifier[ParseException] {
Keyword[return] identifier[maskFormat] operator[SEP] identifier[mask] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
|
public synchronized void updateScore(GrayF32 image, List<Point2D_F64> sides) {
removePerspective.apply(image,sides.get(0),sides.get(1),sides.get(2),sides.get(3));
GrayF32 current = removePerspective.getOutput();
float mean = (float)ImageStatistics.mean(current);
PixelMath.divide(current,mean,tempImage);
PixelMath.diffAbs(tempImage,template,difference);
PixelMath.multiply(difference,weights,difference);
// compute score as a weighted average of the difference
currentScore = ImageStatistics.sum(difference)/totalWeight;
} | class class_name[name] begin[{]
method[updateScore, return_type[void], modifier[synchronized public], parameter[image, sides]] begin[{]
call[removePerspective.apply, parameter[member[.image], call[sides.get, parameter[literal[0]]], call[sides.get, parameter[literal[1]]], call[sides.get, parameter[literal[2]]], call[sides.get, parameter[literal[3]]]]]
local_variable[type[GrayF32], current]
local_variable[type[float], mean]
call[PixelMath.divide, parameter[member[.current], member[.mean], member[.tempImage]]]
call[PixelMath.diffAbs, parameter[member[.tempImage], member[.template], member[.difference]]]
call[PixelMath.multiply, parameter[member[.difference], member[.weights], member[.difference]]]
assign[member[.currentScore], binary_operation[call[ImageStatistics.sum, parameter[member[.difference]]], /, member[.totalWeight]]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[void] identifier[updateScore] operator[SEP] identifier[GrayF32] identifier[image] , identifier[List] operator[<] identifier[Point2D_F64] operator[>] identifier[sides] operator[SEP] {
identifier[removePerspective] operator[SEP] identifier[apply] operator[SEP] identifier[image] , identifier[sides] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] , identifier[sides] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] , identifier[sides] operator[SEP] identifier[get] operator[SEP] Other[2] operator[SEP] , identifier[sides] operator[SEP] identifier[get] operator[SEP] Other[3] operator[SEP] operator[SEP] operator[SEP] identifier[GrayF32] identifier[current] operator[=] identifier[removePerspective] operator[SEP] identifier[getOutput] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[mean] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[ImageStatistics] operator[SEP] identifier[mean] operator[SEP] identifier[current] operator[SEP] operator[SEP] identifier[PixelMath] operator[SEP] identifier[divide] operator[SEP] identifier[current] , identifier[mean] , identifier[tempImage] operator[SEP] operator[SEP] identifier[PixelMath] operator[SEP] identifier[diffAbs] operator[SEP] identifier[tempImage] , identifier[template] , identifier[difference] operator[SEP] operator[SEP] identifier[PixelMath] operator[SEP] identifier[multiply] operator[SEP] identifier[difference] , identifier[weights] , identifier[difference] operator[SEP] operator[SEP] identifier[currentScore] operator[=] identifier[ImageStatistics] operator[SEP] identifier[sum] operator[SEP] identifier[difference] operator[SEP] operator[/] identifier[totalWeight] operator[SEP]
}
|
@Override
protected void copyToNew(int position, int newPosition) {
newBasicValueSumList[newPosition] = basicValueSumList[position];
newBasicValueNList[newPosition] = basicValueNList[position];
} | class class_name[name] begin[{]
method[copyToNew, return_type[void], modifier[protected], parameter[position, newPosition]] begin[{]
assign[member[.newBasicValueSumList], member[.basicValueSumList]]
assign[member[.newBasicValueNList], member[.basicValueNList]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[copyToNew] operator[SEP] Keyword[int] identifier[position] , Keyword[int] identifier[newPosition] operator[SEP] {
identifier[newBasicValueSumList] operator[SEP] identifier[newPosition] operator[SEP] operator[=] identifier[basicValueSumList] operator[SEP] identifier[position] operator[SEP] operator[SEP] identifier[newBasicValueNList] operator[SEP] identifier[newPosition] operator[SEP] operator[=] identifier[basicValueNList] operator[SEP] identifier[position] operator[SEP] operator[SEP]
}
|
public final void restore(List<DataSlice> dataSlices)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "restore", dataSlices);
try
{
DataSlice slice = dataSlices.get(0);
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(slice.getBytes()));
// First object stored should always be the version integer.
restore(ois, ois.readInt());
ois.close();
}
catch (IOException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.store.itemstreams.SIMPItemStream.restore",
"1:372:1.54",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "restore", e);
throw new SIErrorException(e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "restore");
} | class class_name[name] begin[{]
method[restore, return_type[void], modifier[final public], parameter[dataSlices]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["restore"], member[.dataSlices]]]
else begin[{]
None
end[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=dataSlices, selectors=[], type_arguments=None), name=slice)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataSlice, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=slice, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectInputStream, sub_type=None)), name=ois)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectInputStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ois, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=ois, selectors=[], type_arguments=None)], member=restore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=ois, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.store.itemstreams.SIMPItemStream.restore"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:372:1.54"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exception, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, 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=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="restore"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), 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=SIErrorException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["restore"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[restore] operator[SEP] identifier[List] operator[<] identifier[DataSlice] operator[>] identifier[dataSlices] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , identifier[dataSlices] operator[SEP] operator[SEP] Keyword[try] {
identifier[DataSlice] identifier[slice] operator[=] identifier[dataSlices] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[ObjectInputStream] identifier[ois] operator[=] Keyword[new] identifier[ObjectInputStream] operator[SEP] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[slice] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[restore] operator[SEP] identifier[ois] , identifier[ois] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ois] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] identifier[tc] , identifier[e] 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[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SIErrorException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
@When("^I create file '(.+?)' based on '(.+?)' as '(.+?)' with:$")
public void createFile(String fileName, String baseData, String type, DataTable modifications) throws Exception {
// Retrieve data
String retrievedData = commonspec.retrieveData(baseData, type);
// Modify data
commonspec.getLogger().debug("Modifying data {} as {}", retrievedData, type);
String modifiedData = commonspec.modifyData(retrievedData, type, modifications).toString();
// Create file (temporary) and set path to be accessible within test
File tempDirectory = new File(String.valueOf(System.getProperty("user.dir") + "/target/test-classes/"));
String absolutePathFile = tempDirectory.getAbsolutePath() + "/" + fileName;
commonspec.getLogger().debug("Creating file {} in 'target/test-classes'", absolutePathFile);
// Note that this Writer will delete the file if it exists
Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(absolutePathFile), "UTF-8"));
try {
out.write(modifiedData);
} catch (Exception e) {
commonspec.getLogger().error("Custom file {} hasn't been created:\n{}", absolutePathFile, e.toString());
} finally {
out.close();
}
Assertions.assertThat(new File(absolutePathFile).isFile());
} | class class_name[name] begin[{]
method[createFile, return_type[void], modifier[public], parameter[fileName, baseData, type, modifications]] begin[{]
local_variable[type[String], retrievedData]
call[commonspec.getLogger, parameter[]]
local_variable[type[String], modifiedData]
local_variable[type[File], tempDirectory]
local_variable[type[String], absolutePathFile]
call[commonspec.getLogger, parameter[]]
local_variable[type[Writer], out]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=modifiedData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=commonspec, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Custom file {} hasn't been created:\n{}"), MemberReference(member=absolutePathFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
call[Assertions.assertThat, parameter[ClassCreator(arguments=[MemberReference(member=absolutePathFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=isFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))]]
end[}]
END[}] | annotation[@] identifier[When] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[createFile] operator[SEP] identifier[String] identifier[fileName] , identifier[String] identifier[baseData] , identifier[String] identifier[type] , identifier[DataTable] identifier[modifications] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[String] identifier[retrievedData] operator[=] identifier[commonspec] operator[SEP] identifier[retrieveData] operator[SEP] identifier[baseData] , identifier[type] operator[SEP] operator[SEP] identifier[commonspec] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[retrievedData] , identifier[type] operator[SEP] operator[SEP] identifier[String] identifier[modifiedData] operator[=] identifier[commonspec] operator[SEP] identifier[modifyData] operator[SEP] identifier[retrievedData] , identifier[type] , identifier[modifications] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[tempDirectory] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[absolutePathFile] operator[=] identifier[tempDirectory] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[fileName] operator[SEP] identifier[commonspec] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[absolutePathFile] operator[SEP] operator[SEP] identifier[Writer] identifier[out] operator[=] Keyword[new] identifier[BufferedWriter] operator[SEP] Keyword[new] identifier[OutputStreamWriter] operator[SEP] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[absolutePathFile] operator[SEP] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[modifiedData] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[commonspec] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[absolutePathFile] , identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[out] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Assertions] operator[SEP] identifier[assertThat] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[absolutePathFile] operator[SEP] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public Map selectMap(int type, boolean createIfNull)
{
if (type == ATTR_JAVASCRIPT) {
if (_jsMap == null && createIfNull)
_jsMap = new HashMap();
return _jsMap;
}
return super.selectMap(type, createIfNull);
} | class class_name[name] begin[{]
method[selectMap, return_type[type[Map]], modifier[public], parameter[type, createIfNull]] begin[{]
if[binary_operation[member[.type], ==, member[.ATTR_JAVASCRIPT]]] begin[{]
if[binary_operation[binary_operation[member[._jsMap], ==, literal[null]], &&, member[.createIfNull]]] begin[{]
assign[member[._jsMap], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HashMap, sub_type=None))]
else begin[{]
None
end[}]
return[member[._jsMap]]
else begin[{]
None
end[}]
return[SuperMethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=createIfNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=selectMap, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | Keyword[public] identifier[Map] identifier[selectMap] operator[SEP] Keyword[int] identifier[type] , Keyword[boolean] identifier[createIfNull] operator[SEP] {
Keyword[if] operator[SEP] identifier[type] operator[==] identifier[ATTR_JAVASCRIPT] operator[SEP] {
Keyword[if] operator[SEP] identifier[_jsMap] operator[==] Other[null] operator[&&] identifier[createIfNull] operator[SEP] identifier[_jsMap] operator[=] Keyword[new] identifier[HashMap] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[_jsMap] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[selectMap] operator[SEP] identifier[type] , identifier[createIfNull] operator[SEP] operator[SEP]
}
|
@Override
public int bid(final String inputFile) {
final String lower = inputFile.toLowerCase();
for (final String sourceExtension : this.sourceExtensions) {
if (lower.endsWith(sourceExtension)) {
return DEFAULT_PROCESS_BID;
}
}
for (final String headerExtension : this.headerExtensions) {
if (lower.endsWith(headerExtension)) {
return DEFAULT_DISCARD_BID;
}
}
return 0;
} | class class_name[name] begin[{]
method[bid, return_type[type[int]], modifier[public], parameter[inputFile]] begin[{]
local_variable[type[String], lower]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=sourceExtension, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=lower, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=DEFAULT_PROCESS_BID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sourceExtensions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sourceExtension)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=headerExtension, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=lower, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=DEFAULT_DISCARD_BID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=headerExtensions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=headerExtension)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[literal[0]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[bid] operator[SEP] Keyword[final] identifier[String] identifier[inputFile] operator[SEP] {
Keyword[final] identifier[String] identifier[lower] operator[=] identifier[inputFile] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[sourceExtension] operator[:] Keyword[this] operator[SEP] identifier[sourceExtensions] operator[SEP] {
Keyword[if] operator[SEP] identifier[lower] operator[SEP] identifier[endsWith] operator[SEP] identifier[sourceExtension] operator[SEP] operator[SEP] {
Keyword[return] identifier[DEFAULT_PROCESS_BID] operator[SEP]
}
}
Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[headerExtension] operator[:] Keyword[this] operator[SEP] identifier[headerExtensions] operator[SEP] {
Keyword[if] operator[SEP] identifier[lower] operator[SEP] identifier[endsWith] operator[SEP] identifier[headerExtension] operator[SEP] operator[SEP] {
Keyword[return] identifier[DEFAULT_DISCARD_BID] operator[SEP]
}
}
Keyword[return] Other[0] operator[SEP]
}
|
public static BigDecimal inverse(final BigDecimal value) {
if (isNotZero(value)) {
return BigDecimal.ONE.setScale(MAX_SCALE_FOR_INVERSE).divide(value, BigDecimal.ROUND_HALF_UP);
}
return null;
} | class class_name[name] begin[{]
method[inverse, return_type[type[BigDecimal]], modifier[public static], parameter[value]] begin[{]
if[call[.isNotZero, parameter[member[.value]]]] begin[{]
return[call[BigDecimal.ONE.setScale, parameter[member[.MAX_SCALE_FOR_INVERSE]]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[BigDecimal] identifier[inverse] operator[SEP] Keyword[final] identifier[BigDecimal] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[isNotZero] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
Keyword[return] identifier[BigDecimal] operator[SEP] identifier[ONE] operator[SEP] identifier[setScale] operator[SEP] identifier[MAX_SCALE_FOR_INVERSE] operator[SEP] operator[SEP] identifier[divide] operator[SEP] identifier[value] , identifier[BigDecimal] operator[SEP] identifier[ROUND_HALF_UP] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public NativeResponse exec(long timeoutMs, Level logLevel) {
return exec(timeoutMs, TimeUnit.MILLISECONDS, logLevel);
} | class class_name[name] begin[{]
method[exec, return_type[type[NativeResponse]], modifier[public], parameter[timeoutMs, logLevel]] begin[{]
return[call[.exec, parameter[member[.timeoutMs], member[TimeUnit.MILLISECONDS], member[.logLevel]]]]
end[}]
END[}] | Keyword[public] identifier[NativeResponse] identifier[exec] operator[SEP] Keyword[long] identifier[timeoutMs] , identifier[Level] identifier[logLevel] operator[SEP] {
Keyword[return] identifier[exec] operator[SEP] identifier[timeoutMs] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] , identifier[logLevel] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.