code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
---|---|---|
public void ensureCapacity(int capacity) {
if (capacity > data.length) {
int newCap = Math.max(data.length << 1, capacity);
int[] tmp = new int[newCap];
System.arraycopy(data, 0, tmp, 0, data.length);
data = tmp;
}
} | class class_name[name] begin[{]
method[ensureCapacity, return_type[void], modifier[public], parameter[capacity]] begin[{]
if[binary_operation[member[.capacity], >, member[data.length]]] begin[{]
local_variable[type[int], newCap]
local_variable[type[int], tmp]
call[System.arraycopy, parameter[member[.data], literal[0], member[.tmp], literal[0], member[data.length]]]
assign[member[.data], member[.tmp]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[ensureCapacity] operator[SEP] Keyword[int] identifier[capacity] operator[SEP] {
Keyword[if] operator[SEP] identifier[capacity] operator[>] identifier[data] operator[SEP] identifier[length] operator[SEP] {
Keyword[int] identifier[newCap] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[data] operator[SEP] identifier[length] operator[<<] Other[1] , identifier[capacity] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[tmp] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[newCap] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[data] , Other[0] , identifier[tmp] , Other[0] , identifier[data] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[tmp] operator[SEP]
}
}
|
private void auditStatusWhenQualityGateDetailsFound(Map condition, CodeQualityAuditResponse codeQualityAuditResponse) {
if (StringUtils.equalsIgnoreCase(condition.get("metric").toString(), CodeQualityMetricType.BLOCKER_VIOLATIONS.getType())) {
codeQualityAuditResponse.addAuditStatus(CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_BLOCKER_FOUND);
if (!StringUtils.equalsIgnoreCase(condition.get("level").toString(), "ERROR")) {
codeQualityAuditResponse.addAuditStatus(CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_BLOCKER_MET);
}
} else if (StringUtils.equalsIgnoreCase(condition.get("metric").toString(), CodeQualityMetricType.CRITICAL_VIOLATIONS.getType())) {
codeQualityAuditResponse.addAuditStatus(CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_CRITICAL_FOUND);
if (!StringUtils.equalsIgnoreCase(condition.get("level").toString(), "ERROR")) {
codeQualityAuditResponse.addAuditStatus(CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_CRITICAL_MET);
}
} else if (StringUtils.equalsIgnoreCase(condition.get("metric").toString(), CodeQualityMetricType.UNIT_TEST.getType())) {
codeQualityAuditResponse.addAuditStatus(CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_UNIT_TEST_FOUND);
if (!StringUtils.equalsIgnoreCase(condition.get("level").toString(), "ERROR")) {
codeQualityAuditResponse.addAuditStatus(CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_UNIT_TEST_MET);
}
} else if (StringUtils.equalsIgnoreCase(condition.get("metric").toString(), CodeQualityMetricType.NEW_COVERAGE.getType())
|| StringUtils.equalsIgnoreCase(condition.get("metric").toString(), CodeQualityMetricType.COVERAGE.getType())) {
codeQualityAuditResponse.addAuditStatus(CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_CODE_COVERAGE_FOUND);
if (!StringUtils.equalsIgnoreCase(condition.get("level").toString(), "ERROR")) {
codeQualityAuditResponse.addAuditStatus(CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_CODE_COVERAGE_MET);
}
}
} | class class_name[name] begin[{]
method[auditStatusWhenQualityGateDetailsFound, return_type[void], modifier[private], parameter[condition, codeQualityAuditResponse]] begin[{]
if[call[StringUtils.equalsIgnoreCase, parameter[call[condition.get, parameter[literal["metric"]]], call[CodeQualityMetricType.BLOCKER_VIOLATIONS.getType, parameter[]]]]] begin[{]
call[codeQualityAuditResponse.addAuditStatus, parameter[member[CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_BLOCKER_FOUND]]]
if[call[StringUtils.equalsIgnoreCase, parameter[call[condition.get, parameter[literal["level"]]], literal["ERROR"]]]] begin[{]
call[codeQualityAuditResponse.addAuditStatus, parameter[member[CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_BLOCKER_MET]]]
else begin[{]
None
end[}]
else begin[{]
if[call[StringUtils.equalsIgnoreCase, parameter[call[condition.get, parameter[literal["metric"]]], call[CodeQualityMetricType.CRITICAL_VIOLATIONS.getType, parameter[]]]]] begin[{]
call[codeQualityAuditResponse.addAuditStatus, parameter[member[CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_CRITICAL_FOUND]]]
if[call[StringUtils.equalsIgnoreCase, parameter[call[condition.get, parameter[literal["level"]]], literal["ERROR"]]]] begin[{]
call[codeQualityAuditResponse.addAuditStatus, parameter[member[CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_CRITICAL_MET]]]
else begin[{]
None
end[}]
else begin[{]
if[call[StringUtils.equalsIgnoreCase, parameter[call[condition.get, parameter[literal["metric"]]], call[CodeQualityMetricType.UNIT_TEST.getType, parameter[]]]]] begin[{]
call[codeQualityAuditResponse.addAuditStatus, parameter[member[CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_UNIT_TEST_FOUND]]]
if[call[StringUtils.equalsIgnoreCase, parameter[call[condition.get, parameter[literal["level"]]], literal["ERROR"]]]] begin[{]
call[codeQualityAuditResponse.addAuditStatus, parameter[member[CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_UNIT_TEST_MET]]]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[call[StringUtils.equalsIgnoreCase, parameter[call[condition.get, parameter[literal["metric"]]], call[CodeQualityMetricType.NEW_COVERAGE.getType, parameter[]]]], ||, call[StringUtils.equalsIgnoreCase, parameter[call[condition.get, parameter[literal["metric"]]], call[CodeQualityMetricType.COVERAGE.getType, parameter[]]]]]] begin[{]
call[codeQualityAuditResponse.addAuditStatus, parameter[member[CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_CODE_COVERAGE_FOUND]]]
if[call[StringUtils.equalsIgnoreCase, parameter[call[condition.get, parameter[literal["level"]]], literal["ERROR"]]]] begin[{]
call[codeQualityAuditResponse.addAuditStatus, parameter[member[CodeQualityAuditStatus.CODE_QUALITY_THRESHOLD_CODE_COVERAGE_MET]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[auditStatusWhenQualityGateDetailsFound] operator[SEP] identifier[Map] identifier[condition] , identifier[CodeQualityAuditResponse] identifier[codeQualityAuditResponse] operator[SEP] {
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[condition] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[CodeQualityMetricType] operator[SEP] identifier[BLOCKER_VIOLATIONS] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[codeQualityAuditResponse] operator[SEP] identifier[addAuditStatus] operator[SEP] identifier[CodeQualityAuditStatus] operator[SEP] identifier[CODE_QUALITY_THRESHOLD_BLOCKER_FOUND] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[condition] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] {
identifier[codeQualityAuditResponse] operator[SEP] identifier[addAuditStatus] operator[SEP] identifier[CodeQualityAuditStatus] operator[SEP] identifier[CODE_QUALITY_THRESHOLD_BLOCKER_MET] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[condition] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[CodeQualityMetricType] operator[SEP] identifier[CRITICAL_VIOLATIONS] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[codeQualityAuditResponse] operator[SEP] identifier[addAuditStatus] operator[SEP] identifier[CodeQualityAuditStatus] operator[SEP] identifier[CODE_QUALITY_THRESHOLD_CRITICAL_FOUND] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[condition] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] {
identifier[codeQualityAuditResponse] operator[SEP] identifier[addAuditStatus] operator[SEP] identifier[CodeQualityAuditStatus] operator[SEP] identifier[CODE_QUALITY_THRESHOLD_CRITICAL_MET] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[condition] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[CodeQualityMetricType] operator[SEP] identifier[UNIT_TEST] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[codeQualityAuditResponse] operator[SEP] identifier[addAuditStatus] operator[SEP] identifier[CodeQualityAuditStatus] operator[SEP] identifier[CODE_QUALITY_THRESHOLD_UNIT_TEST_FOUND] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[condition] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] {
identifier[codeQualityAuditResponse] operator[SEP] identifier[addAuditStatus] operator[SEP] identifier[CodeQualityAuditStatus] operator[SEP] identifier[CODE_QUALITY_THRESHOLD_UNIT_TEST_MET] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[condition] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[CodeQualityMetricType] operator[SEP] identifier[NEW_COVERAGE] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[StringUtils] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[condition] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[CodeQualityMetricType] operator[SEP] identifier[COVERAGE] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[codeQualityAuditResponse] operator[SEP] identifier[addAuditStatus] operator[SEP] identifier[CodeQualityAuditStatus] operator[SEP] identifier[CODE_QUALITY_THRESHOLD_CODE_COVERAGE_FOUND] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[condition] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] {
identifier[codeQualityAuditResponse] operator[SEP] identifier[addAuditStatus] operator[SEP] identifier[CodeQualityAuditStatus] operator[SEP] identifier[CODE_QUALITY_THRESHOLD_CODE_COVERAGE_MET] operator[SEP] operator[SEP]
}
}
}
|
public static List<HostAndPort> hostAndPorts(AbstractConfig config, String key) {
return hostAndPorts(config, key, null);
} | class class_name[name] begin[{]
method[hostAndPorts, return_type[type[List]], modifier[public static], parameter[config, key]] begin[{]
return[call[.hostAndPorts, parameter[member[.config], member[.key], literal[null]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[HostAndPort] operator[>] identifier[hostAndPorts] operator[SEP] identifier[AbstractConfig] identifier[config] , identifier[String] identifier[key] operator[SEP] {
Keyword[return] identifier[hostAndPorts] operator[SEP] identifier[config] , identifier[key] , Other[null] operator[SEP] operator[SEP]
}
|
protected void activate(ComponentContext compcontext) {
if (TC.isDebugEnabled()) {
Tr.debug(TC, "Activating " + this.getClass().getName());
}
this.userTransaction.activate(compcontext);
this.transactionManager.activate(compcontext);
} | class class_name[name] begin[{]
method[activate, return_type[void], modifier[protected], parameter[compcontext]] begin[{]
if[call[TC.isDebugEnabled, parameter[]]] begin[{]
call[Tr.debug, parameter[member[.TC], binary_operation[literal["Activating "], +, THIS[call[None.getClass, parameter[]]call[None.getName, parameter[]]]]]]
else begin[{]
None
end[}]
THIS[member[None.userTransaction]call[None.activate, parameter[member[.compcontext]]]]
THIS[member[None.transactionManager]call[None.activate, parameter[member[.compcontext]]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[activate] operator[SEP] identifier[ComponentContext] identifier[compcontext] operator[SEP] {
Keyword[if] operator[SEP] identifier[TC] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[TC] , literal[String] operator[+] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[userTransaction] operator[SEP] identifier[activate] operator[SEP] identifier[compcontext] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[transactionManager] operator[SEP] identifier[activate] operator[SEP] identifier[compcontext] operator[SEP] operator[SEP]
}
|
private LinkedList<Class> getClassesToDelete() {
LinkedHashSet<Class> classesToDelete = new LinkedHashSet<Class>();
for (Object object : getObjects()) {
classesToDelete.add(object.getClass());
}
return new LinkedList<Class>(classesToDelete);
} | class class_name[name] begin[{]
method[getClassesToDelete, return_type[type[LinkedList]], modifier[private], parameter[]] begin[{]
local_variable[type[LinkedHashSet], classesToDelete]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=classesToDelete, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getObjects, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=object)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
return[ClassCreator(arguments=[MemberReference(member=classesToDelete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None))], dimensions=None, name=LinkedList, sub_type=None))]
end[}]
END[}] | Keyword[private] identifier[LinkedList] operator[<] identifier[Class] operator[>] identifier[getClassesToDelete] operator[SEP] operator[SEP] {
identifier[LinkedHashSet] operator[<] identifier[Class] operator[>] identifier[classesToDelete] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] identifier[Class] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[object] operator[:] identifier[getObjects] operator[SEP] operator[SEP] operator[SEP] {
identifier[classesToDelete] operator[SEP] identifier[add] operator[SEP] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[LinkedList] operator[<] identifier[Class] operator[>] operator[SEP] identifier[classesToDelete] operator[SEP] operator[SEP]
}
|
public static Map duplicateMap(Map map, boolean doKeysLower, boolean deepCopy) throws PageException {
if (doKeysLower) {
Map newMap;
try {
newMap = (Map) ClassUtil.loadInstance(map.getClass());
}
catch (ClassException e) {
newMap = new HashMap();
}
boolean inside = ThreadLocalDuplication.set(map, newMap);
try {
Iterator it = map.keySet().iterator();
while (it.hasNext()) {
Object key = it.next();
if (deepCopy) newMap.put(StringUtil.toLowerCase(Caster.toString(key)), duplicate(map.get(key), deepCopy));
else newMap.put(StringUtil.toLowerCase(Caster.toString(key)), map.get(key));
}
}
finally {
if (!inside) ThreadLocalDuplication.reset();
}
//
return newMap;
}
return duplicateMap(map, deepCopy);
} | class class_name[name] begin[{]
method[duplicateMap, return_type[type[Map]], modifier[public static], parameter[map, doKeysLower, deepCopy]] begin[{]
if[member[.doKeysLower]] begin[{]
local_variable[type[Map], newMap]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=newMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None)], member=loadInstance, postfix_operators=[], prefix_operators=[], qualifier=ClassUtil, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=newMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HashMap, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassException']))], finally_block=None, label=None, resources=None)
local_variable[type[boolean], inside]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=MemberReference(member=deepCopy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Caster, selectors=[], type_arguments=None)], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=newMap, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Caster, selectors=[], type_arguments=None)], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), MemberReference(member=deepCopy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=duplicate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=newMap, selectors=[], type_arguments=None), label=None))]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[IfStatement(condition=MemberReference(member=inside, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=reset, postfix_operators=[], prefix_operators=[], qualifier=ThreadLocalDuplication, selectors=[], type_arguments=None), label=None))], label=None, resources=None)
return[member[.newMap]]
else begin[{]
None
end[}]
return[call[.duplicateMap, parameter[member[.map], member[.deepCopy]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] identifier[duplicateMap] operator[SEP] identifier[Map] identifier[map] , Keyword[boolean] identifier[doKeysLower] , Keyword[boolean] identifier[deepCopy] operator[SEP] Keyword[throws] identifier[PageException] {
Keyword[if] operator[SEP] identifier[doKeysLower] operator[SEP] {
identifier[Map] identifier[newMap] operator[SEP] Keyword[try] {
identifier[newMap] operator[=] operator[SEP] identifier[Map] operator[SEP] identifier[ClassUtil] operator[SEP] identifier[loadInstance] operator[SEP] identifier[map] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassException] identifier[e] operator[SEP] {
identifier[newMap] operator[=] Keyword[new] identifier[HashMap] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[boolean] identifier[inside] operator[=] identifier[ThreadLocalDuplication] operator[SEP] identifier[set] operator[SEP] identifier[map] , identifier[newMap] operator[SEP] operator[SEP] Keyword[try] {
identifier[Iterator] identifier[it] operator[=] identifier[map] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[Object] identifier[key] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[deepCopy] operator[SEP] identifier[newMap] operator[SEP] identifier[put] operator[SEP] identifier[StringUtil] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[Caster] operator[SEP] identifier[toString] operator[SEP] identifier[key] operator[SEP] operator[SEP] , identifier[duplicate] operator[SEP] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] , identifier[deepCopy] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[newMap] operator[SEP] identifier[put] operator[SEP] identifier[StringUtil] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[Caster] operator[SEP] identifier[toString] operator[SEP] identifier[key] operator[SEP] operator[SEP] , identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[finally] {
Keyword[if] operator[SEP] operator[!] identifier[inside] operator[SEP] identifier[ThreadLocalDuplication] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[newMap] operator[SEP]
}
Keyword[return] identifier[duplicateMap] operator[SEP] identifier[map] , identifier[deepCopy] operator[SEP] operator[SEP]
}
|
public FieldErrorBuilder variables(final String key, final Object value) {
this.variables.put(key, value);
return this;
} | class class_name[name] begin[{]
method[variables, return_type[type[FieldErrorBuilder]], modifier[public], parameter[key, value]] begin[{]
THIS[member[None.variables]call[None.put, parameter[member[.key], member[.value]]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[FieldErrorBuilder] identifier[variables] operator[SEP] Keyword[final] identifier[String] identifier[key] , Keyword[final] identifier[Object] identifier[value] operator[SEP] {
Keyword[this] operator[SEP] identifier[variables] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
protected MtasDataItemDoubleFull getItem(int i) {
if (i >= 0 && i < size) {
return new MtasDataItemDoubleFull(
ArrayUtils.toPrimitive(fullValueList[i]),
hasSub() ? subCollectorListNextLevel[i] : null, getStatsItems(),
sortType, sortDirection, errorNumber[i], errorList[i],
sourceNumberList[i]);
} else {
return null;
}
} | class class_name[name] begin[{]
method[getItem, return_type[type[MtasDataItemDoubleFull]], modifier[protected], parameter[i]] begin[{]
if[binary_operation[binary_operation[member[.i], >=, literal[0]], &&, binary_operation[member[.i], <, member[.size]]]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=fullValueList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=toPrimitive, postfix_operators=[], prefix_operators=[], qualifier=ArrayUtils, selectors=[], type_arguments=None), TernaryExpression(condition=MethodInvocation(arguments=[], member=hasSub, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MemberReference(member=subCollectorListNextLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), MethodInvocation(arguments=[], member=getStatsItems, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=sortType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sortDirection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=errorNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=errorList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=sourceNumberList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=MtasDataItemDoubleFull, sub_type=None))]
else begin[{]
return[literal[null]]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] identifier[MtasDataItemDoubleFull] identifier[getItem] operator[SEP] Keyword[int] identifier[i] operator[SEP] {
Keyword[if] operator[SEP] identifier[i] operator[>=] Other[0] operator[&&] identifier[i] operator[<] identifier[size] operator[SEP] {
Keyword[return] Keyword[new] identifier[MtasDataItemDoubleFull] operator[SEP] identifier[ArrayUtils] operator[SEP] identifier[toPrimitive] operator[SEP] identifier[fullValueList] operator[SEP] identifier[i] operator[SEP] operator[SEP] , identifier[hasSub] operator[SEP] operator[SEP] operator[?] identifier[subCollectorListNextLevel] operator[SEP] identifier[i] operator[SEP] operator[:] Other[null] , identifier[getStatsItems] operator[SEP] operator[SEP] , identifier[sortType] , identifier[sortDirection] , identifier[errorNumber] operator[SEP] identifier[i] operator[SEP] , identifier[errorList] operator[SEP] identifier[i] operator[SEP] , identifier[sourceNumberList] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] Other[null] operator[SEP]
}
}
|
public static String getKeyString(Server server, Query query, Result result, List<String> typeNames, String rootPrefix) {
StringBuilder sb = new StringBuilder();
addRootPrefix(rootPrefix, sb);
addAlias(server, sb);
addSeparator(sb);
addMBeanIdentifier(query, result, sb);
addSeparator(sb);
addTypeName(query, result, typeNames, sb);
addKeyString(query, result, sb);
return sb.toString();
} | class class_name[name] begin[{]
method[getKeyString, return_type[type[String]], modifier[public static], parameter[server, query, result, typeNames, rootPrefix]] begin[{]
local_variable[type[StringBuilder], sb]
call[.addRootPrefix, parameter[member[.rootPrefix], member[.sb]]]
call[.addAlias, parameter[member[.server], member[.sb]]]
call[.addSeparator, parameter[member[.sb]]]
call[.addMBeanIdentifier, parameter[member[.query], member[.result], member[.sb]]]
call[.addSeparator, parameter[member[.sb]]]
call[.addTypeName, parameter[member[.query], member[.result], member[.typeNames], member[.sb]]]
call[.addKeyString, parameter[member[.query], member[.result], member[.sb]]]
return[call[sb.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getKeyString] operator[SEP] identifier[Server] identifier[server] , identifier[Query] identifier[query] , identifier[Result] identifier[result] , identifier[List] operator[<] identifier[String] operator[>] identifier[typeNames] , identifier[String] identifier[rootPrefix] operator[SEP] {
identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[addRootPrefix] operator[SEP] identifier[rootPrefix] , identifier[sb] operator[SEP] operator[SEP] identifier[addAlias] operator[SEP] identifier[server] , identifier[sb] operator[SEP] operator[SEP] identifier[addSeparator] operator[SEP] identifier[sb] operator[SEP] operator[SEP] identifier[addMBeanIdentifier] operator[SEP] identifier[query] , identifier[result] , identifier[sb] operator[SEP] operator[SEP] identifier[addSeparator] operator[SEP] identifier[sb] operator[SEP] operator[SEP] identifier[addTypeName] operator[SEP] identifier[query] , identifier[result] , identifier[typeNames] , identifier[sb] operator[SEP] operator[SEP] identifier[addKeyString] operator[SEP] identifier[query] , identifier[result] , identifier[sb] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
protected String getUniqueTargetNamespace(String targetNamespacePrefix,
final String baseName) throws IOException {
if (targetNamespacePrefix == null
|| targetNamespacePrefix.length() == 0) {
return null;
}
if (baseName == null || baseName.length() == 0) {
throw new IOException("No target basename was provided");
}
if (targetNamespacePrefix.charAt(targetNamespacePrefix.length() - 1) == '/') {
return targetNamespacePrefix + baseName;
} else {
return targetNamespacePrefix + '/' + baseName;
}
} | class class_name[name] begin[{]
method[getUniqueTargetNamespace, return_type[type[String]], modifier[protected], parameter[targetNamespacePrefix, baseName]] begin[{]
if[binary_operation[binary_operation[member[.targetNamespacePrefix], ==, literal[null]], ||, binary_operation[call[targetNamespacePrefix.length, parameter[]], ==, literal[0]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.baseName], ==, literal[null]], ||, binary_operation[call[baseName.length, parameter[]], ==, literal[0]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No target basename was provided")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[call[targetNamespacePrefix.charAt, parameter[binary_operation[call[targetNamespacePrefix.length, parameter[]], -, literal[1]]]], ==, literal['/']]] begin[{]
return[binary_operation[member[.targetNamespacePrefix], +, member[.baseName]]]
else begin[{]
return[binary_operation[binary_operation[member[.targetNamespacePrefix], +, literal['/']], +, member[.baseName]]]
end[}]
end[}]
END[}] | Keyword[protected] identifier[String] identifier[getUniqueTargetNamespace] operator[SEP] identifier[String] identifier[targetNamespacePrefix] , Keyword[final] identifier[String] identifier[baseName] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[targetNamespacePrefix] operator[==] Other[null] operator[||] identifier[targetNamespacePrefix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[baseName] operator[==] Other[null] operator[||] identifier[baseName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[targetNamespacePrefix] operator[SEP] identifier[charAt] operator[SEP] identifier[targetNamespacePrefix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] {
Keyword[return] identifier[targetNamespacePrefix] operator[+] identifier[baseName] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[targetNamespacePrefix] operator[+] literal[String] operator[+] identifier[baseName] operator[SEP]
}
}
|
public JSONObject getJSONObject() {
TextFile df = getDataFile();
if(df.exists()) {
try {
return JSONObject.fromObject(df.read());
} catch (JSONException | IOException e) {
LOGGER.log(Level.SEVERE,"Failed to parse "+df,e);
df.delete(); // if we keep this file, it will cause repeated failures
return null;
}
} else {
return null;
}
} | class class_name[name] begin[{]
method[getJSONObject, return_type[type[JSONObject]], modifier[public], parameter[]] begin[{]
local_variable[type[TextFile], df]
if[call[df.exists, parameter[]]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=read, postfix_operators=[], prefix_operators=[], qualifier=df, selectors=[], type_arguments=None)], member=fromObject, postfix_operators=[], prefix_operators=[], qualifier=JSONObject, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to parse "), operandr=MemberReference(member=df, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=delete, postfix_operators=[], prefix_operators=[], qualifier=df, 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=['JSONException', 'IOException']))], finally_block=None, label=None, resources=None)
else begin[{]
return[literal[null]]
end[}]
end[}]
END[}] | Keyword[public] identifier[JSONObject] identifier[getJSONObject] operator[SEP] operator[SEP] {
identifier[TextFile] identifier[df] operator[=] identifier[getDataFile] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[df] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[JSONObject] operator[SEP] identifier[fromObject] operator[SEP] identifier[df] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[JSONException] operator[|] identifier[IOException] identifier[e] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] operator[+] identifier[df] , identifier[e] operator[SEP] operator[SEP] identifier[df] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
}
Keyword[else] {
Keyword[return] Other[null] operator[SEP]
}
}
|
private String getTargetColumnName(String sourceColumnName, String alias) {
String targetColumnName = alias;
Schema obj = this.getMetadataColumnMap().get(sourceColumnName.toLowerCase());
if (obj == null) {
targetColumnName = (targetColumnName == null ? "unknown" + this.unknownColumnCounter : targetColumnName);
this.unknownColumnCounter++;
} else {
targetColumnName = (StringUtils.isNotBlank(targetColumnName) ? targetColumnName : sourceColumnName);
}
targetColumnName = this.toCase(targetColumnName);
return Utils.escapeSpecialCharacters(targetColumnName, ConfigurationKeys.ESCAPE_CHARS_IN_COLUMN_NAME, "_");
} | class class_name[name] begin[{]
method[getTargetColumnName, return_type[type[String]], modifier[private], parameter[sourceColumnName, alias]] begin[{]
local_variable[type[String], targetColumnName]
local_variable[type[Schema], obj]
if[binary_operation[member[.obj], ==, literal[null]]] begin[{]
assign[member[.targetColumnName], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=targetColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=targetColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unknown"), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=unknownColumnCounter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=+))]
THIS[member[None.unknownColumnCounter]]
else begin[{]
assign[member[.targetColumnName], TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=targetColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNotBlank, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), if_false=MemberReference(member=sourceColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=targetColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
end[}]
assign[member[.targetColumnName], THIS[call[None.toCase, parameter[member[.targetColumnName]]]]]
return[call[Utils.escapeSpecialCharacters, parameter[member[.targetColumnName], member[ConfigurationKeys.ESCAPE_CHARS_IN_COLUMN_NAME], literal["_"]]]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[getTargetColumnName] operator[SEP] identifier[String] identifier[sourceColumnName] , identifier[String] identifier[alias] operator[SEP] {
identifier[String] identifier[targetColumnName] operator[=] identifier[alias] operator[SEP] identifier[Schema] identifier[obj] operator[=] Keyword[this] operator[SEP] identifier[getMetadataColumnMap] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[sourceColumnName] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[obj] operator[==] Other[null] operator[SEP] {
identifier[targetColumnName] operator[=] operator[SEP] identifier[targetColumnName] operator[==] Other[null] operator[?] literal[String] operator[+] Keyword[this] operator[SEP] identifier[unknownColumnCounter] operator[:] identifier[targetColumnName] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[unknownColumnCounter] operator[++] operator[SEP]
}
Keyword[else] {
identifier[targetColumnName] operator[=] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[targetColumnName] operator[SEP] operator[?] identifier[targetColumnName] operator[:] identifier[sourceColumnName] operator[SEP] operator[SEP]
}
identifier[targetColumnName] operator[=] Keyword[this] operator[SEP] identifier[toCase] operator[SEP] identifier[targetColumnName] operator[SEP] operator[SEP] Keyword[return] identifier[Utils] operator[SEP] identifier[escapeSpecialCharacters] operator[SEP] identifier[targetColumnName] , identifier[ConfigurationKeys] operator[SEP] identifier[ESCAPE_CHARS_IN_COLUMN_NAME] , literal[String] operator[SEP] operator[SEP]
}
|
@Trivial
public static String getSymbol(String s) {
String outputSymbol = null;
if (s != null) {
if (s.length() > 3) {
// ${} .. look for $
int pos = s.indexOf('$');
if (pos >= 0) {
// look for { after $
int pos2 = pos + 1;
if (s.length() > pos2) {
if (s.charAt(pos2) == '{') {
// look for } after {
pos2 = s.indexOf('}', pos2);
if (pos2 >= 0) {
outputSymbol = s.substring(pos, pos2 + 1);
}
}
}
}
}
}
return outputSymbol;
} | class class_name[name] begin[{]
method[getSymbol, return_type[type[String]], modifier[public static], parameter[s]] begin[{]
local_variable[type[String], outputSymbol]
if[binary_operation[member[.s], !=, literal[null]]] begin[{]
if[binary_operation[call[s.length, parameter[]], >, literal[3]]] begin[{]
local_variable[type[int], pos]
if[binary_operation[member[.pos], >=, literal[0]]] begin[{]
local_variable[type[int], pos2]
if[binary_operation[call[s.length, parameter[]], >, member[.pos2]]] begin[{]
if[binary_operation[call[s.charAt, parameter[member[.pos2]]], ==, literal['{']]] begin[{]
assign[member[.pos2], call[s.indexOf, parameter[literal['}'], member[.pos2]]]]
if[binary_operation[member[.pos2], >=, literal[0]]] begin[{]
assign[member[.outputSymbol], call[s.substring, parameter[member[.pos], binary_operation[member[.pos2], +, literal[1]]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.outputSymbol]]
end[}]
END[}] | annotation[@] identifier[Trivial] Keyword[public] Keyword[static] identifier[String] identifier[getSymbol] operator[SEP] identifier[String] identifier[s] operator[SEP] {
identifier[String] identifier[outputSymbol] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[3] operator[SEP] {
Keyword[int] identifier[pos] operator[=] identifier[s] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[>=] Other[0] operator[SEP] {
Keyword[int] identifier[pos2] operator[=] identifier[pos] operator[+] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[pos2] operator[SEP] {
Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[pos2] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[pos2] operator[=] identifier[s] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[pos2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pos2] operator[>=] Other[0] operator[SEP] {
identifier[outputSymbol] operator[=] identifier[s] operator[SEP] identifier[substring] operator[SEP] identifier[pos] , identifier[pos2] operator[+] Other[1] operator[SEP] operator[SEP]
}
}
}
}
}
}
Keyword[return] identifier[outputSymbol] operator[SEP]
}
|
public java.util.List<AggregationAuthorization> getAggregationAuthorizations() {
if (aggregationAuthorizations == null) {
aggregationAuthorizations = new com.amazonaws.internal.SdkInternalList<AggregationAuthorization>();
}
return aggregationAuthorizations;
} | class class_name[name] begin[{]
method[getAggregationAuthorizations, return_type[type[java]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.aggregationAuthorizations], ==, literal[null]]] begin[{]
assign[member[.aggregationAuthorizations], ClassCreator(arguments=[], 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=AggregationAuthorization, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
else begin[{]
None
end[}]
return[member[.aggregationAuthorizations]]
end[}]
END[}] | Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[AggregationAuthorization] operator[>] identifier[getAggregationAuthorizations] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[aggregationAuthorizations] operator[==] Other[null] operator[SEP] {
identifier[aggregationAuthorizations] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[AggregationAuthorization] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[aggregationAuthorizations] operator[SEP]
}
|
@Override
public List<CPMeasurementUnit> findByG_T(long groupId, int type) {
return findByG_T(groupId, type, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
null);
} | class class_name[name] begin[{]
method[findByG_T, return_type[type[List]], modifier[public], parameter[groupId, type]] begin[{]
return[call[.findByG_T, parameter[member[.groupId], member[.type], member[QueryUtil.ALL_POS], member[QueryUtil.ALL_POS], literal[null]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[CPMeasurementUnit] operator[>] identifier[findByG_T] operator[SEP] Keyword[long] identifier[groupId] , Keyword[int] identifier[type] operator[SEP] {
Keyword[return] identifier[findByG_T] operator[SEP] identifier[groupId] , identifier[type] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , Other[null] operator[SEP] operator[SEP]
}
|
final static protected List<FileStatus> listStatus(JobContext job
) throws IOException {
List<FileStatus> result = new ArrayList<FileStatus>();
Path[] dirs = getInputPaths(job);
if (dirs.length == 0) {
throw new IOException("No input paths specified in job");
}
List<IOException> errors = new ArrayList<IOException>();
// creates a MultiPathFilter with the hiddenFileFilter and the
// user provided one (if any).
List<PathFilter> filters = new ArrayList<PathFilter>();
filters.add(hiddenFileFilter);
PathFilter jobFilter = getInputPathFilter(job);
if (jobFilter != null) {
filters.add(jobFilter);
}
PathFilter inputFilter = new MultiPathFilter(filters);
for (int i=0; i < dirs.length; ++i) {
Path p = dirs[i];
FileSystem fs = p.getFileSystem(job.getConfiguration());
FileStatus[] matches = fs.globStatus(p, inputFilter);
if (matches == null) {
errors.add(new IOException("Input path does not exist: " + p));
} else if (matches.length == 0) {
errors.add(new IOException("Input Pattern " + p + " matches 0 files"));
} else {
for (FileStatus globStat: matches) {
if (globStat.isDir()) {
for(FileStatus stat: fs.listStatus(globStat.getPath(),
inputFilter)) {
result.add(stat);
}
} else {
result.add(globStat);
}
}
}
}
if (!errors.isEmpty()) {
throw new InvalidInputException(errors);
}
LOG.info("Total input paths to process : " + result.size());
return result;
} | class class_name[name] begin[{]
method[listStatus, return_type[type[List]], modifier[protected final static], parameter[job]] begin[{]
local_variable[type[List], result]
local_variable[type[Path], dirs]
if[binary_operation[member[dirs.length], ==, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No input paths specified in job")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[List], errors]
local_variable[type[List], filters]
call[filters.add, parameter[member[.hiddenFileFilter]]]
local_variable[type[PathFilter], jobFilter]
if[binary_operation[member[.jobFilter], !=, literal[null]]] begin[{]
call[filters.add, parameter[member[.jobFilter]]]
else begin[{]
None
end[}]
local_variable[type[PathFilter], inputFilter]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=dirs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getConfiguration, postfix_operators=[], prefix_operators=[], qualifier=job, selectors=[], type_arguments=None)], member=getFileSystem, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), name=fs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileSystem, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inputFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=globStatus, postfix_operators=[], prefix_operators=[], qualifier=fs, selectors=[], type_arguments=None), name=matches)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=FileStatus, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=matches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=matches, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDir, postfix_operators=[], prefix_operators=[], qualifier=globStat, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=globStat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=globStat, selectors=[], type_arguments=None), MemberReference(member=inputFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=listStatus, postfix_operators=[], prefix_operators=[], qualifier=fs, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=stat)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileStatus, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=matches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=globStat)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileStatus, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Input Pattern "), operandr=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" matches 0 files"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=errors, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Input path does not exist: "), operandr=MemberReference(member=p, 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=IOException, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=errors, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=dirs, 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[call[errors.isEmpty, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=errors, 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=InvalidInputException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[LOG.info, parameter[binary_operation[literal["Total input paths to process : "], +, call[result.size, parameter[]]]]]
return[member[.result]]
end[}]
END[}] | Keyword[final] Keyword[static] Keyword[protected] identifier[List] operator[<] identifier[FileStatus] operator[>] identifier[listStatus] operator[SEP] identifier[JobContext] identifier[job] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[List] operator[<] identifier[FileStatus] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[FileStatus] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Path] operator[SEP] operator[SEP] identifier[dirs] operator[=] identifier[getInputPaths] operator[SEP] identifier[job] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dirs] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[IOException] operator[>] identifier[errors] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[IOException] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[PathFilter] operator[>] identifier[filters] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[PathFilter] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[filters] operator[SEP] identifier[add] operator[SEP] identifier[hiddenFileFilter] operator[SEP] operator[SEP] identifier[PathFilter] identifier[jobFilter] operator[=] identifier[getInputPathFilter] operator[SEP] identifier[job] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jobFilter] operator[!=] Other[null] operator[SEP] {
identifier[filters] operator[SEP] identifier[add] operator[SEP] identifier[jobFilter] operator[SEP] operator[SEP]
}
identifier[PathFilter] identifier[inputFilter] operator[=] Keyword[new] identifier[MultiPathFilter] operator[SEP] identifier[filters] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[dirs] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[Path] identifier[p] operator[=] identifier[dirs] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[FileSystem] identifier[fs] operator[=] identifier[p] operator[SEP] identifier[getFileSystem] operator[SEP] identifier[job] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[FileStatus] operator[SEP] operator[SEP] identifier[matches] operator[=] identifier[fs] operator[SEP] identifier[globStatus] operator[SEP] identifier[p] , identifier[inputFilter] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matches] operator[==] Other[null] operator[SEP] {
identifier[errors] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[p] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[matches] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
identifier[errors] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[p] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[for] operator[SEP] identifier[FileStatus] identifier[globStat] operator[:] identifier[matches] operator[SEP] {
Keyword[if] operator[SEP] identifier[globStat] operator[SEP] identifier[isDir] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[FileStatus] identifier[stat] operator[:] identifier[fs] operator[SEP] identifier[listStatus] operator[SEP] identifier[globStat] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[inputFilter] operator[SEP] operator[SEP] {
identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[stat] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[globStat] operator[SEP] operator[SEP]
}
}
}
}
Keyword[if] operator[SEP] operator[!] identifier[errors] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[InvalidInputException] operator[SEP] identifier[errors] operator[SEP] operator[SEP]
}
identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[result] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public EmbeddedMongoDB withVersion(Version.Main version) {
Objects.requireNonNull(version, "version can not be null");
this.version = version;
return this;
} | class class_name[name] begin[{]
method[withVersion, return_type[type[EmbeddedMongoDB]], modifier[public], parameter[version]] begin[{]
call[Objects.requireNonNull, parameter[member[.version], literal["version can not be null"]]]
assign[THIS[member[None.version]], member[.version]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[EmbeddedMongoDB] identifier[withVersion] operator[SEP] identifier[Version] operator[SEP] identifier[Main] identifier[version] operator[SEP] {
identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[version] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[version] operator[=] identifier[version] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public void addAttack(Attack attack) {
logger.warn("Security attack " + attack.getName() + " triggered by user: " + attack.getUser().getUsername());
attacks.add(attack);
super.notifyListeners(attack);
} | class class_name[name] begin[{]
method[addAttack, return_type[void], modifier[public], parameter[attack]] begin[{]
call[logger.warn, parameter[binary_operation[binary_operation[binary_operation[literal["Security attack "], +, call[attack.getName, parameter[]]], +, literal[" triggered by user: "]], +, call[attack.getUser, parameter[]]]]]
call[attacks.add, parameter[member[.attack]]]
SuperMethodInvocation(arguments=[MemberReference(member=attack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=notifyListeners, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[addAttack] operator[SEP] identifier[Attack] identifier[attack] operator[SEP] {
identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[attack] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[attack] operator[SEP] identifier[getUser] operator[SEP] operator[SEP] operator[SEP] identifier[getUsername] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[attacks] operator[SEP] identifier[add] operator[SEP] identifier[attack] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[notifyListeners] operator[SEP] identifier[attack] operator[SEP] operator[SEP]
}
|
Method findBridgedMethod() {
if (!bridgeMethod.isBridge()) {
return bridgeMethod;
}
// Gather all methods with matching name and parameter size.
List<Method> candidateMethods = reflect().methods().deep()
.filter(new SimpleBridgeCandidatePredicate())
.from(bridgeMethod.getDeclaringClass());
if (candidateMethods.isEmpty()) {
throw new ReflectionException("Unable to locate bridged method for bridge method '" + bridgeMethod + '\'');
} else if (candidateMethods.size() > 1) {
Predicate bridgeCandidate = new BridgeCandidatePredicate();
return (Method) candidateMethods.stream()
.filter(bridgeCandidate)
.findAny().orElse(null);
}
return candidateMethods.iterator().next();
} | class class_name[name] begin[{]
method[findBridgedMethod, return_type[type[Method]], modifier[default], parameter[]] begin[{]
if[call[bridgeMethod.isBridge, parameter[]]] begin[{]
return[member[.bridgeMethod]]
else begin[{]
None
end[}]
local_variable[type[List], candidateMethods]
if[call[candidateMethods.isEmpty, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to locate bridged method for bridge method '"), operandr=MemberReference(member=bridgeMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\''), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReflectionException, sub_type=None)), label=None)
else begin[{]
if[binary_operation[call[candidateMethods.size, parameter[]], >, literal[1]]] begin[{]
local_variable[type[Predicate], bridgeCandidate]
return[Cast(expression=MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=candidateMethods, selectors=[MethodInvocation(arguments=[MemberReference(member=bridgeCandidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=filter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=findAny, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=orElse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None))]
else begin[{]
None
end[}]
end[}]
return[call[candidateMethods.iterator, parameter[]]]
end[}]
END[}] | identifier[Method] identifier[findBridgedMethod] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[bridgeMethod] operator[SEP] identifier[isBridge] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[bridgeMethod] operator[SEP]
}
identifier[List] operator[<] identifier[Method] operator[>] identifier[candidateMethods] operator[=] identifier[reflect] operator[SEP] operator[SEP] operator[SEP] identifier[methods] operator[SEP] operator[SEP] operator[SEP] identifier[deep] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] Keyword[new] identifier[SimpleBridgeCandidatePredicate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[from] operator[SEP] identifier[bridgeMethod] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[candidateMethods] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ReflectionException] operator[SEP] literal[String] operator[+] identifier[bridgeMethod] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[candidateMethods] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] {
identifier[Predicate] identifier[bridgeCandidate] operator[=] Keyword[new] identifier[BridgeCandidatePredicate] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[Method] operator[SEP] identifier[candidateMethods] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[bridgeCandidate] operator[SEP] operator[SEP] identifier[findAny] operator[SEP] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
Keyword[return] identifier[candidateMethods] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void close() throws IOException {
if (this.in != null) {
this.in.close();
}
if (!this.tempFile.delete()) {
LOG.warn("Cannot delete tempFile: " + this.tempFile.getAbsolutePath());
throw new IOException("Cannot delete tempFile: " + this.tempFile.getAbsolutePath());
}
;
} | class class_name[name] begin[{]
method[close, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[THIS[member[None.in]], !=, literal[null]]] begin[{]
THIS[member[None.in]call[None.close, parameter[]]]
else begin[{]
None
end[}]
if[THIS[member[None.tempFile]call[None.delete, parameter[]]]] begin[{]
call[LOG.warn, parameter[binary_operation[literal["Cannot delete tempFile: "], +, THIS[member[None.tempFile]call[None.getAbsolutePath, parameter[]]]]]]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot delete tempFile: "), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=tempFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
Statement(label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[in] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[in] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[tempFile] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[tempFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[tempFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
} operator[SEP]
}
|
public static CmsXmlContainerPage unmarshal(CmsObject cms, CmsFile file, boolean keepEncoding)
throws CmsXmlException {
return unmarshal(cms, file, keepEncoding, false);
} | class class_name[name] begin[{]
method[unmarshal, return_type[type[CmsXmlContainerPage]], modifier[public static], parameter[cms, file, keepEncoding]] begin[{]
return[call[.unmarshal, parameter[member[.cms], member[.file], member[.keepEncoding], literal[false]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[CmsXmlContainerPage] identifier[unmarshal] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[CmsFile] identifier[file] , Keyword[boolean] identifier[keepEncoding] operator[SEP] Keyword[throws] identifier[CmsXmlException] {
Keyword[return] identifier[unmarshal] operator[SEP] identifier[cms] , identifier[file] , identifier[keepEncoding] , literal[boolean] operator[SEP] operator[SEP]
}
|
public static Short checkNull(Short value, short elseValue) {
return checkNull(value, Short.valueOf(elseValue));
} | class class_name[name] begin[{]
method[checkNull, return_type[type[Short]], modifier[public static], parameter[value, elseValue]] begin[{]
return[call[.checkNull, parameter[member[.value], call[Short.valueOf, parameter[member[.elseValue]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Short] identifier[checkNull] operator[SEP] identifier[Short] identifier[value] , Keyword[short] identifier[elseValue] operator[SEP] {
Keyword[return] identifier[checkNull] operator[SEP] identifier[value] , identifier[Short] operator[SEP] identifier[valueOf] operator[SEP] identifier[elseValue] operator[SEP] operator[SEP] operator[SEP]
}
|
public String convert(Long theMoney, Long theKopeiki) {
if (theMoney == null) {
throw new IllegalArgumentException("theMoney is null");
}
if (theKopeiki == null) {
throw new IllegalArgumentException("theKopeiki is null");
}
StringBuilder money2str = new StringBuilder();
Long triadNum = 0L;
Long theTriad;
Long intPart = theMoney;
if (intPart == 0) {
money2str.append(messages.get("0")[0] + " ");
}
do {
theTriad = intPart % NUM1000;
money2str.insert(0, triad2Word(theTriad, triadNum, rubSex));
if (triadNum == 0) {
if ((theTriad % NUM100) / NUM10 == NUM1) {
money2str.append(rubFiveUnit);
} else {
switch (Long.valueOf(theTriad % NUM10).byteValue()) {
case NUM1:
money2str.append(rubOneUnit);
break;
case NUM2:
case NUM3:
case NUM4:
money2str.append(rubTwoUnit);
break;
default:
money2str.append(rubFiveUnit);
break;
}
}
}
intPart /= NUM1000;
triadNum++;
} while (intPart > 0);
if (pennies == Pennies.TEXT) {
money2str.append(language == Language.ENG ? " and " : " ").append(
theKopeiki == 0 ? messages.get("0")[0] + " " : triad2Word(theKopeiki, 0L, kopSex));
} else {
money2str.append(" " + (theKopeiki < 10 ? "0" + theKopeiki : theKopeiki) + " ");
}
if (theKopeiki >= NUM11 && theKopeiki <= NUM14) {
money2str.append(kopFiveUnit);
} else {
switch ((byte) (theKopeiki % NUM10)) {
case NUM1:
money2str.append(kopOneUnit);
break;
case NUM2:
case NUM3:
case NUM4:
money2str.append(kopTwoUnit);
break;
default:
money2str.append(kopFiveUnit);
break;
}
}
return money2str.toString().trim();
} | class class_name[name] begin[{]
method[convert, return_type[type[String]], modifier[public], parameter[theMoney, theKopeiki]] begin[{]
if[binary_operation[member[.theMoney], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="theMoney is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.theKopeiki], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="theKopeiki is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[StringBuilder], money2str]
local_variable[type[Long], triadNum]
local_variable[type[Long], theTriad]
local_variable[type[Long], intPart]
if[binary_operation[member[.intPart], ==, literal[0]]] begin[{]
call[money2str.append, parameter[binary_operation[call[messages.get, parameter[literal["0"]]], +, literal[" "]]]]
else begin[{]
None
end[}]
do[binary_operation[member[.intPart], >, literal[0]]] begin[{]
assign[member[.theTriad], binary_operation[member[.intPart], %, member[.NUM1000]]]
call[money2str.insert, parameter[literal[0], call[.triad2Word, parameter[member[.theTriad], member[.triadNum], member[.rubSex]]]]]
if[binary_operation[member[.triadNum], ==, literal[0]]] begin[{]
if[binary_operation[binary_operation[binary_operation[member[.theTriad], %, member[.NUM100]], /, member[.NUM10]], ==, member[.NUM1]]] begin[{]
call[money2str.append, parameter[member[.rubFiveUnit]]]
else begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=['NUM1'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rubOneUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=money2str, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['NUM2', 'NUM3', 'NUM4'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rubTwoUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=money2str, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rubFiveUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=money2str, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=theTriad, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NUM10, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[MethodInvocation(arguments=[], member=byteValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)
end[}]
else begin[{]
None
end[}]
assign[member[.intPart], member[.NUM1000]]
member[.triadNum]
end[}]
if[binary_operation[member[.pennies], ==, member[Pennies.TEXT]]] begin[{]
call[money2str.append, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=language, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ENG, postfix_operators=[], prefix_operators=[], qualifier=Language, selectors=[]), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" and "))]]
else begin[{]
call[money2str.append, parameter[binary_operation[binary_operation[literal[" "], +, TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=theKopeiki, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=<), if_false=MemberReference(member=theKopeiki, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0"), operandr=MemberReference(member=theKopeiki, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))], +, literal[" "]]]]
end[}]
if[binary_operation[binary_operation[member[.theKopeiki], >=, member[.NUM11]], &&, binary_operation[member[.theKopeiki], <=, member[.NUM14]]]] begin[{]
call[money2str.append, parameter[member[.kopFiveUnit]]]
else begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=['NUM1'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=kopOneUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=money2str, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['NUM2', 'NUM3', 'NUM4'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=kopTwoUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=money2str, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=kopFiveUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=money2str, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=Cast(expression=BinaryOperation(operandl=MemberReference(member=theKopeiki, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NUM10, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%), type=BasicType(dimensions=[], name=byte)), label=None)
end[}]
return[call[money2str.toString, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[convert] operator[SEP] identifier[Long] identifier[theMoney] , identifier[Long] identifier[theKopeiki] operator[SEP] {
Keyword[if] operator[SEP] identifier[theMoney] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[theKopeiki] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[StringBuilder] identifier[money2str] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[Long] identifier[triadNum] operator[=] Other[0L] operator[SEP] identifier[Long] identifier[theTriad] operator[SEP] identifier[Long] identifier[intPart] operator[=] identifier[theMoney] operator[SEP] Keyword[if] operator[SEP] identifier[intPart] operator[==] Other[0] operator[SEP] {
identifier[money2str] operator[SEP] identifier[append] operator[SEP] identifier[messages] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[do] {
identifier[theTriad] operator[=] identifier[intPart] operator[%] identifier[NUM1000] operator[SEP] identifier[money2str] operator[SEP] identifier[insert] operator[SEP] Other[0] , identifier[triad2Word] operator[SEP] identifier[theTriad] , identifier[triadNum] , identifier[rubSex] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[triadNum] operator[==] Other[0] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[theTriad] operator[%] identifier[NUM100] operator[SEP] operator[/] identifier[NUM10] operator[==] identifier[NUM1] operator[SEP] {
identifier[money2str] operator[SEP] identifier[append] operator[SEP] identifier[rubFiveUnit] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[switch] operator[SEP] identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[theTriad] operator[%] identifier[NUM10] operator[SEP] operator[SEP] identifier[byteValue] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] identifier[NUM1] operator[:] identifier[money2str] operator[SEP] identifier[append] operator[SEP] identifier[rubOneUnit] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[NUM2] operator[:] Keyword[case] identifier[NUM3] operator[:] Keyword[case] identifier[NUM4] operator[:] identifier[money2str] operator[SEP] identifier[append] operator[SEP] identifier[rubTwoUnit] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[money2str] operator[SEP] identifier[append] operator[SEP] identifier[rubFiveUnit] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
}
identifier[intPart] operator[/=] identifier[NUM1000] operator[SEP] identifier[triadNum] operator[++] operator[SEP]
}
Keyword[while] operator[SEP] identifier[intPart] operator[>] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pennies] operator[==] identifier[Pennies] operator[SEP] identifier[TEXT] operator[SEP] {
identifier[money2str] operator[SEP] identifier[append] operator[SEP] identifier[language] operator[==] identifier[Language] operator[SEP] identifier[ENG] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[theKopeiki] operator[==] Other[0] operator[?] identifier[messages] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[+] literal[String] operator[:] identifier[triad2Word] operator[SEP] identifier[theKopeiki] , Other[0L] , identifier[kopSex] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[money2str] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] operator[SEP] identifier[theKopeiki] operator[<] Other[10] operator[?] literal[String] operator[+] identifier[theKopeiki] operator[:] identifier[theKopeiki] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[theKopeiki] operator[>=] identifier[NUM11] operator[&&] identifier[theKopeiki] operator[<=] identifier[NUM14] operator[SEP] {
identifier[money2str] operator[SEP] identifier[append] operator[SEP] identifier[kopFiveUnit] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[switch] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[theKopeiki] operator[%] identifier[NUM10] operator[SEP] operator[SEP] {
Keyword[case] identifier[NUM1] operator[:] identifier[money2str] operator[SEP] identifier[append] operator[SEP] identifier[kopOneUnit] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[NUM2] operator[:] Keyword[case] identifier[NUM3] operator[:] Keyword[case] identifier[NUM4] operator[:] identifier[money2str] operator[SEP] identifier[append] operator[SEP] identifier[kopTwoUnit] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[money2str] operator[SEP] identifier[append] operator[SEP] identifier[kopFiveUnit] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[return] identifier[money2str] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void onError(InvocationContext context, Exception error) {
AsyncHandler<Object> asyncHandler = getAsyncHandler(context);
if(asyncHandler != null) {
try {
asyncHandler.onError(error instanceof InvocationException?
(InvocationException)error :InvocationException.newInstance(context, error));
}
catch(Exception e) {
LOGGER.error("Callback \"onError\" aborted with an exception.", e);
}
}
} | class class_name[name] begin[{]
method[onError, return_type[void], modifier[public], parameter[context, error]] begin[{]
local_variable[type[AsyncHandler], asyncHandler]
if[binary_operation[member[.asyncHandler], !=, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=InvocationException, sub_type=None), operator=instanceof), if_false=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=InvocationException, selectors=[], type_arguments=None), if_true=Cast(expression=MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=InvocationException, sub_type=None)))], member=onError, postfix_operators=[], prefix_operators=[], qualifier=asyncHandler, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Callback \"onError\" aborted with an exception."), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onError] operator[SEP] identifier[InvocationContext] identifier[context] , identifier[Exception] identifier[error] operator[SEP] {
identifier[AsyncHandler] operator[<] identifier[Object] operator[>] identifier[asyncHandler] operator[=] identifier[getAsyncHandler] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[asyncHandler] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[asyncHandler] operator[SEP] identifier[onError] operator[SEP] identifier[error] Keyword[instanceof] identifier[InvocationException] operator[?] operator[SEP] identifier[InvocationException] operator[SEP] identifier[error] operator[:] identifier[InvocationException] operator[SEP] identifier[newInstance] operator[SEP] identifier[context] , identifier[error] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
}
|
protected void renderDebugBoundingBox(Graphics2D context) {
/* */java.awt.Color previousColor = context.getColor();
context.setColor(java.awt.Color.RED);
context.draw(getBoundingBox());
context.setColor(previousColor);/* */
} | class class_name[name] begin[{]
method[renderDebugBoundingBox, return_type[void], modifier[protected], parameter[context]] begin[{]
local_variable[type[java], previousColor]
call[context.setColor, parameter[member[java.awt.Color.RED]]]
call[context.draw, parameter[call[.getBoundingBox, parameter[]]]]
call[context.setColor, parameter[member[.previousColor]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[renderDebugBoundingBox] operator[SEP] identifier[Graphics2D] identifier[context] operator[SEP] {
identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[Color] identifier[previousColor] operator[=] identifier[context] operator[SEP] identifier[getColor] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setColor] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[Color] operator[SEP] identifier[RED] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[draw] operator[SEP] identifier[getBoundingBox] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setColor] operator[SEP] identifier[previousColor] operator[SEP] operator[SEP]
}
|
public static Field getDeclaredField(Class clazz, String fieldName)
throws NoSuchFieldException {
Field f = getField(clazz, fieldName);
if (f == null) {
// Try the parent class
Class parent = clazz.getSuperclass();
if (parent != null) {
return getDeclaredField(parent, fieldName);
} else {
throw new NoSuchFieldException("The field '" + fieldName + "' could not be "
+ "found in the class of any of its parent "
+ "classes.");
}
} else {
return f;
}
} | class class_name[name] begin[{]
method[getDeclaredField, return_type[type[Field]], modifier[public static], parameter[clazz, fieldName]] begin[{]
local_variable[type[Field], f]
if[binary_operation[member[.f], ==, literal[null]]] begin[{]
local_variable[type[Class], parent]
if[binary_operation[member[.parent], !=, literal[null]]] begin[{]
return[call[.getDeclaredField, parameter[member[.parent], member[.fieldName]]]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The field '"), operandr=MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' could not be "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="found in the class of any of its parent "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="classes."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchFieldException, sub_type=None)), label=None)
end[}]
else begin[{]
return[member[.f]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Field] identifier[getDeclaredField] operator[SEP] identifier[Class] identifier[clazz] , identifier[String] identifier[fieldName] operator[SEP] Keyword[throws] identifier[NoSuchFieldException] {
identifier[Field] identifier[f] operator[=] identifier[getField] operator[SEP] identifier[clazz] , identifier[fieldName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[f] operator[==] Other[null] operator[SEP] {
identifier[Class] identifier[parent] operator[=] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[getDeclaredField] operator[SEP] identifier[parent] , identifier[fieldName] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[NoSuchFieldException] operator[SEP] literal[String] operator[+] identifier[fieldName] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[return] identifier[f] operator[SEP]
}
}
|
public void dereferenceControllable()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "dereferenceControllable");
destinationManager = null;
baseDest = null;
index = null;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "dereferenceControllable");
} | class class_name[name] begin[{]
method[dereferenceControllable, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["dereferenceControllable"]]]
else begin[{]
None
end[}]
assign[member[.destinationManager], literal[null]]
assign[member[.baseDest], literal[null]]
assign[member[.index], literal[null]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["dereferenceControllable"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[dereferenceControllable] 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[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[destinationManager] operator[=] Other[null] operator[SEP] identifier[baseDest] operator[=] Other[null] operator[SEP] identifier[index] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
public static ODatabaseDocument castToODatabaseDocument(ODatabase<?> db)
{
while(db!=null && !(db instanceof ODatabaseDocument))
{
if(db instanceof ODatabaseInternal<?>)
{
db = ((ODatabaseInternal<?>)db).getUnderlying();
}
}
return (ODatabaseDocument)db;
} | class class_name[name] begin[{]
method[castToODatabaseDocument, return_type[type[ODatabaseDocument]], modifier[public static], parameter[db]] begin[{]
while[binary_operation[binary_operation[member[.db], !=, literal[null]], &&, binary_operation[member[.db], instanceof, type[ODatabaseDocument]]]] begin[{]
if[binary_operation[member[.db], instanceof, type[ODatabaseInternal]]] begin[{]
assign[member[.db], Cast(expression=MemberReference(member=db, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=ODatabaseInternal, sub_type=None))]
else begin[{]
None
end[}]
end[}]
return[Cast(expression=MemberReference(member=db, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ODatabaseDocument, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ODatabaseDocument] identifier[castToODatabaseDocument] operator[SEP] identifier[ODatabase] operator[<] operator[?] operator[>] identifier[db] operator[SEP] {
Keyword[while] operator[SEP] identifier[db] operator[!=] Other[null] operator[&&] operator[!] operator[SEP] identifier[db] Keyword[instanceof] identifier[ODatabaseDocument] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[db] Keyword[instanceof] identifier[ODatabaseInternal] operator[<] operator[?] operator[>] operator[SEP] {
identifier[db] operator[=] operator[SEP] operator[SEP] identifier[ODatabaseInternal] operator[<] operator[?] operator[>] operator[SEP] identifier[db] operator[SEP] operator[SEP] identifier[getUnderlying] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] operator[SEP] identifier[ODatabaseDocument] operator[SEP] identifier[db] operator[SEP]
}
|
@Override
public void writeValue(TimeValue value, Resource resource)
throws RDFHandlerException {
this.rdfWriter.writeTripleValueObject(resource, RdfWriter.RDF_TYPE,
RdfWriter.WB_TIME_VALUE);
this.rdfWriter.writeTripleValueObject(resource, RdfWriter.WB_TIME,
TimeValueConverter.getTimeLiteral(value, this.rdfWriter));
this.rdfWriter.writeTripleIntegerObject(resource,
RdfWriter.WB_TIME_PRECISION, value.getPrecision());
this.rdfWriter.writeTripleIntegerObject(resource,
RdfWriter.WB_TIME_TIMEZONE,
value.getTimezoneOffset());
this.rdfWriter.writeTripleUriObject(resource,
RdfWriter.WB_TIME_CALENDAR_MODEL,
value.getPreferredCalendarModel());
} | class class_name[name] begin[{]
method[writeValue, return_type[void], modifier[public], parameter[value, resource]] begin[{]
THIS[member[None.rdfWriter]call[None.writeTripleValueObject, parameter[member[.resource], member[RdfWriter.RDF_TYPE], member[RdfWriter.WB_TIME_VALUE]]]]
THIS[member[None.rdfWriter]call[None.writeTripleValueObject, parameter[member[.resource], member[RdfWriter.WB_TIME], call[TimeValueConverter.getTimeLiteral, parameter[member[.value], THIS[member[None.rdfWriter]]]]]]]
THIS[member[None.rdfWriter]call[None.writeTripleIntegerObject, parameter[member[.resource], member[RdfWriter.WB_TIME_PRECISION], call[value.getPrecision, parameter[]]]]]
THIS[member[None.rdfWriter]call[None.writeTripleIntegerObject, parameter[member[.resource], member[RdfWriter.WB_TIME_TIMEZONE], call[value.getTimezoneOffset, parameter[]]]]]
THIS[member[None.rdfWriter]call[None.writeTripleUriObject, parameter[member[.resource], member[RdfWriter.WB_TIME_CALENDAR_MODEL], call[value.getPreferredCalendarModel, parameter[]]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[writeValue] operator[SEP] identifier[TimeValue] identifier[value] , identifier[Resource] identifier[resource] operator[SEP] Keyword[throws] identifier[RDFHandlerException] {
Keyword[this] operator[SEP] identifier[rdfWriter] operator[SEP] identifier[writeTripleValueObject] operator[SEP] identifier[resource] , identifier[RdfWriter] operator[SEP] identifier[RDF_TYPE] , identifier[RdfWriter] operator[SEP] identifier[WB_TIME_VALUE] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[rdfWriter] operator[SEP] identifier[writeTripleValueObject] operator[SEP] identifier[resource] , identifier[RdfWriter] operator[SEP] identifier[WB_TIME] , identifier[TimeValueConverter] operator[SEP] identifier[getTimeLiteral] operator[SEP] identifier[value] , Keyword[this] operator[SEP] identifier[rdfWriter] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[rdfWriter] operator[SEP] identifier[writeTripleIntegerObject] operator[SEP] identifier[resource] , identifier[RdfWriter] operator[SEP] identifier[WB_TIME_PRECISION] , identifier[value] operator[SEP] identifier[getPrecision] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[rdfWriter] operator[SEP] identifier[writeTripleIntegerObject] operator[SEP] identifier[resource] , identifier[RdfWriter] operator[SEP] identifier[WB_TIME_TIMEZONE] , identifier[value] operator[SEP] identifier[getTimezoneOffset] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[rdfWriter] operator[SEP] identifier[writeTripleUriObject] operator[SEP] identifier[resource] , identifier[RdfWriter] operator[SEP] identifier[WB_TIME_CALENDAR_MODEL] , identifier[value] operator[SEP] identifier[getPreferredCalendarModel] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
protected Component createCustomEditor() {
JPanel panel;
panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
m_EditComponent = (ClassOptionEditComponent) getEditComponent((ClassOption) getValue());
m_EditComponent.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
m_EditComponent.applyState();
setValue(m_EditComponent.getEditedOption());
}
});
panel.add(m_EditComponent, BorderLayout.CENTER);
return panel;
} | class class_name[name] begin[{]
method[createCustomEditor, return_type[type[Component]], modifier[protected], parameter[]] begin[{]
local_variable[type[JPanel], panel]
assign[member[.panel], ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BorderLayout, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JPanel, sub_type=None))]
call[panel.setBorder, parameter[call[BorderFactory.createEmptyBorder, parameter[literal[5], literal[5], literal[5], literal[5]]]]]
assign[member[.m_EditComponent], Cast(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ClassOption, sub_type=None))], member=getEditComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ClassOptionEditComponent, sub_type=None))]
call[m_EditComponent.addChangeListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=applyState, postfix_operators=[], prefix_operators=[], qualifier=m_EditComponent, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEditedOption, postfix_operators=[], prefix_operators=[], qualifier=m_EditComponent, selectors=[], type_arguments=None)], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=stateChanged, parameters=[FormalParameter(annotations=[], modifiers=set(), name=e, type=ReferenceType(arguments=None, dimensions=[], name=ChangeEvent, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ChangeListener, sub_type=None))]]
call[panel.add, parameter[member[.m_EditComponent], member[BorderLayout.CENTER]]]
return[member[.panel]]
end[}]
END[}] | Keyword[protected] identifier[Component] identifier[createCustomEditor] operator[SEP] operator[SEP] {
identifier[JPanel] identifier[panel] operator[SEP] identifier[panel] operator[=] Keyword[new] identifier[JPanel] operator[SEP] Keyword[new] identifier[BorderLayout] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[panel] operator[SEP] identifier[setBorder] operator[SEP] identifier[BorderFactory] operator[SEP] identifier[createEmptyBorder] operator[SEP] Other[5] , Other[5] , Other[5] , Other[5] operator[SEP] operator[SEP] operator[SEP] identifier[m_EditComponent] operator[=] operator[SEP] identifier[ClassOptionEditComponent] operator[SEP] identifier[getEditComponent] operator[SEP] operator[SEP] identifier[ClassOption] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_EditComponent] operator[SEP] identifier[addChangeListener] operator[SEP] Keyword[new] identifier[ChangeListener] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[stateChanged] operator[SEP] identifier[ChangeEvent] identifier[e] operator[SEP] {
identifier[m_EditComponent] operator[SEP] identifier[applyState] operator[SEP] operator[SEP] operator[SEP] identifier[setValue] operator[SEP] identifier[m_EditComponent] operator[SEP] identifier[getEditedOption] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[panel] operator[SEP] identifier[add] operator[SEP] identifier[m_EditComponent] , identifier[BorderLayout] operator[SEP] identifier[CENTER] operator[SEP] operator[SEP] Keyword[return] identifier[panel] operator[SEP]
}
|
private static boolean multiPointIntersectsMultiPoint_(
MultiPoint _multipointA, MultiPoint _multipointB, double tolerance,
ProgressTracker progress_tracker) {
MultiPoint multipoint_a;
MultiPoint multipoint_b;
if (_multipointA.getPointCount() > _multipointB.getPointCount()) {
multipoint_a = _multipointB;
multipoint_b = _multipointA;
} else {
multipoint_a = _multipointA;
multipoint_b = _multipointB;
}
Envelope2D env_a = new Envelope2D();
Envelope2D env_b = new Envelope2D();
Envelope2D envInter = new Envelope2D();
multipoint_a.queryEnvelope2D(env_a);
multipoint_b.queryEnvelope2D(env_b);
env_a.inflate(tolerance, tolerance);
env_b.inflate(tolerance, tolerance);
envInter.setCoords(env_a);
envInter.intersect(env_b);
Point2D ptA = new Point2D();
Point2D ptB = new Point2D();
double tolerance_sq = tolerance * tolerance;
QuadTreeImpl quadTreeB = InternalUtils.buildQuadTree(
(MultiPointImpl) (multipoint_b._getImpl()), envInter);
QuadTreeImpl.QuadTreeIteratorImpl qtIterB = quadTreeB.getIterator();
for (int vertex_a = 0; vertex_a < multipoint_a.getPointCount(); vertex_a++) {
multipoint_a.getXY(vertex_a, ptA);
if (!envInter.contains(ptA))
continue;
env_a.setCoords(ptA.x, ptA.y, ptA.x, ptA.y);
qtIterB.resetIterator(env_a, tolerance);
for (int elementHandleB = qtIterB.next(); elementHandleB != -1; elementHandleB = qtIterB
.next()) {
int vertex_b = quadTreeB.getElement(elementHandleB);
multipoint_b.getXY(vertex_b, ptB);
if (Point2D.sqrDistance(ptA, ptB) <= tolerance_sq)
return true;
}
}
return false;
} | class class_name[name] begin[{]
method[multiPointIntersectsMultiPoint_, return_type[type[boolean]], modifier[private static], parameter[_multipointA, _multipointB, tolerance, progress_tracker]] begin[{]
local_variable[type[MultiPoint], multipoint_a]
local_variable[type[MultiPoint], multipoint_b]
if[binary_operation[call[_multipointA.getPointCount, parameter[]], >, call[_multipointB.getPointCount, parameter[]]]] begin[{]
assign[member[.multipoint_a], member[._multipointB]]
assign[member[.multipoint_b], member[._multipointA]]
else begin[{]
assign[member[.multipoint_a], member[._multipointA]]
assign[member[.multipoint_b], member[._multipointB]]
end[}]
local_variable[type[Envelope2D], env_a]
local_variable[type[Envelope2D], env_b]
local_variable[type[Envelope2D], envInter]
call[multipoint_a.queryEnvelope2D, parameter[member[.env_a]]]
call[multipoint_b.queryEnvelope2D, parameter[member[.env_b]]]
call[env_a.inflate, parameter[member[.tolerance], member[.tolerance]]]
call[env_b.inflate, parameter[member[.tolerance], member[.tolerance]]]
call[envInter.setCoords, parameter[member[.env_a]]]
call[envInter.intersect, parameter[member[.env_b]]]
local_variable[type[Point2D], ptA]
local_variable[type[Point2D], ptB]
local_variable[type[double], tolerance_sq]
local_variable[type[QuadTreeImpl], quadTreeB]
local_variable[type[QuadTreeImpl], qtIterB]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=vertex_a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ptA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getXY, postfix_operators=[], prefix_operators=[], qualifier=multipoint_a, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ptA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=envInter, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=ptA, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=ptA, selectors=[]), MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=ptA, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=ptA, selectors=[])], member=setCoords, postfix_operators=[], prefix_operators=[], qualifier=env_a, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=env_a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tolerance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resetIterator, postfix_operators=[], prefix_operators=[], qualifier=qtIterB, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=elementHandleB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getElement, postfix_operators=[], prefix_operators=[], qualifier=quadTreeB, selectors=[], type_arguments=None), name=vertex_b)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=vertex_b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ptB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getXY, postfix_operators=[], prefix_operators=[], qualifier=multipoint_b, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ptA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ptB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sqrDistance, postfix_operators=[], prefix_operators=[], qualifier=Point2D, selectors=[], type_arguments=None), operandr=MemberReference(member=tolerance_sq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=elementHandleB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=qtIterB, selectors=[], type_arguments=None), name=elementHandleB)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=elementHandleB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=qtIterB, selectors=[], type_arguments=None))]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=vertex_a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getPointCount, postfix_operators=[], prefix_operators=[], qualifier=multipoint_a, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=vertex_a)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=vertex_a, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[false]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[boolean] identifier[multiPointIntersectsMultiPoint_] operator[SEP] identifier[MultiPoint] identifier[_multipointA] , identifier[MultiPoint] identifier[_multipointB] , Keyword[double] identifier[tolerance] , identifier[ProgressTracker] identifier[progress_tracker] operator[SEP] {
identifier[MultiPoint] identifier[multipoint_a] operator[SEP] identifier[MultiPoint] identifier[multipoint_b] operator[SEP] Keyword[if] operator[SEP] identifier[_multipointA] operator[SEP] identifier[getPointCount] operator[SEP] operator[SEP] operator[>] identifier[_multipointB] operator[SEP] identifier[getPointCount] operator[SEP] operator[SEP] operator[SEP] {
identifier[multipoint_a] operator[=] identifier[_multipointB] operator[SEP] identifier[multipoint_b] operator[=] identifier[_multipointA] operator[SEP]
}
Keyword[else] {
identifier[multipoint_a] operator[=] identifier[_multipointA] operator[SEP] identifier[multipoint_b] operator[=] identifier[_multipointB] operator[SEP]
}
identifier[Envelope2D] identifier[env_a] operator[=] Keyword[new] identifier[Envelope2D] operator[SEP] operator[SEP] operator[SEP] identifier[Envelope2D] identifier[env_b] operator[=] Keyword[new] identifier[Envelope2D] operator[SEP] operator[SEP] operator[SEP] identifier[Envelope2D] identifier[envInter] operator[=] Keyword[new] identifier[Envelope2D] operator[SEP] operator[SEP] operator[SEP] identifier[multipoint_a] operator[SEP] identifier[queryEnvelope2D] operator[SEP] identifier[env_a] operator[SEP] operator[SEP] identifier[multipoint_b] operator[SEP] identifier[queryEnvelope2D] operator[SEP] identifier[env_b] operator[SEP] operator[SEP] identifier[env_a] operator[SEP] identifier[inflate] operator[SEP] identifier[tolerance] , identifier[tolerance] operator[SEP] operator[SEP] identifier[env_b] operator[SEP] identifier[inflate] operator[SEP] identifier[tolerance] , identifier[tolerance] operator[SEP] operator[SEP] identifier[envInter] operator[SEP] identifier[setCoords] operator[SEP] identifier[env_a] operator[SEP] operator[SEP] identifier[envInter] operator[SEP] identifier[intersect] operator[SEP] identifier[env_b] operator[SEP] operator[SEP] identifier[Point2D] identifier[ptA] operator[=] Keyword[new] identifier[Point2D] operator[SEP] operator[SEP] operator[SEP] identifier[Point2D] identifier[ptB] operator[=] Keyword[new] identifier[Point2D] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[tolerance_sq] operator[=] identifier[tolerance] operator[*] identifier[tolerance] operator[SEP] identifier[QuadTreeImpl] identifier[quadTreeB] operator[=] identifier[InternalUtils] operator[SEP] identifier[buildQuadTree] operator[SEP] operator[SEP] identifier[MultiPointImpl] operator[SEP] operator[SEP] identifier[multipoint_b] operator[SEP] identifier[_getImpl] operator[SEP] operator[SEP] operator[SEP] , identifier[envInter] operator[SEP] operator[SEP] identifier[QuadTreeImpl] operator[SEP] identifier[QuadTreeIteratorImpl] identifier[qtIterB] operator[=] identifier[quadTreeB] operator[SEP] identifier[getIterator] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[vertex_a] operator[=] Other[0] operator[SEP] identifier[vertex_a] operator[<] identifier[multipoint_a] operator[SEP] identifier[getPointCount] operator[SEP] operator[SEP] operator[SEP] identifier[vertex_a] operator[++] operator[SEP] {
identifier[multipoint_a] operator[SEP] identifier[getXY] operator[SEP] identifier[vertex_a] , identifier[ptA] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[envInter] operator[SEP] identifier[contains] operator[SEP] identifier[ptA] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[env_a] operator[SEP] identifier[setCoords] operator[SEP] identifier[ptA] operator[SEP] identifier[x] , identifier[ptA] operator[SEP] identifier[y] , identifier[ptA] operator[SEP] identifier[x] , identifier[ptA] operator[SEP] identifier[y] operator[SEP] operator[SEP] identifier[qtIterB] operator[SEP] identifier[resetIterator] operator[SEP] identifier[env_a] , identifier[tolerance] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[elementHandleB] operator[=] identifier[qtIterB] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[elementHandleB] operator[!=] operator[-] Other[1] operator[SEP] identifier[elementHandleB] operator[=] identifier[qtIterB] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[vertex_b] operator[=] identifier[quadTreeB] operator[SEP] identifier[getElement] operator[SEP] identifier[elementHandleB] operator[SEP] operator[SEP] identifier[multipoint_b] operator[SEP] identifier[getXY] operator[SEP] identifier[vertex_b] , identifier[ptB] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Point2D] operator[SEP] identifier[sqrDistance] operator[SEP] identifier[ptA] , identifier[ptB] operator[SEP] operator[<=] identifier[tolerance_sq] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public ArrayList<OvhGenericProductDefinition> cart_cartId_dedicatedReseller_GET(String cartId, String family, String planCode) throws IOException {
String qPath = "/order/cart/{cartId}/dedicatedReseller";
StringBuilder sb = path(qPath, cartId);
query(sb, "family", family);
query(sb, "planCode", planCode);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, t3);
} | class class_name[name] begin[{]
method[cart_cartId_dedicatedReseller_GET, return_type[type[ArrayList]], modifier[public], parameter[cartId, family, planCode]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
call[.query, parameter[member[.sb], literal["family"], member[.family]]]
call[.query, parameter[member[.sb], literal["planCode"], member[.planCode]]]
local_variable[type[String], resp]
return[call[.convertTo, parameter[member[.resp], member[.t3]]]]
end[}]
END[}] | Keyword[public] identifier[ArrayList] operator[<] identifier[OvhGenericProductDefinition] operator[>] identifier[cart_cartId_dedicatedReseller_GET] operator[SEP] identifier[String] identifier[cartId] , identifier[String] identifier[family] , identifier[String] identifier[planCode] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[cartId] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[family] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[planCode] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[execN] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[t3] operator[SEP] operator[SEP]
}
|
@Override
public ChangeResourceRecordSetsResult changeResourceRecordSets(ChangeResourceRecordSetsRequest request) {
request = beforeClientExecution(request);
return executeChangeResourceRecordSets(request);
} | class class_name[name] begin[{]
method[changeResourceRecordSets, return_type[type[ChangeResourceRecordSetsResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeChangeResourceRecordSets, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ChangeResourceRecordSetsResult] identifier[changeResourceRecordSets] operator[SEP] identifier[ChangeResourceRecordSetsRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeChangeResourceRecordSets] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public double transformNumber(double number) {
if (ruleSet == null) {
return number / divisor;
} else {
return Math.floor(number / divisor);
}
} | class class_name[name] begin[{]
method[transformNumber, return_type[type[double]], modifier[public], parameter[number]] begin[{]
if[binary_operation[member[.ruleSet], ==, literal[null]]] begin[{]
return[binary_operation[member[.number], /, member[.divisor]]]
else begin[{]
return[call[Math.floor, parameter[binary_operation[member[.number], /, member[.divisor]]]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[double] identifier[transformNumber] operator[SEP] Keyword[double] identifier[number] operator[SEP] {
Keyword[if] operator[SEP] identifier[ruleSet] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[number] operator[/] identifier[divisor] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[Math] operator[SEP] identifier[floor] operator[SEP] identifier[number] operator[/] identifier[divisor] operator[SEP] operator[SEP]
}
}
|
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DroolsPackage.META_DATA_TYPE__META_VALUE:
return getMetaValue();
case DroolsPackage.META_DATA_TYPE__NAME:
return getName();
}
return super.eGet(featureID, resolve, coreType);
} | class class_name[name] begin[{]
method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=META_DATA_TYPE__META_VALUE, postfix_operators=[], prefix_operators=[], qualifier=DroolsPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getMetaValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=META_DATA_TYPE__NAME, postfix_operators=[], prefix_operators=[], qualifier=DroolsPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[DroolsPackage] operator[SEP] identifier[META_DATA_TYPE__META_VALUE] operator[:] Keyword[return] identifier[getMetaValue] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[DroolsPackage] operator[SEP] identifier[META_DATA_TYPE__NAME] operator[:] Keyword[return] identifier[getName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP]
}
|
void convertWith(Converter converter, String... attributes) {
for (String attribute : attributes) {
convertWith(converter, attribute);
}
} | class class_name[name] begin[{]
method[convertWith, return_type[void], modifier[default], parameter[converter, attributes]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=converter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertWith, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=attribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
end[}]
END[}] | Keyword[void] identifier[convertWith] operator[SEP] identifier[Converter] identifier[converter] , identifier[String] operator[...] identifier[attributes] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[attribute] operator[:] identifier[attributes] operator[SEP] {
identifier[convertWith] operator[SEP] identifier[converter] , identifier[attribute] operator[SEP] operator[SEP]
}
}
|
private static void write(DocFile outFile, Writer out, String text) throws DocFileIOException {
try {
out.write(text);
} catch (IOException e) {
throw new DocFileIOException(outFile, DocFileIOException.Mode.WRITE, e);
}
} | class class_name[name] begin[{]
method[write, return_type[void], modifier[private static], parameter[outFile, out, text]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=outFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=WRITE, postfix_operators=[], prefix_operators=[], qualifier=DocFileIOException.Mode, 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=DocFileIOException, 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] Keyword[static] Keyword[void] identifier[write] operator[SEP] identifier[DocFile] identifier[outFile] , identifier[Writer] identifier[out] , identifier[String] identifier[text] operator[SEP] Keyword[throws] identifier[DocFileIOException] {
Keyword[try] {
identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[text] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DocFileIOException] operator[SEP] identifier[outFile] , identifier[DocFileIOException] operator[SEP] identifier[Mode] operator[SEP] identifier[WRITE] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public Observable<ServiceResponse<RunCommandResultInner>> runCommandWithServiceResponseAsync(String resourceGroupName, String vmName, RunCommandInput parameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (vmName == null) {
throw new IllegalArgumentException("Parameter vmName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Validator.validate(parameters);
Observable<Response<ResponseBody>> observable = service.runCommand(resourceGroupName, vmName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken<RunCommandResultInner>() { }.getType());
} | class class_name[name] begin[{]
method[runCommandWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, vmName, parameters]] begin[{]
if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.vmName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter vmName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.parameters], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter parameters is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.client]call[None.apiVersion, parameter[]]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiVersion() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[Validator.validate, parameter[member[.parameters]]]
local_variable[type[Observable], observable]
return[call[client.getAzureClient, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[RunCommandResultInner] operator[>] operator[>] identifier[runCommandWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[vmName] , identifier[RunCommandInput] identifier[parameters] operator[SEP] {
Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[vmName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[parameters] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[parameters] operator[SEP] operator[SEP] identifier[Observable] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] operator[>] identifier[observable] operator[=] identifier[service] operator[SEP] identifier[runCommand] operator[SEP] identifier[resourceGroupName] , identifier[vmName] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , identifier[parameters] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[client] operator[SEP] identifier[getAzureClient] operator[SEP] operator[SEP] operator[SEP] identifier[getPostOrDeleteResultAsync] operator[SEP] identifier[observable] , Keyword[new] identifier[TypeToken] operator[<] identifier[RunCommandResultInner] operator[>] operator[SEP] operator[SEP] {
} operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
try {
if (com.google.api.ads.adwords.axis.v201809.o.TrafficEstimatorServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
com.google.api.ads.adwords.axis.v201809.o.TrafficEstimatorServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.o.TrafficEstimatorServiceSoapBindingStub(new java.net.URL(TrafficEstimatorServiceInterfacePort_address), this);
_stub.setPortName(getTrafficEstimatorServiceInterfacePortWSDDServiceName());
return _stub;
}
}
catch (java.lang.Throwable t) {
throw new javax.xml.rpc.ServiceException(t);
}
throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
} | class class_name[name] begin[{]
method[getPort, return_type[type[java]], modifier[public], parameter[serviceEndpointInterface]] begin[{]
TryStatement(block=[IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=com.google.api.ads.adwords.axis.v201809.o, selectors=[MethodInvocation(arguments=[MemberReference(member=serviceEndpointInterface, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=TrafficEstimatorServiceInterface, sub_type=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=TrafficEstimatorServiceInterfacePort_address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=net, sub_type=ReferenceType(arguments=None, dimensions=None, name=URL, sub_type=None)))), This(postfix_operators=[], prefix_operators=[], qualifier=None, 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=google, sub_type=ReferenceType(arguments=None, dimensions=None, name=api, sub_type=ReferenceType(arguments=None, dimensions=None, name=ads, sub_type=ReferenceType(arguments=None, dimensions=None, name=adwords, sub_type=ReferenceType(arguments=None, dimensions=None, name=axis, sub_type=ReferenceType(arguments=None, dimensions=None, name=v201809, sub_type=ReferenceType(arguments=None, dimensions=None, name=o, sub_type=ReferenceType(arguments=None, dimensions=None, name=TrafficEstimatorServiceSoapBindingStub, sub_type=None)))))))))), name=_stub)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=google, sub_type=ReferenceType(arguments=None, dimensions=None, name=api, sub_type=ReferenceType(arguments=None, dimensions=None, name=ads, sub_type=ReferenceType(arguments=None, dimensions=None, name=adwords, sub_type=ReferenceType(arguments=None, dimensions=None, name=axis, sub_type=ReferenceType(arguments=None, dimensions=None, name=v201809, sub_type=ReferenceType(arguments=None, dimensions=None, name=o, sub_type=ReferenceType(arguments=None, dimensions=None, name=TrafficEstimatorServiceSoapBindingStub, sub_type=None)))))))))), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTrafficEstimatorServiceInterfacePortWSDDServiceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setPortName, postfix_operators=[], prefix_operators=[], qualifier=_stub, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=_stub, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=xml, sub_type=ReferenceType(arguments=None, dimensions=None, name=rpc, sub_type=ReferenceType(arguments=None, dimensions=None, name=ServiceException, sub_type=None))))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['java.lang.Throwable']))], finally_block=None, label=None, resources=None)
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="There is no stub implementation for the interface: "), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=serviceEndpointInterface, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=serviceEndpointInterface, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null")), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=xml, sub_type=ReferenceType(arguments=None, dimensions=None, name=rpc, sub_type=ReferenceType(arguments=None, dimensions=None, name=ServiceException, sub_type=None))))), label=None)
end[}]
END[}] | Keyword[public] identifier[java] operator[SEP] identifier[rmi] operator[SEP] identifier[Remote] identifier[getPort] operator[SEP] identifier[Class] identifier[serviceEndpointInterface] operator[SEP] Keyword[throws] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[rpc] operator[SEP] identifier[ServiceException] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[adwords] operator[SEP] identifier[axis] operator[SEP] identifier[v201809] operator[SEP] identifier[o] operator[SEP] identifier[TrafficEstimatorServiceInterface] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[serviceEndpointInterface] operator[SEP] operator[SEP] {
identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[adwords] operator[SEP] identifier[axis] operator[SEP] identifier[v201809] operator[SEP] identifier[o] operator[SEP] identifier[TrafficEstimatorServiceSoapBindingStub] identifier[_stub] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[adwords] operator[SEP] identifier[axis] operator[SEP] identifier[v201809] operator[SEP] identifier[o] operator[SEP] identifier[TrafficEstimatorServiceSoapBindingStub] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[URL] operator[SEP] identifier[TrafficEstimatorServiceInterfacePort_address] operator[SEP] , Keyword[this] operator[SEP] operator[SEP] identifier[_stub] operator[SEP] identifier[setPortName] operator[SEP] identifier[getTrafficEstimatorServiceInterfacePortWSDDServiceName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[_stub] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
Keyword[throw] Keyword[new] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[rpc] operator[SEP] identifier[ServiceException] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[rpc] operator[SEP] identifier[ServiceException] operator[SEP] literal[String] operator[+] operator[SEP] identifier[serviceEndpointInterface] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[serviceEndpointInterface] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
protected HierarchicalProperty supportedMethodSet()
{
HierarchicalProperty supportedMethodProp = new HierarchicalProperty(SUPPORTEDMETHODSET);
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "PROPFIND");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "OPTIONS");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "DELETE");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "PROPPATCH");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "CHECKIN");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "CHECKOUT");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "REPORT");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "UNCHECKOUT");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "PUT");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "GET");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "HEAD");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "COPY");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "MOVE");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "VERSION-CONTROL");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "LABEL");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "LOCK");
supportedMethodProp.addChild(new HierarchicalProperty(new QName("DAV:", "supported-method"))).setAttribute(
"name", "UNLOCK");
return supportedMethodProp;
} | class class_name[name] begin[{]
method[supportedMethodSet, return_type[type[HierarchicalProperty]], modifier[protected], parameter[]] begin[{]
local_variable[type[HierarchicalProperty], supportedMethodProp]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
call[supportedMethodProp.addChild, parameter[ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DAV:"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="supported-method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HierarchicalProperty, sub_type=None))]]
return[member[.supportedMethodProp]]
end[}]
END[}] | Keyword[protected] identifier[HierarchicalProperty] identifier[supportedMethodSet] operator[SEP] operator[SEP] {
identifier[HierarchicalProperty] identifier[supportedMethodProp] operator[=] Keyword[new] identifier[HierarchicalProperty] operator[SEP] identifier[SUPPORTEDMETHODSET] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[supportedMethodProp] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[HierarchicalProperty] operator[SEP] Keyword[new] identifier[QName] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[supportedMethodProp] operator[SEP]
}
|
public <T extends View> ArrayList<T> getCurrentViews(Class<T> classToFilterBy, boolean includeSubclasses) {
return getCurrentViews(classToFilterBy, includeSubclasses, null);
} | class class_name[name] begin[{]
method[getCurrentViews, return_type[type[ArrayList]], modifier[public], parameter[classToFilterBy, includeSubclasses]] begin[{]
return[call[.getCurrentViews, parameter[member[.classToFilterBy], member[.includeSubclasses], literal[null]]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[View] operator[>] identifier[ArrayList] operator[<] identifier[T] operator[>] identifier[getCurrentViews] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[classToFilterBy] , Keyword[boolean] identifier[includeSubclasses] operator[SEP] {
Keyword[return] identifier[getCurrentViews] operator[SEP] identifier[classToFilterBy] , identifier[includeSubclasses] , Other[null] operator[SEP] operator[SEP]
}
|
public boolean shouldRetryFor(Class<E> candidate) {
Preconditions.checkNotNull(candidate, "Requires a non-null candidate class");
if (dontRetry != null) {
return !dontRetry.contains(candidate);
} else {
return true;
}
} | class class_name[name] begin[{]
method[shouldRetryFor, return_type[type[boolean]], modifier[public], parameter[candidate]] begin[{]
call[Preconditions.checkNotNull, parameter[member[.candidate], literal["Requires a non-null candidate class"]]]
if[binary_operation[member[.dontRetry], !=, literal[null]]] begin[{]
return[call[dontRetry.contains, parameter[member[.candidate]]]]
else begin[{]
return[literal[true]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[shouldRetryFor] operator[SEP] identifier[Class] operator[<] identifier[E] operator[>] identifier[candidate] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[candidate] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dontRetry] operator[!=] Other[null] operator[SEP] {
Keyword[return] operator[!] identifier[dontRetry] operator[SEP] identifier[contains] operator[SEP] identifier[candidate] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] literal[boolean] operator[SEP]
}
}
|
protected void extractBankData(final byte[] pData) {
// Extract BIC data
byte[] bic = TlvUtil.getValue(pData, EmvTags.BANK_IDENTIFIER_CODE);
if (bic != null) {
template.get().getCard().setBic(new String(bic));
}
// Extract IBAN
byte[] iban = TlvUtil.getValue(pData, EmvTags.IBAN);
if (iban != null) {
template.get().getCard().setIban(new String(iban));
}
} | class class_name[name] begin[{]
method[extractBankData, return_type[void], modifier[protected], parameter[pData]] begin[{]
local_variable[type[byte], bic]
if[binary_operation[member[.bic], !=, literal[null]]] begin[{]
call[template.get, parameter[]]
else begin[{]
None
end[}]
local_variable[type[byte], iban]
if[binary_operation[member[.iban], !=, literal[null]]] begin[{]
call[template.get, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[extractBankData] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[pData] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[bic] operator[=] identifier[TlvUtil] operator[SEP] identifier[getValue] operator[SEP] identifier[pData] , identifier[EmvTags] operator[SEP] identifier[BANK_IDENTIFIER_CODE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bic] operator[!=] Other[null] operator[SEP] {
identifier[template] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getCard] operator[SEP] operator[SEP] operator[SEP] identifier[setBic] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[bic] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[byte] operator[SEP] operator[SEP] identifier[iban] operator[=] identifier[TlvUtil] operator[SEP] identifier[getValue] operator[SEP] identifier[pData] , identifier[EmvTags] operator[SEP] identifier[IBAN] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iban] operator[!=] Other[null] operator[SEP] {
identifier[template] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getCard] operator[SEP] operator[SEP] operator[SEP] identifier[setIban] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[iban] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Override
public String formatMessage(final int connectionId, final String now, final long elapsed, final String category, final String prepared, final String sql, final String url) {
String customLogMessageFormat = P6SpyOptions.getActiveInstance().getCustomLogMessageFormat();
if (customLogMessageFormat == null) {
// Someone forgot to configure customLogMessageFormat: fall back to built-in
return FALLBACK_FORMATTING_STRATEGY.formatMessage(connectionId, now, elapsed, category, prepared, sql, url);
}
return customLogMessageFormat
.replaceAll(Pattern.quote(CONNECTION_ID), Integer.toString(connectionId))
.replaceAll(Pattern.quote(CURRENT_TIME), now)
.replaceAll(Pattern.quote(EXECUTION_TIME), Long.toString(elapsed))
.replaceAll(Pattern.quote(CATEGORY), category)
.replaceAll(Pattern.quote(EFFECTIVE_SQL), Matcher.quoteReplacement(prepared))
.replaceAll(Pattern.quote(EFFECTIVE_SQL_SINGLELINE), Matcher.quoteReplacement(P6Util.singleLine(prepared)))
.replaceAll(Pattern.quote(SQL), Matcher.quoteReplacement(sql))
.replaceAll(Pattern.quote(SQL_SINGLE_LINE), Matcher.quoteReplacement(P6Util.singleLine(sql)))
.replaceAll(Pattern.quote(URL), url);
} | class class_name[name] begin[{]
method[formatMessage, return_type[type[String]], modifier[public], parameter[connectionId, now, elapsed, category, prepared, sql, url]] begin[{]
local_variable[type[String], customLogMessageFormat]
if[binary_operation[member[.customLogMessageFormat], ==, literal[null]]] begin[{]
return[call[FALLBACK_FORMATTING_STRATEGY.formatMessage, parameter[member[.connectionId], member[.now], member[.elapsed], member[.category], member[.prepared], member[.sql], member[.url]]]]
else begin[{]
None
end[}]
return[call[customLogMessageFormat.replaceAll, parameter[call[Pattern.quote, parameter[member[.CONNECTION_ID]]], call[Integer.toString, parameter[member[.connectionId]]]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[formatMessage] operator[SEP] Keyword[final] Keyword[int] identifier[connectionId] , Keyword[final] identifier[String] identifier[now] , Keyword[final] Keyword[long] identifier[elapsed] , Keyword[final] identifier[String] identifier[category] , Keyword[final] identifier[String] identifier[prepared] , Keyword[final] identifier[String] identifier[sql] , Keyword[final] identifier[String] identifier[url] operator[SEP] {
identifier[String] identifier[customLogMessageFormat] operator[=] identifier[P6SpyOptions] operator[SEP] identifier[getActiveInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getCustomLogMessageFormat] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[customLogMessageFormat] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[FALLBACK_FORMATTING_STRATEGY] operator[SEP] identifier[formatMessage] operator[SEP] identifier[connectionId] , identifier[now] , identifier[elapsed] , identifier[category] , identifier[prepared] , identifier[sql] , identifier[url] operator[SEP] operator[SEP]
}
Keyword[return] identifier[customLogMessageFormat] operator[SEP] identifier[replaceAll] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[CONNECTION_ID] operator[SEP] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[connectionId] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[CURRENT_TIME] operator[SEP] , identifier[now] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[EXECUTION_TIME] operator[SEP] , identifier[Long] operator[SEP] identifier[toString] operator[SEP] identifier[elapsed] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[CATEGORY] operator[SEP] , identifier[category] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[EFFECTIVE_SQL] operator[SEP] , identifier[Matcher] operator[SEP] identifier[quoteReplacement] operator[SEP] identifier[prepared] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[EFFECTIVE_SQL_SINGLELINE] operator[SEP] , identifier[Matcher] operator[SEP] identifier[quoteReplacement] operator[SEP] identifier[P6Util] operator[SEP] identifier[singleLine] operator[SEP] identifier[prepared] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[SQL] operator[SEP] , identifier[Matcher] operator[SEP] identifier[quoteReplacement] operator[SEP] identifier[sql] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[SQL_SINGLE_LINE] operator[SEP] , identifier[Matcher] operator[SEP] identifier[quoteReplacement] operator[SEP] identifier[P6Util] operator[SEP] identifier[singleLine] operator[SEP] identifier[sql] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[URL] operator[SEP] , identifier[url] operator[SEP] operator[SEP]
}
|
public Observable<ServiceResponseWithHeaders<ImmutabilityPolicyInner, BlobContainersDeleteImmutabilityPolicyHeaders>> deleteImmutabilityPolicyWithServiceResponseAsync(String resourceGroupName, String accountName, String containerName, String ifMatch) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (accountName == null) {
throw new IllegalArgumentException("Parameter accountName is required and cannot be null.");
}
if (containerName == null) {
throw new IllegalArgumentException("Parameter containerName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
if (ifMatch == null) {
throw new IllegalArgumentException("Parameter ifMatch is required and cannot be null.");
}
final String immutabilityPolicyName = "default";
return service.deleteImmutabilityPolicy(resourceGroupName, accountName, containerName, immutabilityPolicyName, this.client.subscriptionId(), this.client.apiVersion(), ifMatch, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<ImmutabilityPolicyInner, BlobContainersDeleteImmutabilityPolicyHeaders>>>() {
@Override
public Observable<ServiceResponseWithHeaders<ImmutabilityPolicyInner, BlobContainersDeleteImmutabilityPolicyHeaders>> call(Response<ResponseBody> response) {
try {
ServiceResponseWithHeaders<ImmutabilityPolicyInner, BlobContainersDeleteImmutabilityPolicyHeaders> clientResponse = deleteImmutabilityPolicyDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} | class class_name[name] begin[{]
method[deleteImmutabilityPolicyWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, accountName, containerName, ifMatch]] begin[{]
if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.accountName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter accountName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.containerName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter containerName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.client]call[None.apiVersion, parameter[]]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiVersion() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.ifMatch], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter ifMatch is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], immutabilityPolicyName]
return[call[service.deleteImmutabilityPolicy, parameter[member[.resourceGroupName], member[.accountName], member[.containerName], member[.immutabilityPolicyName], THIS[member[None.client]call[None.subscriptionId, parameter[]]], THIS[member[None.client]call[None.apiVersion, parameter[]]], member[.ifMatch], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponseWithHeaders] operator[<] identifier[ImmutabilityPolicyInner] , identifier[BlobContainersDeleteImmutabilityPolicyHeaders] operator[>] operator[>] identifier[deleteImmutabilityPolicyWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[accountName] , identifier[String] identifier[containerName] , identifier[String] identifier[ifMatch] operator[SEP] {
Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[accountName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[containerName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ifMatch] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[final] identifier[String] identifier[immutabilityPolicyName] operator[=] literal[String] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[deleteImmutabilityPolicy] operator[SEP] identifier[resourceGroupName] , identifier[accountName] , identifier[containerName] , identifier[immutabilityPolicyName] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] , identifier[ifMatch] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponseWithHeaders] operator[<] identifier[ImmutabilityPolicyInner] , identifier[BlobContainersDeleteImmutabilityPolicyHeaders] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponseWithHeaders] operator[<] identifier[ImmutabilityPolicyInner] , identifier[BlobContainersDeleteImmutabilityPolicyHeaders] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] {
Keyword[try] {
identifier[ServiceResponseWithHeaders] operator[<] identifier[ImmutabilityPolicyInner] , identifier[BlobContainersDeleteImmutabilityPolicyHeaders] operator[>] identifier[clientResponse] operator[=] identifier[deleteImmutabilityPolicyDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
|
@Override
public StatementInfo getInfo(String CorpNum, int ItemCode, String MgtKey)
throws PopbillException {
if (MgtKey == null || MgtKey.isEmpty())
throw new PopbillException(-99999999, "관리번호가 입력되지 않았습니다.");
return httpget("/Statement/" + ItemCode + "/" + MgtKey,
CorpNum, null, StatementInfo.class);
} | class class_name[name] begin[{]
method[getInfo, return_type[type[StatementInfo]], modifier[public], parameter[CorpNum, ItemCode, MgtKey]] begin[{]
if[binary_operation[binary_operation[member[.MgtKey], ==, literal[null]], ||, call[MgtKey.isEmpty, parameter[]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=99999999), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="관리번호가 입력되지 않았습니다.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PopbillException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[.httpget, parameter[binary_operation[binary_operation[binary_operation[literal["/Statement/"], +, member[.ItemCode]], +, literal["/"]], +, member[.MgtKey]], member[.CorpNum], literal[null], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StatementInfo, sub_type=None))]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[StatementInfo] identifier[getInfo] operator[SEP] identifier[String] identifier[CorpNum] , Keyword[int] identifier[ItemCode] , identifier[String] identifier[MgtKey] operator[SEP] Keyword[throws] identifier[PopbillException] {
Keyword[if] operator[SEP] identifier[MgtKey] operator[==] Other[null] operator[||] identifier[MgtKey] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[PopbillException] operator[SEP] operator[-] Other[99999999] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[httpget] operator[SEP] literal[String] operator[+] identifier[ItemCode] operator[+] literal[String] operator[+] identifier[MgtKey] , identifier[CorpNum] , Other[null] , identifier[StatementInfo] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case KEY:
return isSetKey();
case COLUMN_PARENT:
return isSetColumn_parent();
case COLUMN_SLICES:
return isSetColumn_slices();
case REVERSED:
return isSetReversed();
case COUNT:
return isSetCount();
case CONSISTENCY_LEVEL:
return isSetConsistency_level();
}
throw new IllegalStateException();
} | class class_name[name] begin[{]
method[isSet, return_type[type[boolean]], modifier[public], parameter[field]] begin[{]
if[binary_operation[member[.field], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
SwitchStatement(cases=[SwitchStatementCase(case=['KEY'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isSetKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['COLUMN_PARENT'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isSetColumn_parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['COLUMN_SLICES'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isSetColumn_slices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['REVERSED'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isSetReversed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['COUNT'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isSetCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['CONSISTENCY_LEVEL'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isSetConsistency_level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isSet] operator[SEP] identifier[_Fields] identifier[field] operator[SEP] {
Keyword[if] operator[SEP] identifier[field] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[field] operator[SEP] {
Keyword[case] identifier[KEY] operator[:] Keyword[return] identifier[isSetKey] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[COLUMN_PARENT] operator[:] Keyword[return] identifier[isSetColumn_parent] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[COLUMN_SLICES] operator[:] Keyword[return] identifier[isSetColumn_slices] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[REVERSED] operator[:] Keyword[return] identifier[isSetReversed] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[COUNT] operator[:] Keyword[return] identifier[isSetCount] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[CONSISTENCY_LEVEL] operator[:] Keyword[return] identifier[isSetConsistency_level] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP]
}
|
public static ProcessApplicationInfo getProcessApplicationInfo(String processDefinitionId) {
ProcessEngineService processEngineService = BpmPlatform.getProcessEngineService();
ProcessApplicationService processAppService = BpmPlatform.getProcessApplicationService();
// iterate over all process applications
for (String appName : processAppService.getProcessApplicationNames()) {
ProcessApplicationInfo appInfo = processAppService
.getProcessApplicationInfo(appName);
// iterate over all deployments of a process application
for (ProcessApplicationDeploymentInfo deploymentInfo : appInfo
.getDeploymentInfo()) {
long count = processEngineService
.getProcessEngine(deploymentInfo.getProcessEngineName())
.getRepositoryService().createProcessDefinitionQuery()
.deploymentId(deploymentInfo.getDeploymentId())
.processDefinitionId(processDefinitionId).count();
if (count > 0) {
return appInfo;
}
}
}
return null;
} | class class_name[name] begin[{]
method[getProcessApplicationInfo, return_type[type[ProcessApplicationInfo]], modifier[public static], parameter[processDefinitionId]] begin[{]
local_variable[type[ProcessEngineService], processEngineService]
local_variable[type[ProcessApplicationService], processAppService]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=appName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProcessApplicationInfo, postfix_operators=[], prefix_operators=[], qualifier=processAppService, selectors=[], type_arguments=None), name=appInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ProcessApplicationInfo, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProcessEngineName, postfix_operators=[], prefix_operators=[], qualifier=deploymentInfo, selectors=[], type_arguments=None)], member=getProcessEngine, postfix_operators=[], prefix_operators=[], qualifier=processEngineService, selectors=[MethodInvocation(arguments=[], member=getRepositoryService, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=createProcessDefinitionQuery, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDeploymentId, postfix_operators=[], prefix_operators=[], qualifier=deploymentInfo, selectors=[], type_arguments=None)], member=deploymentId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=processDefinitionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processDefinitionId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=count, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=count)], modifiers=set(), type=BasicType(dimensions=[], name=long)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=appInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getDeploymentInfo, postfix_operators=[], prefix_operators=[], qualifier=appInfo, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=deploymentInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ProcessApplicationDeploymentInfo, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getProcessApplicationNames, postfix_operators=[], prefix_operators=[], qualifier=processAppService, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=appName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[literal[null]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ProcessApplicationInfo] identifier[getProcessApplicationInfo] operator[SEP] identifier[String] identifier[processDefinitionId] operator[SEP] {
identifier[ProcessEngineService] identifier[processEngineService] operator[=] identifier[BpmPlatform] operator[SEP] identifier[getProcessEngineService] operator[SEP] operator[SEP] operator[SEP] identifier[ProcessApplicationService] identifier[processAppService] operator[=] identifier[BpmPlatform] operator[SEP] identifier[getProcessApplicationService] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[appName] operator[:] identifier[processAppService] operator[SEP] identifier[getProcessApplicationNames] operator[SEP] operator[SEP] operator[SEP] {
identifier[ProcessApplicationInfo] identifier[appInfo] operator[=] identifier[processAppService] operator[SEP] identifier[getProcessApplicationInfo] operator[SEP] identifier[appName] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ProcessApplicationDeploymentInfo] identifier[deploymentInfo] operator[:] identifier[appInfo] operator[SEP] identifier[getDeploymentInfo] operator[SEP] operator[SEP] operator[SEP] {
Keyword[long] identifier[count] operator[=] identifier[processEngineService] operator[SEP] identifier[getProcessEngine] operator[SEP] identifier[deploymentInfo] operator[SEP] identifier[getProcessEngineName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getRepositoryService] operator[SEP] operator[SEP] operator[SEP] identifier[createProcessDefinitionQuery] operator[SEP] operator[SEP] operator[SEP] identifier[deploymentId] operator[SEP] identifier[deploymentInfo] operator[SEP] identifier[getDeploymentId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[processDefinitionId] operator[SEP] identifier[processDefinitionId] operator[SEP] operator[SEP] identifier[count] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[count] operator[>] Other[0] operator[SEP] {
Keyword[return] identifier[appInfo] operator[SEP]
}
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public void garbageCollection() {
// number of tiles to remove from cache
int toBeRemoved = Integer.MAX_VALUE; // MAX_VALUE for stressed memory case
final int size = mCachedTiles.size();
if (!mStressedMemory) {
toBeRemoved = size - mCapacity;
if (toBeRemoved <= 0) {
return;
}
}
refreshAdditionalLists();
if (mAutoEnsureCapacity) {
final int target = mMapTileArea.size() + mAdditionalMapTileList.size();
if (ensureCapacity(target)) {
if (!mStressedMemory) {
toBeRemoved = size - mCapacity;
if (toBeRemoved <= 0) {
return;
}
}
}
}
populateSyncCachedTiles(mGC);
for (int i = 0; i < mGC.getSize() ; i ++) {
final long index = mGC.get(i);
if (shouldKeepTile(index)) {
continue;
}
remove(index);
if (-- toBeRemoved == 0) {
break;
};
}
} | class class_name[name] begin[{]
method[garbageCollection, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[int], toBeRemoved]
local_variable[type[int], size]
if[member[.mStressedMemory]] begin[{]
assign[member[.toBeRemoved], binary_operation[member[.size], -, member[.mCapacity]]]
if[binary_operation[member[.toBeRemoved], <=, literal[0]]] begin[{]
return[None]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[.refreshAdditionalLists, parameter[]]
if[member[.mAutoEnsureCapacity]] begin[{]
local_variable[type[int], target]
if[call[.ensureCapacity, parameter[member[.target]]]] begin[{]
if[member[.mStressedMemory]] begin[{]
assign[member[.toBeRemoved], binary_operation[member[.size], -, member[.mCapacity]]]
if[binary_operation[member[.toBeRemoved], <=, literal[0]]] begin[{]
return[None]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[.populateSyncCachedTiles, parameter[member[.mGC]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=mGC, selectors=[], type_arguments=None), name=index)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=shouldKeepTile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=toBeRemoved, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), Statement(label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getSize, postfix_operators=[], prefix_operators=[], qualifier=mGC, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[garbageCollection] operator[SEP] operator[SEP] {
Keyword[int] identifier[toBeRemoved] operator[=] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] Keyword[final] Keyword[int] identifier[size] operator[=] identifier[mCachedTiles] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[mStressedMemory] operator[SEP] {
identifier[toBeRemoved] operator[=] identifier[size] operator[-] identifier[mCapacity] operator[SEP] Keyword[if] operator[SEP] identifier[toBeRemoved] operator[<=] Other[0] operator[SEP] {
Keyword[return] operator[SEP]
}
}
identifier[refreshAdditionalLists] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mAutoEnsureCapacity] operator[SEP] {
Keyword[final] Keyword[int] identifier[target] operator[=] identifier[mMapTileArea] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] identifier[mAdditionalMapTileList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ensureCapacity] operator[SEP] identifier[target] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[mStressedMemory] operator[SEP] {
identifier[toBeRemoved] operator[=] identifier[size] operator[-] identifier[mCapacity] operator[SEP] Keyword[if] operator[SEP] identifier[toBeRemoved] operator[<=] Other[0] operator[SEP] {
Keyword[return] operator[SEP]
}
}
}
}
identifier[populateSyncCachedTiles] operator[SEP] identifier[mGC] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[mGC] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[final] Keyword[long] identifier[index] operator[=] identifier[mGC] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[shouldKeepTile] operator[SEP] identifier[index] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[remove] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[--] identifier[toBeRemoved] operator[==] Other[0] operator[SEP] {
Keyword[break] operator[SEP]
} operator[SEP]
}
}
|
protected void keepTopFeatures(Map<Object, Double> featureScores, int maxFeatures) {
logger.debug("keepTopFeatures()");
logger.debug("Estimating the minPermittedScore");
Double minPermittedScore = SelectKth.largest(featureScores.values().iterator(), maxFeatures);
//remove any entry with score less than the minimum permitted one
logger.debug("Removing features with scores less than threshold");
Iterator<Map.Entry<Object, Double>> it = featureScores.entrySet().iterator();
while(it.hasNext()) {
Map.Entry<Object, Double> entry = it.next();
if(entry.getValue()<minPermittedScore) {
it.remove();
}
}
//if some extra features still exist (due to ties on the scores) remove some of those extra features
int numOfExtraFeatures = featureScores.size()-maxFeatures;
if(numOfExtraFeatures>0) {
logger.debug("Removing extra features caused by ties");
it = featureScores.entrySet().iterator();
while(it.hasNext() && numOfExtraFeatures>0) {
Map.Entry<Object, Double> entry = it.next();
if(entry.getValue()-minPermittedScore<=0.0) { //DO NOT COMPARE THEM DIRECTLY USE SUBTRACTION!
it.remove();
--numOfExtraFeatures;
}
}
}
} | class class_name[name] begin[{]
method[keepTopFeatures, return_type[void], modifier[protected], parameter[featureScores, maxFeatures]] begin[{]
call[logger.debug, parameter[literal["keepTopFeatures()"]]]
call[logger.debug, parameter[literal["Estimating the minPermittedScore"]]]
local_variable[type[Double], minPermittedScore]
call[logger.debug, parameter[literal["Removing features with scores less than threshold"]]]
local_variable[type[Iterator], it]
while[call[it.hasNext, parameter[]]] begin[{]
local_variable[type[Map], entry]
if[binary_operation[call[entry.getValue, parameter[]], <, member[.minPermittedScore]]] begin[{]
call[it.remove, parameter[]]
else begin[{]
None
end[}]
end[}]
local_variable[type[int], numOfExtraFeatures]
if[binary_operation[member[.numOfExtraFeatures], >, literal[0]]] begin[{]
call[logger.debug, parameter[literal["Removing extra features caused by ties"]]]
assign[member[.it], call[featureScores.entrySet, parameter[]]]
while[binary_operation[call[it.hasNext, parameter[]], &&, binary_operation[member[.numOfExtraFeatures], >, literal[0]]]] begin[{]
local_variable[type[Map], entry]
if[binary_operation[binary_operation[call[entry.getValue, parameter[]], -, member[.minPermittedScore]], <=, literal[0.0]]] begin[{]
call[it.remove, parameter[]]
member[.numOfExtraFeatures]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[keepTopFeatures] operator[SEP] identifier[Map] operator[<] identifier[Object] , identifier[Double] operator[>] identifier[featureScores] , Keyword[int] identifier[maxFeatures] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Double] identifier[minPermittedScore] operator[=] identifier[SelectKth] operator[SEP] identifier[largest] operator[SEP] identifier[featureScores] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] , identifier[maxFeatures] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Object] , identifier[Double] operator[>] operator[>] identifier[it] operator[=] identifier[featureScores] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Object] , identifier[Double] operator[>] identifier[entry] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[<] identifier[minPermittedScore] operator[SEP] {
identifier[it] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[int] identifier[numOfExtraFeatures] operator[=] identifier[featureScores] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] identifier[maxFeatures] operator[SEP] Keyword[if] operator[SEP] identifier[numOfExtraFeatures] operator[>] Other[0] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[it] operator[=] identifier[featureScores] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[&&] identifier[numOfExtraFeatures] operator[>] Other[0] operator[SEP] {
identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Object] , identifier[Double] operator[>] identifier[entry] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[-] identifier[minPermittedScore] operator[<=] literal[Float] operator[SEP] {
identifier[it] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] operator[--] identifier[numOfExtraFeatures] operator[SEP]
}
}
}
}
|
void addFillComponents( Container panel, int[] cols, int[] rows )
{
Dimension filler = new Dimension(10,10);
boolean filled_cell_11 = false;
CellConstraints cc = new CellConstraints();
if ( cols.length > 0 && rows.length > 0 )
{
if ( cols[0] == 1 && rows[0] == 1 )
{
/** add a rigid area */
panel.add( Box.createRigidArea( filler ), cc.xy(1,1) );
filled_cell_11 = true;
}
}
for( int index = 0; index < cols.length; index++ )
{
if ( cols[index] == 1 && filled_cell_11 )
{
continue;
}
panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) );
}
for( int index = 0; index < rows.length; index++ )
{
if ( rows[index] == 1 && filled_cell_11 )
{
continue;
}
panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) );
}
} | class class_name[name] begin[{]
method[addFillComponents, return_type[void], modifier[default], parameter[panel, cols, rows]] begin[{]
local_variable[type[Dimension], filler]
local_variable[type[boolean], filled_cell_11]
local_variable[type[CellConstraints], cc]
if[binary_operation[binary_operation[member[cols.length], >, literal[0]], &&, binary_operation[member[rows.length], >, literal[0]]]] begin[{]
if[binary_operation[binary_operation[member[.cols], ==, literal[1]], &&, binary_operation[member[.rows], ==, literal[1]]]] begin[{]
call[panel.add, parameter[call[Box.createRigidArea, parameter[member[.filler]]], call[cc.xy, parameter[literal[1], literal[1]]]]]
assign[member[.filled_cell_11], literal[true]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operandr=MemberReference(member=filled_cell_11, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=filler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createRigidArea, postfix_operators=[], prefix_operators=[], qualifier=Box, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=cols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=xy, postfix_operators=[], prefix_operators=[], qualifier=cc, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=panel, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=cols, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operandr=MemberReference(member=filled_cell_11, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=filler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createRigidArea, postfix_operators=[], prefix_operators=[], qualifier=Box, selectors=[], type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=xy, postfix_operators=[], prefix_operators=[], qualifier=cc, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=panel, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=rows, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[void] identifier[addFillComponents] operator[SEP] identifier[Container] identifier[panel] , Keyword[int] operator[SEP] operator[SEP] identifier[cols] , Keyword[int] operator[SEP] operator[SEP] identifier[rows] operator[SEP] {
identifier[Dimension] identifier[filler] operator[=] Keyword[new] identifier[Dimension] operator[SEP] Other[10] , Other[10] operator[SEP] operator[SEP] Keyword[boolean] identifier[filled_cell_11] operator[=] literal[boolean] operator[SEP] identifier[CellConstraints] identifier[cc] operator[=] Keyword[new] identifier[CellConstraints] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cols] operator[SEP] identifier[length] operator[>] Other[0] operator[&&] identifier[rows] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[cols] operator[SEP] Other[0] operator[SEP] operator[==] Other[1] operator[&&] identifier[rows] operator[SEP] Other[0] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[panel] operator[SEP] identifier[add] operator[SEP] identifier[Box] operator[SEP] identifier[createRigidArea] operator[SEP] identifier[filler] operator[SEP] , identifier[cc] operator[SEP] identifier[xy] operator[SEP] Other[1] , Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[filled_cell_11] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[for] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] identifier[index] operator[<] identifier[cols] operator[SEP] identifier[length] operator[SEP] identifier[index] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[cols] operator[SEP] identifier[index] operator[SEP] operator[==] Other[1] operator[&&] identifier[filled_cell_11] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[panel] operator[SEP] identifier[add] operator[SEP] identifier[Box] operator[SEP] identifier[createRigidArea] operator[SEP] identifier[filler] operator[SEP] , identifier[cc] operator[SEP] identifier[xy] operator[SEP] identifier[cols] operator[SEP] identifier[index] operator[SEP] , Other[1] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] identifier[index] operator[<] identifier[rows] operator[SEP] identifier[length] operator[SEP] identifier[index] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[rows] operator[SEP] identifier[index] operator[SEP] operator[==] Other[1] operator[&&] identifier[filled_cell_11] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[panel] operator[SEP] identifier[add] operator[SEP] identifier[Box] operator[SEP] identifier[createRigidArea] operator[SEP] identifier[filler] operator[SEP] , identifier[cc] operator[SEP] identifier[xy] operator[SEP] Other[1] , identifier[rows] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static <T> T[] sort(T[] self) {
Arrays.sort(self, new NumberAwareComparator<T>());
return self;
} | class class_name[name] begin[{]
method[sort, return_type[type[T]], modifier[public static], parameter[self]] begin[{]
call[Arrays.sort, parameter[member[.self], 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=T, sub_type=None))], dimensions=None, name=NumberAwareComparator, sub_type=None))]]
return[member[.self]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] operator[SEP] operator[SEP] identifier[sort] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[self] operator[SEP] {
identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[self] , Keyword[new] identifier[NumberAwareComparator] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[self] operator[SEP]
}
|
public int getDay() {
if (Date_Type.featOkTst && ((Date_Type)jcasType).casFeat_day == null)
jcasType.jcas.throwFeatMissing("day", "de.julielab.jules.types.Date");
return jcasType.ll_cas.ll_getIntValue(addr, ((Date_Type)jcasType).casFeatCode_day);} | class class_name[name] begin[{]
method[getDay, return_type[type[int]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[Date_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Date_Type, sub_type=None)), ==, literal[null]]]] begin[{]
call[jcasType.jcas.throwFeatMissing, parameter[literal["day"], literal["de.julielab.jules.types.Date"]]]
else begin[{]
None
end[}]
return[call[jcasType.ll_cas.ll_getIntValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Date_Type, sub_type=None))]]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[getDay] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[Date_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[Date_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_day] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getIntValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[Date_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_day] operator[SEP] operator[SEP]
}
|
public byte[] encrypt(byte[] data) {
lock.lock();
try {
if (null == this.params) {
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
} else {
cipher.init(Cipher.ENCRYPT_MODE, secretKey, params);
}
return cipher.doFinal(data);
} catch (Exception e) {
throw new CryptoException(e);
} finally {
lock.unlock();
}
} | class class_name[name] begin[{]
method[encrypt, return_type[type[byte]], modifier[public], parameter[data]] begin[{]
call[lock.lock, parameter[]]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=params, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ENCRYPT_MODE, postfix_operators=[], prefix_operators=[], qualifier=Cipher, selectors=[]), MemberReference(member=secretKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=cipher, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ENCRYPT_MODE, postfix_operators=[], prefix_operators=[], qualifier=Cipher, selectors=[]), MemberReference(member=secretKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=cipher, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doFinal, postfix_operators=[], prefix_operators=[], qualifier=cipher, 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=CryptoException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], 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[byte] operator[SEP] operator[SEP] identifier[encrypt] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[SEP] {
identifier[lock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] Other[null] operator[==] Keyword[this] operator[SEP] identifier[params] operator[SEP] {
identifier[cipher] operator[SEP] identifier[init] operator[SEP] identifier[Cipher] operator[SEP] identifier[ENCRYPT_MODE] , identifier[secretKey] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[cipher] operator[SEP] identifier[init] operator[SEP] identifier[Cipher] operator[SEP] identifier[ENCRYPT_MODE] , identifier[secretKey] , identifier[params] operator[SEP] operator[SEP]
}
Keyword[return] identifier[cipher] operator[SEP] identifier[doFinal] operator[SEP] identifier[data] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CryptoException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[lock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP]
}
}
|
protected boolean isUpToDate(FilePath expectedLocation, Installable i) throws IOException, InterruptedException {
FilePath marker = expectedLocation.child(".installedFrom");
return marker.exists() && marker.readToString().equals(i.url);
} | class class_name[name] begin[{]
method[isUpToDate, return_type[type[boolean]], modifier[protected], parameter[expectedLocation, i]] begin[{]
local_variable[type[FilePath], marker]
return[binary_operation[call[marker.exists, parameter[]], &&, call[marker.readToString, parameter[]]]]
end[}]
END[}] | Keyword[protected] Keyword[boolean] identifier[isUpToDate] operator[SEP] identifier[FilePath] identifier[expectedLocation] , identifier[Installable] identifier[i] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] {
identifier[FilePath] identifier[marker] operator[=] identifier[expectedLocation] operator[SEP] identifier[child] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[marker] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[&&] identifier[marker] operator[SEP] identifier[readToString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[i] operator[SEP] identifier[url] operator[SEP] operator[SEP]
}
|
@Override
public void readExternal(ObjectInput in)
throws IOException, ClassNotFoundException {
int header = in.readByte();
switch (header) {
case NEGATIVE_DAY_OF_MONTH_PATTERN_TYPE:
this.obj = readPattern(in);
break;
default:
throw new StreamCorruptedException("Unknown serialized type.");
}
} | class class_name[name] begin[{]
method[readExternal, return_type[void], modifier[public], parameter[in]] begin[{]
local_variable[type[int], header]
SwitchStatement(cases=[SwitchStatementCase(case=['NEGATIVE_DAY_OF_MONTH_PATTERN_TYPE'], statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=obj, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readPattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown serialized type.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StreamCorruptedException, sub_type=None)), label=None)])], expression=MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[readExternal] operator[SEP] identifier[ObjectInput] identifier[in] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ClassNotFoundException] {
Keyword[int] identifier[header] operator[=] identifier[in] operator[SEP] identifier[readByte] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[header] operator[SEP] {
Keyword[case] identifier[NEGATIVE_DAY_OF_MONTH_PATTERN_TYPE] operator[:] Keyword[this] operator[SEP] identifier[obj] operator[=] identifier[readPattern] operator[SEP] identifier[in] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[StreamCorruptedException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
private String[] getPermissions(HierarchicalProperty property)
{
Set<String> permissionsToBeChanged = new HashSet<String>();
// grant|deny element must have at least one privilege element
// <!ELEMENT grant (privilege+)>
// <!ELEMENT deny (privilege+)>
if (property.getChildren().size() == 0)
{
throw new IllegalArgumentException("Malformed grant|deny element (seems that no privilige is specified)");
}
for (HierarchicalProperty propertyRunner : property.getChildren())
{
HierarchicalProperty permissionProperty;
// obviously privilege must be single named
// <!ELEMENT privilege ANY>
if (ACLProperties.PRIVILEGE.equals(propertyRunner.getName()))
{
if (propertyRunner.getChildren().size() > 1)
{
throw new IllegalArgumentException(
"Malformed privilege name (element privilege must contain only one element)");
}
permissionProperty = propertyRunner.getChild(0);
}
else
{
permissionProperty = propertyRunner;
}
if (ACLProperties.READ.equals(permissionProperty.getName()))
{
permissionsToBeChanged.add(PermissionType.READ);
}
else if (ACLProperties.WRITE.equals(permissionProperty.getName()))
{
permissionsToBeChanged.add(PermissionType.ADD_NODE);
permissionsToBeChanged.add(PermissionType.SET_PROPERTY);
permissionsToBeChanged.add(PermissionType.REMOVE);
}
else if (ACLProperties.ALL.equals(permissionProperty.getName()))
{
permissionsToBeChanged.add(PermissionType.READ);
permissionsToBeChanged.add(PermissionType.ADD_NODE);
permissionsToBeChanged.add(PermissionType.SET_PROPERTY);
permissionsToBeChanged.add(PermissionType.REMOVE);
}
// in case privilege with specified name is unsupported
// or simply incorrect privilege name
else
{
throw new IllegalArgumentException("Malformed privilege element (unsupported privilege name)");
}
}
return permissionsToBeChanged.toArray(new String[0]);
} | class class_name[name] begin[{]
method[getPermissions, return_type[type[String]], modifier[private], parameter[property]] begin[{]
local_variable[type[Set], permissionsToBeChanged]
if[binary_operation[call[property.getChildren, parameter[]], ==, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Malformed grant|deny element (seems that no privilige is specified)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=permissionProperty)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HierarchicalProperty, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=propertyRunner, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=ACLProperties.PRIVILEGE, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=permissionProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=propertyRunner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=propertyRunner, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Malformed privilege name (element privilege must contain only one element)")], 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=permissionProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getChild, postfix_operators=[], prefix_operators=[], qualifier=propertyRunner, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=permissionProperty, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=ACLProperties.READ, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=permissionProperty, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=ACLProperties.WRITE, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=permissionProperty, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=ACLProperties.ALL, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Malformed privilege element (unsupported privilege name)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=READ, postfix_operators=[], prefix_operators=[], qualifier=PermissionType, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=permissionsToBeChanged, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ADD_NODE, postfix_operators=[], prefix_operators=[], qualifier=PermissionType, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=permissionsToBeChanged, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SET_PROPERTY, postfix_operators=[], prefix_operators=[], qualifier=PermissionType, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=permissionsToBeChanged, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=REMOVE, postfix_operators=[], prefix_operators=[], qualifier=PermissionType, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=permissionsToBeChanged, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ADD_NODE, postfix_operators=[], prefix_operators=[], qualifier=PermissionType, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=permissionsToBeChanged, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SET_PROPERTY, postfix_operators=[], prefix_operators=[], qualifier=PermissionType, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=permissionsToBeChanged, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=REMOVE, postfix_operators=[], prefix_operators=[], qualifier=PermissionType, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=permissionsToBeChanged, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=READ, postfix_operators=[], prefix_operators=[], qualifier=PermissionType, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=permissionsToBeChanged, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=propertyRunner)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HierarchicalProperty, sub_type=None))), label=None)
return[call[permissionsToBeChanged.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[private] identifier[String] operator[SEP] operator[SEP] identifier[getPermissions] operator[SEP] identifier[HierarchicalProperty] identifier[property] operator[SEP] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[permissionsToBeChanged] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[property] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[HierarchicalProperty] identifier[propertyRunner] operator[:] identifier[property] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] {
identifier[HierarchicalProperty] identifier[permissionProperty] operator[SEP] Keyword[if] operator[SEP] identifier[ACLProperties] operator[SEP] identifier[PRIVILEGE] operator[SEP] identifier[equals] operator[SEP] identifier[propertyRunner] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[propertyRunner] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[permissionProperty] operator[=] identifier[propertyRunner] operator[SEP] identifier[getChild] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[permissionProperty] operator[=] identifier[propertyRunner] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ACLProperties] operator[SEP] identifier[READ] operator[SEP] identifier[equals] operator[SEP] identifier[permissionProperty] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[permissionsToBeChanged] operator[SEP] identifier[add] operator[SEP] identifier[PermissionType] operator[SEP] identifier[READ] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[ACLProperties] operator[SEP] identifier[WRITE] operator[SEP] identifier[equals] operator[SEP] identifier[permissionProperty] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[permissionsToBeChanged] operator[SEP] identifier[add] operator[SEP] identifier[PermissionType] operator[SEP] identifier[ADD_NODE] operator[SEP] operator[SEP] identifier[permissionsToBeChanged] operator[SEP] identifier[add] operator[SEP] identifier[PermissionType] operator[SEP] identifier[SET_PROPERTY] operator[SEP] operator[SEP] identifier[permissionsToBeChanged] operator[SEP] identifier[add] operator[SEP] identifier[PermissionType] operator[SEP] identifier[REMOVE] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[ACLProperties] operator[SEP] identifier[ALL] operator[SEP] identifier[equals] operator[SEP] identifier[permissionProperty] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[permissionsToBeChanged] operator[SEP] identifier[add] operator[SEP] identifier[PermissionType] operator[SEP] identifier[READ] operator[SEP] operator[SEP] identifier[permissionsToBeChanged] operator[SEP] identifier[add] operator[SEP] identifier[PermissionType] operator[SEP] identifier[ADD_NODE] operator[SEP] operator[SEP] identifier[permissionsToBeChanged] operator[SEP] identifier[add] operator[SEP] identifier[PermissionType] operator[SEP] identifier[SET_PROPERTY] operator[SEP] operator[SEP] identifier[permissionsToBeChanged] operator[SEP] identifier[add] operator[SEP] identifier[PermissionType] operator[SEP] identifier[REMOVE] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[permissionsToBeChanged] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
|
public UnprotectedStringBuffer getAttributeValueWithPrefix(CharSequence prefix, CharSequence name) {
for (Attribute attr : event.attributes)
if (attr.localName.equals(name) && attr.namespacePrefix.equals(prefix))
return attr.value;
return null;
} | class class_name[name] begin[{]
method[getAttributeValueWithPrefix, return_type[type[UnprotectedStringBuffer]], modifier[public], parameter[prefix, name]] begin[{]
ForStatement(body=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=attr.localName, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=attr.namespacePrefix, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[]), label=None)), control=EnhancedForControl(iterable=MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=attr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None))), label=None)
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[UnprotectedStringBuffer] identifier[getAttributeValueWithPrefix] operator[SEP] identifier[CharSequence] identifier[prefix] , identifier[CharSequence] identifier[name] operator[SEP] {
Keyword[for] operator[SEP] identifier[Attribute] identifier[attr] operator[:] identifier[event] operator[SEP] identifier[attributes] operator[SEP] Keyword[if] operator[SEP] identifier[attr] operator[SEP] identifier[localName] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[&&] identifier[attr] operator[SEP] identifier[namespacePrefix] operator[SEP] identifier[equals] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] Keyword[return] identifier[attr] operator[SEP] identifier[value] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
public static Matcher<ContextElement> identifier(final Matcher<Class<?>> matcher) {
return new Matcher<ContextElement>() {
@Override
protected boolean matchesSafely(ContextElement t) {
return matcher.matches(t.identifier());
}
@Override
public String toString() {
return "an identifier that is " + matcher;
}
};
} | class class_name[name] begin[{]
method[identifier, return_type[type[Matcher]], modifier[public static], parameter[matcher]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=identifier, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None)], member=matches, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'protected'}, name=matchesSafely, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=ContextElement, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="an identifier that is "), operandr=MemberReference(member=matcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), label=None)], documentation=None, modifiers={'public'}, name=toString, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ContextElement, sub_type=None))], dimensions=None, name=Matcher, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Matcher] operator[<] identifier[ContextElement] operator[>] identifier[identifier] operator[SEP] Keyword[final] identifier[Matcher] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[matcher] operator[SEP] {
Keyword[return] Keyword[new] identifier[Matcher] operator[<] identifier[ContextElement] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[protected] Keyword[boolean] identifier[matchesSafely] operator[SEP] identifier[ContextElement] identifier[t] operator[SEP] {
Keyword[return] identifier[matcher] operator[SEP] identifier[matches] operator[SEP] identifier[t] operator[SEP] identifier[identifier] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[toString] operator[SEP] operator[SEP] {
Keyword[return] literal[String] operator[+] identifier[matcher] operator[SEP]
}
} operator[SEP]
}
|
public Optional<Range<T>> intersect(Tuple2<T, T> other) {
return Tuple2.intersect(this, other).map(Range::new);
} | class class_name[name] begin[{]
method[intersect, return_type[type[Optional]], modifier[public], parameter[other]] begin[{]
return[call[Tuple2.intersect, parameter[THIS[], member[.other]]]]
end[}]
END[}] | Keyword[public] identifier[Optional] operator[<] identifier[Range] operator[<] identifier[T] operator[>] operator[>] identifier[intersect] operator[SEP] identifier[Tuple2] operator[<] identifier[T] , identifier[T] operator[>] identifier[other] operator[SEP] {
Keyword[return] identifier[Tuple2] operator[SEP] identifier[intersect] operator[SEP] Keyword[this] , identifier[other] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Range] operator[::] Keyword[new] operator[SEP] operator[SEP]
}
|
public void setFragment(boolean newFragment) {
boolean oldFragment = fragment;
fragment = newFragment;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtextPackage.TERMINAL_RULE__FRAGMENT, oldFragment, fragment));
} | class class_name[name] begin[{]
method[setFragment, return_type[void], modifier[public], parameter[newFragment]] begin[{]
local_variable[type[boolean], oldFragment]
assign[member[.fragment], member[.newFragment]]
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=TERMINAL_RULE__FRAGMENT, postfix_operators=[], prefix_operators=[], qualifier=XtextPackage, selectors=[]), MemberReference(member=oldFragment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fragment, 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[setFragment] operator[SEP] Keyword[boolean] identifier[newFragment] operator[SEP] {
Keyword[boolean] identifier[oldFragment] operator[=] identifier[fragment] operator[SEP] identifier[fragment] operator[=] identifier[newFragment] 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[XtextPackage] operator[SEP] identifier[TERMINAL_RULE__FRAGMENT] , identifier[oldFragment] , identifier[fragment] operator[SEP] operator[SEP] operator[SEP]
}
|
protected static String getStemPrefix() {
String uportalStem = GrouperClientUtils.propertiesValue(STEM_PREFIX, false);
// make sure it ends in colon
if (!StringUtils.isBlank(uportalStem)) {
if (uportalStem.endsWith(":")) {
uportalStem = uportalStem.substring(0, uportalStem.length() - 1);
}
}
return uportalStem;
} | class class_name[name] begin[{]
method[getStemPrefix, return_type[type[String]], modifier[static protected], parameter[]] begin[{]
local_variable[type[String], uportalStem]
if[call[StringUtils.isBlank, parameter[member[.uportalStem]]]] begin[{]
if[call[uportalStem.endsWith, parameter[literal[":"]]]] begin[{]
assign[member[.uportalStem], call[uportalStem.substring, parameter[literal[0], binary_operation[call[uportalStem.length, parameter[]], -, literal[1]]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.uportalStem]]
end[}]
END[}] | Keyword[protected] Keyword[static] identifier[String] identifier[getStemPrefix] operator[SEP] operator[SEP] {
identifier[String] identifier[uportalStem] operator[=] identifier[GrouperClientUtils] operator[SEP] identifier[propertiesValue] operator[SEP] identifier[STEM_PREFIX] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[uportalStem] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[uportalStem] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[uportalStem] operator[=] identifier[uportalStem] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[uportalStem] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[uportalStem] operator[SEP]
}
|
public List<Form> getFormDescendants(
List<Long> electronicFormIdsParam,
boolean includeFieldDataParam,
boolean includeTableFieldsParam,
boolean includeTableFieldFormRecordInfoParam)
{
if(electronicFormIdsParam == null ||
electronicFormIdsParam.isEmpty())
{
return null;
}
//String stringQuery = "formType:(\"JIT Schedule\" \"SMT Training\") AND flowState:\"Not In Flow\"";
//Query using the descendantId directly...
StringBuffer descendantQuery = new StringBuffer(Form.JSONMapping.ANCESTOR_ID);
descendantQuery.append(":(");
for(Long electronicFormId : electronicFormIdsParam)
{
descendantQuery.append("\"");
descendantQuery.append(electronicFormId);
descendantQuery.append("\"");
descendantQuery.append(" ");
}
String fullQueryToExec = descendantQuery.toString();
fullQueryToExec = fullQueryToExec.substring(
0, fullQueryToExec.length() - 1);
fullQueryToExec = fullQueryToExec.concat(")");
//Search for the Descendants...
List<Form> returnVal = null;
if(includeFieldDataParam)
{
returnVal = this.searchAndConvertHitsToFormWithAllFields(
QueryBuilders.queryStringQuery(fullQueryToExec),
Index.DOCUMENT,
DEFAULT_OFFSET, MAX_NUMBER_OF_TABLE_RECORDS,
new Long[]{});
}
else
{
returnVal = this.searchAndConvertHitsToFormWithNoFields(
QueryBuilders.queryStringQuery(fullQueryToExec),
Index.DOCUMENT,
DEFAULT_OFFSET, MAX_NUMBER_OF_TABLE_RECORDS,
new Long[]{});
}
//Whether table field data should be included...
if(!includeTableFieldsParam)
{
return returnVal;
}
//No result...
if(returnVal == null)
{
return returnVal;
}
//Populate in order to have table field data...
for(Form descendantForm : returnVal)
{
this.populateTableFields(
false,
includeFieldDataParam,
descendantForm.getFormFields());
}
return returnVal;
} | class class_name[name] begin[{]
method[getFormDescendants, return_type[type[List]], modifier[public], parameter[electronicFormIdsParam, includeFieldDataParam, includeTableFieldsParam, includeTableFieldFormRecordInfoParam]] begin[{]
if[binary_operation[binary_operation[member[.electronicFormIdsParam], ==, literal[null]], ||, call[electronicFormIdsParam.isEmpty, parameter[]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[StringBuffer], descendantQuery]
call[descendantQuery.append, parameter[literal[":("]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"")], member=append, postfix_operators=[], prefix_operators=[], qualifier=descendantQuery, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=electronicFormId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=descendantQuery, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"")], member=append, postfix_operators=[], prefix_operators=[], qualifier=descendantQuery, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=descendantQuery, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=electronicFormIdsParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=electronicFormId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))), label=None)
local_variable[type[String], fullQueryToExec]
assign[member[.fullQueryToExec], call[fullQueryToExec.substring, parameter[literal[0], binary_operation[call[fullQueryToExec.length, parameter[]], -, literal[1]]]]]
assign[member[.fullQueryToExec], call[fullQueryToExec.concat, parameter[literal[")"]]]]
local_variable[type[List], returnVal]
if[member[.includeFieldDataParam]] begin[{]
assign[member[.returnVal], THIS[call[None.searchAndConvertHitsToFormWithAllFields, parameter[call[QueryBuilders.queryStringQuery, parameter[member[.fullQueryToExec]]], member[Index.DOCUMENT], member[.DEFAULT_OFFSET], member[.MAX_NUMBER_OF_TABLE_RECORDS], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))]]]]
else begin[{]
assign[member[.returnVal], THIS[call[None.searchAndConvertHitsToFormWithNoFields, parameter[call[QueryBuilders.queryStringQuery, parameter[member[.fullQueryToExec]]], member[Index.DOCUMENT], member[.DEFAULT_OFFSET], member[.MAX_NUMBER_OF_TABLE_RECORDS], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))]]]]
end[}]
if[member[.includeTableFieldsParam]] begin[{]
return[member[.returnVal]]
else begin[{]
None
end[}]
if[binary_operation[member[.returnVal], ==, literal[null]]] begin[{]
return[member[.returnVal]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=includeFieldDataParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getFormFields, postfix_operators=[], prefix_operators=[], qualifier=descendantForm, selectors=[], type_arguments=None)], member=populateTableFields, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=returnVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=descendantForm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Form, sub_type=None))), label=None)
return[member[.returnVal]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[Form] operator[>] identifier[getFormDescendants] operator[SEP] identifier[List] operator[<] identifier[Long] operator[>] identifier[electronicFormIdsParam] , Keyword[boolean] identifier[includeFieldDataParam] , Keyword[boolean] identifier[includeTableFieldsParam] , Keyword[boolean] identifier[includeTableFieldFormRecordInfoParam] operator[SEP] {
Keyword[if] operator[SEP] identifier[electronicFormIdsParam] operator[==] Other[null] operator[||] identifier[electronicFormIdsParam] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[StringBuffer] identifier[descendantQuery] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] identifier[Form] operator[SEP] identifier[JSONMapping] operator[SEP] identifier[ANCESTOR_ID] operator[SEP] operator[SEP] identifier[descendantQuery] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Long] identifier[electronicFormId] operator[:] identifier[electronicFormIdsParam] operator[SEP] {
identifier[descendantQuery] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[descendantQuery] operator[SEP] identifier[append] operator[SEP] identifier[electronicFormId] operator[SEP] operator[SEP] identifier[descendantQuery] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[descendantQuery] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[String] identifier[fullQueryToExec] operator[=] identifier[descendantQuery] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[fullQueryToExec] operator[=] identifier[fullQueryToExec] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[fullQueryToExec] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[fullQueryToExec] operator[=] identifier[fullQueryToExec] operator[SEP] identifier[concat] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Form] operator[>] identifier[returnVal] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[includeFieldDataParam] operator[SEP] {
identifier[returnVal] operator[=] Keyword[this] operator[SEP] identifier[searchAndConvertHitsToFormWithAllFields] operator[SEP] identifier[QueryBuilders] operator[SEP] identifier[queryStringQuery] operator[SEP] identifier[fullQueryToExec] operator[SEP] , identifier[Index] operator[SEP] identifier[DOCUMENT] , identifier[DEFAULT_OFFSET] , identifier[MAX_NUMBER_OF_TABLE_RECORDS] , Keyword[new] identifier[Long] operator[SEP] operator[SEP] {
} operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[returnVal] operator[=] Keyword[this] operator[SEP] identifier[searchAndConvertHitsToFormWithNoFields] operator[SEP] identifier[QueryBuilders] operator[SEP] identifier[queryStringQuery] operator[SEP] identifier[fullQueryToExec] operator[SEP] , identifier[Index] operator[SEP] identifier[DOCUMENT] , identifier[DEFAULT_OFFSET] , identifier[MAX_NUMBER_OF_TABLE_RECORDS] , Keyword[new] identifier[Long] operator[SEP] operator[SEP] {
} operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[includeTableFieldsParam] operator[SEP] {
Keyword[return] identifier[returnVal] operator[SEP]
}
Keyword[if] operator[SEP] identifier[returnVal] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[returnVal] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Form] identifier[descendantForm] operator[:] identifier[returnVal] operator[SEP] {
Keyword[this] operator[SEP] identifier[populateTableFields] operator[SEP] literal[boolean] , identifier[includeFieldDataParam] , identifier[descendantForm] operator[SEP] identifier[getFormFields] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[returnVal] operator[SEP]
}
|
public static SynchronizedInterner<Object> setGlobal(Interner<Object> delegate) {
synchronized(globalMutex) {
SynchronizedInterner<Object> oldInterner = SynchronizedInterner.interner;
SynchronizedInterner.interner = Generics.newSynchronizedInterner(delegate);
return oldInterner;
}
} | class class_name[name] begin[{]
method[setGlobal, return_type[type[SynchronizedInterner]], modifier[public static], parameter[delegate]] begin[{]
SYNCHRONIZED[member[.globalMutex]] BEGIN[{]
local_variable[type[SynchronizedInterner], oldInterner]
assign[member[SynchronizedInterner.interner], call[Generics.newSynchronizedInterner, parameter[member[.delegate]]]]
return[member[.oldInterner]]
END[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[SynchronizedInterner] operator[<] identifier[Object] operator[>] identifier[setGlobal] operator[SEP] identifier[Interner] operator[<] identifier[Object] operator[>] identifier[delegate] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[globalMutex] operator[SEP] {
identifier[SynchronizedInterner] operator[<] identifier[Object] operator[>] identifier[oldInterner] operator[=] identifier[SynchronizedInterner] operator[SEP] identifier[interner] operator[SEP] identifier[SynchronizedInterner] operator[SEP] identifier[interner] operator[=] identifier[Generics] operator[SEP] identifier[newSynchronizedInterner] operator[SEP] identifier[delegate] operator[SEP] operator[SEP] Keyword[return] identifier[oldInterner] operator[SEP]
}
}
|
public static void checkAmendExtensionsCompatibility(
final Class<? extends RepositoryMethodDescriptor> descriptorType,
final List<Annotation> extensions) {
final List<Class<? extends AmendMethodExtension>> exts =
Lists.transform(extensions, new Function<Annotation, Class<? extends AmendMethodExtension>>() {
@Nonnull
@Override
public Class<? extends AmendMethodExtension> apply(@Nonnull final Annotation input) {
return input.annotationType().getAnnotation(AmendMethod.class).value();
}
});
for (Class<? extends AmendMethodExtension> ext : exts) {
check(isCompatible(ext, AmendMethodExtension.class, descriptorType),
"Amend extension %s is incompatible with descriptor %s", ext.getSimpleName(),
descriptorType.getSimpleName());
}
} | class class_name[name] begin[{]
method[checkAmendExtensionsCompatibility, return_type[void], modifier[public static], parameter[descriptorType, extensions]] begin[{]
local_variable[type[List], exts]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=ext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AmendMethodExtension, sub_type=None)), MemberReference(member=descriptorType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isCompatible, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Amend extension %s is incompatible with descriptor %s"), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=ext, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=descriptorType, selectors=[], type_arguments=None)], member=check, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=exts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ext)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=AmendMethodExtension, sub_type=None))], dimensions=[], name=Class, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[checkAmendExtensionsCompatibility] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[RepositoryMethodDescriptor] operator[>] identifier[descriptorType] , Keyword[final] identifier[List] operator[<] identifier[Annotation] operator[>] identifier[extensions] operator[SEP] {
Keyword[final] identifier[List] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[AmendMethodExtension] operator[>] operator[>] identifier[exts] operator[=] identifier[Lists] operator[SEP] identifier[transform] operator[SEP] identifier[extensions] , Keyword[new] identifier[Function] operator[<] identifier[Annotation] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[AmendMethodExtension] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Nonnull] annotation[@] identifier[Override] Keyword[public] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[AmendMethodExtension] operator[>] identifier[apply] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[Annotation] identifier[input] operator[SEP] {
Keyword[return] identifier[input] operator[SEP] identifier[annotationType] operator[SEP] operator[SEP] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[AmendMethod] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[AmendMethodExtension] operator[>] identifier[ext] operator[:] identifier[exts] operator[SEP] {
identifier[check] operator[SEP] identifier[isCompatible] operator[SEP] identifier[ext] , identifier[AmendMethodExtension] operator[SEP] Keyword[class] , identifier[descriptorType] operator[SEP] , literal[String] , identifier[ext] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[descriptorType] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static boolean is_haladi(String str)
{
String s1 = VarnaUtil.getAdiVarna(str);
if (is_kavarga(s1) || is_chavarga(s1) || is_Tavarga(s1) || is_tavarga(s1) || is_pavarga(s1) || is_shar(s1) || is_yan(s1) || s1.equals("h") || s1.equals("M")) return true;
return false;
} | class class_name[name] begin[{]
method[is_haladi, return_type[type[boolean]], modifier[public static], parameter[str]] begin[{]
local_variable[type[String], s1]
if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[call[.is_kavarga, parameter[member[.s1]]], ||, call[.is_chavarga, parameter[member[.s1]]]], ||, call[.is_Tavarga, parameter[member[.s1]]]], ||, call[.is_tavarga, parameter[member[.s1]]]], ||, call[.is_pavarga, parameter[member[.s1]]]], ||, call[.is_shar, parameter[member[.s1]]]], ||, call[.is_yan, parameter[member[.s1]]]], ||, call[s1.equals, parameter[literal["h"]]]], ||, call[s1.equals, parameter[literal["M"]]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[is_haladi] operator[SEP] identifier[String] identifier[str] operator[SEP] {
identifier[String] identifier[s1] operator[=] identifier[VarnaUtil] operator[SEP] identifier[getAdiVarna] operator[SEP] identifier[str] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[is_kavarga] operator[SEP] identifier[s1] operator[SEP] operator[||] identifier[is_chavarga] operator[SEP] identifier[s1] operator[SEP] operator[||] identifier[is_Tavarga] operator[SEP] identifier[s1] operator[SEP] operator[||] identifier[is_tavarga] operator[SEP] identifier[s1] operator[SEP] operator[||] identifier[is_pavarga] operator[SEP] identifier[s1] operator[SEP] operator[||] identifier[is_shar] operator[SEP] identifier[s1] operator[SEP] operator[||] identifier[is_yan] operator[SEP] identifier[s1] operator[SEP] operator[||] identifier[s1] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[s1] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
|
@Override
public void unsubscribeAll(EventPublisher source) {
checkPermission();
if (source == null) {
throw new IllegalArgumentException("Parameter cannot be null");
}
super.unsubscribeAll(source);
} | class class_name[name] begin[{]
method[unsubscribeAll, return_type[void], modifier[public], parameter[source]] begin[{]
call[.checkPermission, parameter[]]
if[binary_operation[member[.source], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
SuperMethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unsubscribeAll, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[unsubscribeAll] operator[SEP] identifier[EventPublisher] identifier[source] operator[SEP] {
identifier[checkPermission] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[source] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[super] operator[SEP] identifier[unsubscribeAll] operator[SEP] identifier[source] operator[SEP] operator[SEP]
}
|
@Override
public int doStartTag() throws JspException {
String string = null;
Boolean bool = null;
if (getBase64Expr() != null
&& (bool = EvalHelper.evalBoolean("base64", getBase64Expr(), this, pageContext)) != null) {
setBase64(bool);
}
if (getSrcExpr() != null
&& (string = EvalHelper.evalString("srcExpr", getSrcExpr(), this, pageContext)) != null) {
setSrc(string);
}
return super.doStartTag();
} | class class_name[name] begin[{]
method[doStartTag, return_type[type[int]], modifier[public], parameter[]] begin[{]
local_variable[type[String], string]
local_variable[type[Boolean], bool]
if[binary_operation[binary_operation[call[.getBase64Expr, parameter[]], !=, literal[null]], &&, binary_operation[assign[member[.bool], call[EvalHelper.evalBoolean, parameter[literal["base64"], call[.getBase64Expr, parameter[]], THIS[], member[.pageContext]]]], !=, literal[null]]]] begin[{]
call[.setBase64, parameter[member[.bool]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[.getSrcExpr, parameter[]], !=, literal[null]], &&, binary_operation[assign[member[.string], call[EvalHelper.evalString, parameter[literal["srcExpr"], call[.getSrcExpr, parameter[]], THIS[], member[.pageContext]]]], !=, literal[null]]]] begin[{]
call[.setSrc, parameter[member[.string]]]
else begin[{]
None
end[}]
return[SuperMethodInvocation(arguments=[], member=doStartTag, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[doStartTag] operator[SEP] operator[SEP] Keyword[throws] identifier[JspException] {
identifier[String] identifier[string] operator[=] Other[null] operator[SEP] identifier[Boolean] identifier[bool] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[getBase64Expr] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[SEP] identifier[bool] operator[=] identifier[EvalHelper] operator[SEP] identifier[evalBoolean] operator[SEP] literal[String] , identifier[getBase64Expr] operator[SEP] operator[SEP] , Keyword[this] , identifier[pageContext] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[setBase64] operator[SEP] identifier[bool] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[getSrcExpr] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[SEP] identifier[string] operator[=] identifier[EvalHelper] operator[SEP] identifier[evalString] operator[SEP] literal[String] , identifier[getSrcExpr] operator[SEP] operator[SEP] , Keyword[this] , identifier[pageContext] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[setSrc] operator[SEP] identifier[string] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[doStartTag] operator[SEP] operator[SEP] operator[SEP]
}
|
public CallTreeNode addChild(String name) {
if (children == null) {
children = new HashMap<>();
}
CallTreeNode child = new CallTreeNode(name);
children.put(name, child);
child.parent = this;
return child;
} | class class_name[name] begin[{]
method[addChild, return_type[type[CallTreeNode]], modifier[public], parameter[name]] begin[{]
if[binary_operation[member[.children], ==, literal[null]]] begin[{]
assign[member[.children], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[CallTreeNode], child]
call[children.put, parameter[member[.name], member[.child]]]
assign[member[child.parent], THIS[]]
return[member[.child]]
end[}]
END[}] | Keyword[public] identifier[CallTreeNode] identifier[addChild] operator[SEP] identifier[String] identifier[name] operator[SEP] {
Keyword[if] operator[SEP] identifier[children] operator[==] Other[null] operator[SEP] {
identifier[children] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
identifier[CallTreeNode] identifier[child] operator[=] Keyword[new] identifier[CallTreeNode] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[children] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[child] operator[SEP] operator[SEP] identifier[child] operator[SEP] identifier[parent] operator[=] Keyword[this] operator[SEP] Keyword[return] identifier[child] operator[SEP]
}
|
private byte[] doDigest(byte[]... datas) {
for (byte[] data : datas) {
if (null != data) {
this.digest.update(data);
}
}
return this.digest.digest();
} | class class_name[name] begin[{]
method[doDigest, return_type[type[byte]], modifier[private], parameter[datas]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=digest, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=update, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=datas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=data)], modifiers=set(), type=BasicType(dimensions=[None], name=byte))), label=None)
return[THIS[member[None.digest]call[None.digest, parameter[]]]]
end[}]
END[}] | Keyword[private] Keyword[byte] operator[SEP] operator[SEP] identifier[doDigest] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[...] identifier[datas] operator[SEP] {
Keyword[for] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[:] identifier[datas] operator[SEP] {
Keyword[if] operator[SEP] Other[null] operator[!=] identifier[data] operator[SEP] {
Keyword[this] operator[SEP] identifier[digest] operator[SEP] identifier[update] operator[SEP] identifier[data] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[this] operator[SEP] identifier[digest] operator[SEP] identifier[digest] operator[SEP] operator[SEP] operator[SEP]
}
|
public Transferable getTransferable(Component c)
{
if (c instanceof javax.swing.JTree
&& ((javax.swing.JTree)c).getModel() instanceof OjbMetaDataTreeModel)
{
try
{
javax.swing.JTree tree = (javax.swing.JTree)c;
OjbMetaDataTreeModel model = (OjbMetaDataTreeModel)tree.getModel();
AttributeDescriptorBase descriptors[] = new AttributeDescriptorBase[tree.getSelectionCount()];
for (int i = 0; tree.getSelectionPaths() != null && i < tree.getSelectionPaths().length; i++)
{
Object o = ((OjbMetaTreeNode)tree.getSelectionPaths()[i].getLastPathComponent()).getAssociatedDescriptor();
if (o instanceof AttributeDescriptorBase)
{
System.err.println(" adding Node" + o);
descriptors[i] = (AttributeDescriptorBase) o;
}
}
return new OjbMetadataTransferable(descriptors);
}
catch (Throwable t)
{
t.printStackTrace();
}
}
return null;
} | class class_name[name] begin[{]
method[getTransferable, return_type[type[Transferable]], modifier[public], parameter[c]] begin[{]
if[binary_operation[binary_operation[member[.c], instanceof, type[javax]], &&, binary_operation[Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JTree, sub_type=None)))), instanceof, type[OjbMetaDataTreeModel]]]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JTree, sub_type=None)))), name=tree)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JTree, sub_type=None)))), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getModel, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=OjbMetaDataTreeModel, sub_type=None)), name=model)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OjbMetaDataTreeModel, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[None], initializer=ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=getSelectionCount, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AttributeDescriptorBase, sub_type=None)), name=descriptors)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AttributeDescriptorBase, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getSelectionPaths, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getLastPathComponent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=OjbMetaTreeNode, sub_type=None)), name=o)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=AttributeDescriptorBase, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" adding Node"), operandr=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=descriptors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AttributeDescriptorBase, sub_type=None))), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSelectionPaths, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getSelectionPaths, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operator=<), 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), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=descriptors, 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=OjbMetadataTransferable, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[Transferable] identifier[getTransferable] operator[SEP] identifier[Component] identifier[c] operator[SEP] {
Keyword[if] operator[SEP] identifier[c] Keyword[instanceof] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JTree] operator[&&] operator[SEP] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JTree] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[getModel] operator[SEP] operator[SEP] Keyword[instanceof] identifier[OjbMetaDataTreeModel] operator[SEP] {
Keyword[try] {
identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JTree] identifier[tree] operator[=] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JTree] operator[SEP] identifier[c] operator[SEP] identifier[OjbMetaDataTreeModel] identifier[model] operator[=] operator[SEP] identifier[OjbMetaDataTreeModel] operator[SEP] identifier[tree] operator[SEP] identifier[getModel] operator[SEP] operator[SEP] operator[SEP] identifier[AttributeDescriptorBase] identifier[descriptors] operator[SEP] operator[SEP] operator[=] Keyword[new] identifier[AttributeDescriptorBase] operator[SEP] identifier[tree] operator[SEP] identifier[getSelectionCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[tree] operator[SEP] identifier[getSelectionPaths] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[i] operator[<] identifier[tree] operator[SEP] identifier[getSelectionPaths] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Object] identifier[o] operator[=] operator[SEP] operator[SEP] identifier[OjbMetaTreeNode] operator[SEP] identifier[tree] operator[SEP] identifier[getSelectionPaths] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getLastPathComponent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getAssociatedDescriptor] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[AttributeDescriptorBase] operator[SEP] {
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[o] operator[SEP] operator[SEP] identifier[descriptors] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] identifier[AttributeDescriptorBase] operator[SEP] identifier[o] operator[SEP]
}
}
Keyword[return] Keyword[new] identifier[OjbMetadataTransferable] operator[SEP] identifier[descriptors] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[t] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public void dereferenceControllable()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "dereferenceControllable");
messageProcessor = null;
destinationIndex = null;
destinationManager = null;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "dereferenceControllable");
} | class class_name[name] begin[{]
method[dereferenceControllable, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["dereferenceControllable"]]]
else begin[{]
None
end[}]
assign[member[.messageProcessor], literal[null]]
assign[member[.destinationIndex], literal[null]]
assign[member[.destinationManager], literal[null]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["dereferenceControllable"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[dereferenceControllable] 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[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[messageProcessor] operator[=] Other[null] operator[SEP] identifier[destinationIndex] operator[=] Other[null] operator[SEP] identifier[destinationManager] operator[=] Other[null] 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]
}
|
void sendCalledFromAsynsSendRunThread(Message message, int SendMethodType, Object[] params, CompletionListener cListener) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "sendCalledFromAsynsSendRunThread", new Object[] { message, SendMethodType, params, cListener });
try {
if (SendMethodType == PRODUCER_SEND_WITH_ONLY_MESSAGE) {
sendUsingProducerSession(message);
} else if (SendMethodType == PRODUCER_SEND_MESSAGE_WITH_PARAMETERS) {
sendUsingProducerSession(message,
(Integer) params[0], //deliveryMode
(Integer) params[1], //priority
(Long) params[2]);//timeToLive
} else if (SendMethodType == CONNECTION_SEND_MESSAGE_WITH_PARAMETERS) {
sendUsingConnection((Destination) params[3], //destination
message,
(Integer) params[0], //deliveryMode
(Integer) params[1], //priority
(Long) params[2]); //timeToLive
}
//send method successful.. call onCompletion.
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "calling onCompletion ",
new Object[] { message, cListener, message });
try {
//AsyncSend is successfully completed. So remove the restriction on message object ... so that
//application can access message object.This we have to do only for SIB messages.
if (message instanceof JmsMessageImpl) {
((JmsMessageImpl) message).setAsyncSendInProgress(false);
}
cListener.onCompletion(message);
} catch (Throwable e) {
//Exception in onCompletion method. Should be handled by user. add to trace.
SibTr.debug(tc, "Caught exception in onCompletion method", new Object[] { message, cListener, message, e });
}
} catch (Exception e) {
//exception in send method... call onException and return.
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "Caught exception in executing send method .. calling onException",
new Object[] { message, cListener, message, e });
try {
//AsyncSend is successfully completed. So remove the restriction on message object ... so that
//application can access message object.This we have to do only for SIB messages.
if (message instanceof JmsMessageImpl) {
((JmsMessageImpl) message).setAsyncSendInProgress(false);
}
cListener.onException(message, e);
} catch (Throwable ex) {
//Exception in onCompletion method. Should be handled by user. add to trace.
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "Caught exception in onException method", new Object[] { message, cListener, message, ex });
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendCalledFromAsynsSendRunThread");
return;
} finally {
//decrement the async send count..and then notify if the count is zero.
// any blocking Sync send thread would get woken up.
synchronized (_inProgressAysncSends) {
if (_inProgressAysncSends.get() > 0)
_inProgressAysncSends.decrementAndGet();
if (_inProgressAysncSends.get() <= 0) {
_inProgressAysncSends.notifyAll();
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendCalledFromAsynsSendRunThread");
} | class class_name[name] begin[{]
method[sendCalledFromAsynsSendRunThread, return_type[void], modifier[default], parameter[message, SendMethodType, params, cListener]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["sendCalledFromAsynsSendRunThread"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SendMethodType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
else begin[{]
None
end[}]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SendMethodType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=PRODUCER_SEND_WITH_ONLY_MESSAGE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SendMethodType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=PRODUCER_SEND_MESSAGE_WITH_PARAMETERS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SendMethodType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=CONNECTION_SEND_MESSAGE_WITH_PARAMETERS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3))]), type=ReferenceType(arguments=None, dimensions=[], name=Destination, sub_type=None)), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), Cast(expression=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), Cast(expression=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], member=sendUsingConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), Cast(expression=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), Cast(expression=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], member=sendUsingProducerSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendUsingProducerSession, postfix_operators=[], prefix_operators=[], qualifier=, 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=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="calling onCompletion "), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=JmsMessageImpl, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JmsMessageImpl, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onCompletion, postfix_operators=[], prefix_operators=[], qualifier=cListener, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Caught exception in onCompletion method"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Caught exception in executing send method .. calling onException"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=JmsMessageImpl, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JmsMessageImpl, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onException, postfix_operators=[], prefix_operators=[], qualifier=cListener, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Caught exception in onException method"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Throwable']))], finally_block=None, label=None, resources=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="sendCalledFromAsynsSendRunThread")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[SynchronizedStatement(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=_inProgressAysncSends, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=decrementAndGet, postfix_operators=[], prefix_operators=[], qualifier=_inProgressAysncSends, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=_inProgressAysncSends, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=notifyAll, postfix_operators=[], prefix_operators=[], qualifier=_inProgressAysncSends, selectors=[], type_arguments=None), label=None)]))], label=None, lock=MemberReference(member=_inProgressAysncSends, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], label=None, resources=None)
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["sendCalledFromAsynsSendRunThread"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[void] identifier[sendCalledFromAsynsSendRunThread] operator[SEP] identifier[Message] identifier[message] , Keyword[int] identifier[SendMethodType] , identifier[Object] operator[SEP] operator[SEP] identifier[params] , identifier[CompletionListener] identifier[cListener] 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] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[message] , identifier[SendMethodType] , identifier[params] , identifier[cListener]
} operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[SendMethodType] operator[==] identifier[PRODUCER_SEND_WITH_ONLY_MESSAGE] operator[SEP] {
identifier[sendUsingProducerSession] operator[SEP] identifier[message] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[SendMethodType] operator[==] identifier[PRODUCER_SEND_MESSAGE_WITH_PARAMETERS] operator[SEP] {
identifier[sendUsingProducerSession] operator[SEP] identifier[message] , operator[SEP] identifier[Integer] operator[SEP] identifier[params] operator[SEP] Other[0] operator[SEP] , operator[SEP] identifier[Integer] operator[SEP] identifier[params] operator[SEP] Other[1] operator[SEP] , operator[SEP] identifier[Long] operator[SEP] identifier[params] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[SendMethodType] operator[==] identifier[CONNECTION_SEND_MESSAGE_WITH_PARAMETERS] operator[SEP] {
identifier[sendUsingConnection] operator[SEP] operator[SEP] identifier[Destination] operator[SEP] identifier[params] operator[SEP] Other[3] operator[SEP] , identifier[message] , operator[SEP] identifier[Integer] operator[SEP] identifier[params] operator[SEP] Other[0] operator[SEP] , operator[SEP] identifier[Integer] operator[SEP] identifier[params] operator[SEP] Other[1] operator[SEP] , operator[SEP] identifier[Long] operator[SEP] identifier[params] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[message] , identifier[cListener] , identifier[message]
} operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[message] Keyword[instanceof] identifier[JmsMessageImpl] operator[SEP] {
operator[SEP] operator[SEP] identifier[JmsMessageImpl] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[setAsyncSendInProgress] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[cListener] operator[SEP] identifier[onCompletion] operator[SEP] identifier[message] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[message] , identifier[cListener] , identifier[message] , identifier[e]
} operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[message] , identifier[cListener] , identifier[message] , identifier[e]
} operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[message] Keyword[instanceof] identifier[JmsMessageImpl] operator[SEP] {
operator[SEP] operator[SEP] identifier[JmsMessageImpl] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[setAsyncSendInProgress] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[cListener] operator[SEP] identifier[onException] operator[SEP] identifier[message] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[ex] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[message] , identifier[cListener] , identifier[message] , identifier[ex]
} 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] Keyword[return] operator[SEP]
}
Keyword[finally] {
Keyword[synchronized] operator[SEP] identifier[_inProgressAysncSends] operator[SEP] {
Keyword[if] operator[SEP] identifier[_inProgressAysncSends] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] identifier[_inProgressAysncSends] operator[SEP] identifier[decrementAndGet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_inProgressAysncSends] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[<=] Other[0] operator[SEP] {
identifier[_inProgressAysncSends] operator[SEP] identifier[notifyAll] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
protected void initializeStateMachine() {
stateMachine = new StateMachine<ReplicationState, ReplicationTrigger>(ReplicationState.INITIAL);
// hierarchy
stateMachine.configure(ReplicationState.IDLE).substateOf(ReplicationState.RUNNING);
stateMachine.configure(ReplicationState.OFFLINE).substateOf(ReplicationState.RUNNING);
// permitted transitions
stateMachine.configure(ReplicationState.INITIAL).permit(
ReplicationTrigger.START,
ReplicationState.RUNNING
);
stateMachine.configure(ReplicationState.IDLE).permit(
ReplicationTrigger.RESUME,
ReplicationState.RUNNING
);
stateMachine.configure(ReplicationState.RUNNING).permit(
ReplicationTrigger.WAITING_FOR_CHANGES,
ReplicationState.IDLE
);
stateMachine.configure(ReplicationState.RUNNING).permit(
ReplicationTrigger.STOP_IMMEDIATE,
ReplicationState.STOPPED
);
stateMachine.configure(ReplicationState.RUNNING).permit(
ReplicationTrigger.STOP_GRACEFUL,
ReplicationState.STOPPING
);
stateMachine.configure(ReplicationState.RUNNING).permit(
ReplicationTrigger.GO_OFFLINE,
ReplicationState.OFFLINE
);
stateMachine.configure(ReplicationState.OFFLINE).permit(
ReplicationTrigger.GO_ONLINE,
ReplicationState.RUNNING
);
stateMachine.configure(ReplicationState.STOPPING).permit(
ReplicationTrigger.STOP_IMMEDIATE,
ReplicationState.STOPPED
);
// ignored transitions
stateMachine.configure(ReplicationState.INITIAL).ignore(ReplicationTrigger.RESUME);
stateMachine.configure(ReplicationState.INITIAL).ignore(ReplicationTrigger.GO_ONLINE);
stateMachine.configure(ReplicationState.INITIAL).ignore(ReplicationTrigger.GO_OFFLINE);
stateMachine.configure(ReplicationState.RUNNING).ignore(ReplicationTrigger.START);
stateMachine.configure(ReplicationState.RUNNING).ignore(ReplicationTrigger.RESUME);
stateMachine.configure(ReplicationState.RUNNING).ignore(ReplicationTrigger.GO_ONLINE);
stateMachine.configure(ReplicationState.IDLE).ignore(ReplicationTrigger.START);
stateMachine.configure(ReplicationState.IDLE).ignore(ReplicationTrigger.GO_ONLINE);
stateMachine.configure(ReplicationState.OFFLINE).ignore(ReplicationTrigger.START);
stateMachine.configure(ReplicationState.OFFLINE).ignore(ReplicationTrigger.RESUME);
stateMachine.configure(ReplicationState.OFFLINE).ignore(ReplicationTrigger.WAITING_FOR_CHANGES);
stateMachine.configure(ReplicationState.OFFLINE).ignore(ReplicationTrigger.GO_OFFLINE);
stateMachine.configure(ReplicationState.STOPPING).ignore(ReplicationTrigger.START);
stateMachine.configure(ReplicationState.STOPPING).ignore(ReplicationTrigger.RESUME);
stateMachine.configure(ReplicationState.STOPPING).ignore(ReplicationTrigger.WAITING_FOR_CHANGES);
stateMachine.configure(ReplicationState.STOPPING).ignore(ReplicationTrigger.GO_ONLINE);
stateMachine.configure(ReplicationState.STOPPING).ignore(ReplicationTrigger.GO_OFFLINE);
stateMachine.configure(ReplicationState.STOPPING).ignore(ReplicationTrigger.STOP_GRACEFUL);
stateMachine.configure(ReplicationState.STOPPED).ignore(ReplicationTrigger.START);
stateMachine.configure(ReplicationState.STOPPED).ignore(ReplicationTrigger.RESUME);
stateMachine.configure(ReplicationState.STOPPED).ignore(ReplicationTrigger.WAITING_FOR_CHANGES);
stateMachine.configure(ReplicationState.STOPPED).ignore(ReplicationTrigger.GO_ONLINE);
stateMachine.configure(ReplicationState.STOPPED).ignore(ReplicationTrigger.GO_OFFLINE);
stateMachine.configure(ReplicationState.STOPPED).ignore(ReplicationTrigger.STOP_GRACEFUL);
stateMachine.configure(ReplicationState.STOPPED).ignore(ReplicationTrigger.STOP_IMMEDIATE);
// actions
stateMachine.configure(ReplicationState.RUNNING).onEntry(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
@Override
public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
Log.v(Log.TAG_SYNC,
"%s [onEntry()] " + transition.getSource() + " => " + transition.getDestination(),
ReplicationInternal.this.toString());
start();
notifyChangeListenersStateTransition(transition);
}
});
stateMachine.configure(ReplicationState.RUNNING).onExit(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
@Override
public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
Log.v(Log.TAG_SYNC,
"%s [onExit()] " + transition.getSource() + " => " + transition.getDestination(),
ReplicationInternal.this.toString());
}
});
stateMachine.configure(ReplicationState.IDLE).onEntry(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
@Override
public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
Log.v(Log.TAG_SYNC,
"%s [onEntry()] " + transition.getSource() + " => " + transition.getDestination(),
ReplicationInternal.this.toString());
retryReplicationIfError();
if (transition.getSource() == transition.getDestination()) {
// ignore IDLE to IDLE
return;
}
notifyChangeListenersStateTransition(transition);
// #352
// iOS version: stop replicator immediately when call setError() with permanent error.
// But, for Core Java, some of codes wait IDLE state. So this is reason to wait till
// state becomes IDLE.
if (Utils.isPermanentError(ReplicationInternal.this.error) && isContinuous()) {
Log.d(Log.TAG_SYNC, "IDLE: triggerStopGraceful() " + ReplicationInternal.this.error.toString());
triggerStopGraceful();
}
}
});
stateMachine.configure(ReplicationState.IDLE).onExit(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
@Override
public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
Log.v(Log.TAG_SYNC,
"%s [onExit()] " + transition.getSource() + " => " + transition.getDestination(),
ReplicationInternal.this.toString());
if (transition.getSource() == transition.getDestination()) {
// ignore IDLE to IDLE
return;
}
notifyChangeListenersStateTransition(transition);
}
});
stateMachine.configure(ReplicationState.OFFLINE).onEntry(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
@Override
public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
Log.v(Log.TAG_SYNC,
"%s [onEntry()] " + transition.getSource() + " => " + transition.getDestination(),
ReplicationInternal.this.toString());
goOffline();
notifyChangeListenersStateTransition(transition);
}
});
stateMachine.configure(ReplicationState.OFFLINE).onExit(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
@Override
public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
Log.v(Log.TAG_SYNC,
"%s [onExit()] " + transition.getSource() + " => " + transition.getDestination(),
ReplicationInternal.this.toString());
goOnline();
notifyChangeListenersStateTransition(transition);
}
});
stateMachine.configure(ReplicationState.STOPPING).onEntry(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
@Override
public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
Log.v(Log.TAG_SYNC,
"%s [onEntry()] " + transition.getSource() + " => " + transition.getDestination(),
ReplicationInternal.this.toString());
// NOTE: Based on StateMachine configuration, this should not happen.
// However, from Unit Test result, this could be happen.
// We should revisit StateMachine configuration and also its Thread-safe-ability
if (transition.getSource() == transition.getDestination()) {
// ignore STOPPING to STOPPING
return;
}
stop();
notifyChangeListenersStateTransition(transition);
}
});
stateMachine.configure(ReplicationState.STOPPED).onEntry(new Action1<Transition<ReplicationState, ReplicationTrigger>>() {
@Override
public void doIt(Transition<ReplicationState, ReplicationTrigger> transition) {
Log.v(Log.TAG_SYNC,
"%s [onEntry()] " + transition.getSource() + " => " + transition.getDestination(),
ReplicationInternal.this.toString());
// NOTE: Based on StateMachine configuration, this should not happen.
// However, from Unit Test result, this could be happen.
// We should revisit StateMachine configuration and also its Thread-safe-ability
if (transition.getSource() == transition.getDestination()) {
// ignore STOPPED to STOPPED
return;
}
saveLastSequence(); // move from databaseClosing() method as databaseClosing() is not called
// stop network reachablity check
stopNetworkReachabilityManager();
// close any active resources associated with this replicator
close();
clearDbRef();
notifyChangeListenersStateTransition(transition);
// ask executor to shutdown. this does not force to shutdown.
// https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html#shutdown()
synchronized (executor) {
if (!executor.isShutdown()) {
executor.shutdown();
}
}
}
});
} | class class_name[name] begin[{]
method[initializeStateMachine, return_type[void], modifier[protected], parameter[]] begin[{]
assign[member[.stateMachine], ClassCreator(arguments=[MemberReference(member=INITIAL, postfix_operators=[], prefix_operators=[], qualifier=ReplicationState, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ReplicationState, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ReplicationTrigger, sub_type=None))], dimensions=None, name=StateMachine, sub_type=None))]
call[stateMachine.configure, parameter[member[ReplicationState.IDLE]]]
call[stateMachine.configure, parameter[member[ReplicationState.OFFLINE]]]
call[stateMachine.configure, parameter[member[ReplicationState.INITIAL]]]
call[stateMachine.configure, parameter[member[ReplicationState.IDLE]]]
call[stateMachine.configure, parameter[member[ReplicationState.RUNNING]]]
call[stateMachine.configure, parameter[member[ReplicationState.RUNNING]]]
call[stateMachine.configure, parameter[member[ReplicationState.RUNNING]]]
call[stateMachine.configure, parameter[member[ReplicationState.RUNNING]]]
call[stateMachine.configure, parameter[member[ReplicationState.OFFLINE]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPING]]]
call[stateMachine.configure, parameter[member[ReplicationState.INITIAL]]]
call[stateMachine.configure, parameter[member[ReplicationState.INITIAL]]]
call[stateMachine.configure, parameter[member[ReplicationState.INITIAL]]]
call[stateMachine.configure, parameter[member[ReplicationState.RUNNING]]]
call[stateMachine.configure, parameter[member[ReplicationState.RUNNING]]]
call[stateMachine.configure, parameter[member[ReplicationState.RUNNING]]]
call[stateMachine.configure, parameter[member[ReplicationState.IDLE]]]
call[stateMachine.configure, parameter[member[ReplicationState.IDLE]]]
call[stateMachine.configure, parameter[member[ReplicationState.OFFLINE]]]
call[stateMachine.configure, parameter[member[ReplicationState.OFFLINE]]]
call[stateMachine.configure, parameter[member[ReplicationState.OFFLINE]]]
call[stateMachine.configure, parameter[member[ReplicationState.OFFLINE]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPING]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPING]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPING]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPING]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPING]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPING]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPED]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPED]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPED]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPED]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPED]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPED]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPED]]]
call[stateMachine.configure, parameter[member[ReplicationState.RUNNING]]]
call[stateMachine.configure, parameter[member[ReplicationState.RUNNING]]]
call[stateMachine.configure, parameter[member[ReplicationState.IDLE]]]
call[stateMachine.configure, parameter[member[ReplicationState.IDLE]]]
call[stateMachine.configure, parameter[member[ReplicationState.OFFLINE]]]
call[stateMachine.configure, parameter[member[ReplicationState.OFFLINE]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPING]]]
call[stateMachine.configure, parameter[member[ReplicationState.STOPPED]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[initializeStateMachine] operator[SEP] operator[SEP] {
identifier[stateMachine] operator[=] Keyword[new] identifier[StateMachine] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[INITIAL] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[IDLE] operator[SEP] operator[SEP] identifier[substateOf] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[OFFLINE] operator[SEP] operator[SEP] identifier[substateOf] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[INITIAL] operator[SEP] operator[SEP] identifier[permit] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[START] , identifier[ReplicationState] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[IDLE] operator[SEP] operator[SEP] identifier[permit] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[RESUME] , identifier[ReplicationState] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[permit] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[WAITING_FOR_CHANGES] , identifier[ReplicationState] operator[SEP] identifier[IDLE] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[permit] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[STOP_IMMEDIATE] , identifier[ReplicationState] operator[SEP] identifier[STOPPED] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[permit] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[STOP_GRACEFUL] , identifier[ReplicationState] operator[SEP] identifier[STOPPING] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[permit] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[GO_OFFLINE] , identifier[ReplicationState] operator[SEP] identifier[OFFLINE] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[OFFLINE] operator[SEP] operator[SEP] identifier[permit] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[GO_ONLINE] , identifier[ReplicationState] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPING] operator[SEP] operator[SEP] identifier[permit] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[STOP_IMMEDIATE] , identifier[ReplicationState] operator[SEP] identifier[STOPPED] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[INITIAL] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[RESUME] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[INITIAL] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[GO_ONLINE] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[INITIAL] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[GO_OFFLINE] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[START] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[RESUME] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[GO_ONLINE] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[IDLE] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[START] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[IDLE] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[GO_ONLINE] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[OFFLINE] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[START] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[OFFLINE] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[RESUME] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[OFFLINE] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[WAITING_FOR_CHANGES] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[OFFLINE] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[GO_OFFLINE] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPING] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[START] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPING] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[RESUME] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPING] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[WAITING_FOR_CHANGES] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPING] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[GO_ONLINE] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPING] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[GO_OFFLINE] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPING] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[STOP_GRACEFUL] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPED] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[START] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPED] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[RESUME] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPED] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[WAITING_FOR_CHANGES] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPED] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[GO_ONLINE] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPED] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[GO_OFFLINE] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPED] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[STOP_GRACEFUL] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPED] operator[SEP] operator[SEP] identifier[ignore] operator[SEP] identifier[ReplicationTrigger] operator[SEP] identifier[STOP_IMMEDIATE] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[onEntry] operator[SEP] Keyword[new] identifier[Action1] operator[<] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doIt] operator[SEP] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] identifier[transition] operator[SEP] {
identifier[Log] operator[SEP] identifier[v] operator[SEP] identifier[Log] operator[SEP] identifier[TAG_SYNC] , literal[String] operator[+] identifier[transition] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[transition] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] , identifier[ReplicationInternal] operator[SEP] Keyword[this] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] identifier[notifyChangeListenersStateTransition] operator[SEP] identifier[transition] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[RUNNING] operator[SEP] operator[SEP] identifier[onExit] operator[SEP] Keyword[new] identifier[Action1] operator[<] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doIt] operator[SEP] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] identifier[transition] operator[SEP] {
identifier[Log] operator[SEP] identifier[v] operator[SEP] identifier[Log] operator[SEP] identifier[TAG_SYNC] , literal[String] operator[+] identifier[transition] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[transition] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] , identifier[ReplicationInternal] operator[SEP] Keyword[this] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[IDLE] operator[SEP] operator[SEP] identifier[onEntry] operator[SEP] Keyword[new] identifier[Action1] operator[<] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doIt] operator[SEP] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] identifier[transition] operator[SEP] {
identifier[Log] operator[SEP] identifier[v] operator[SEP] identifier[Log] operator[SEP] identifier[TAG_SYNC] , literal[String] operator[+] identifier[transition] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[transition] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] , identifier[ReplicationInternal] operator[SEP] Keyword[this] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[retryReplicationIfError] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[transition] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[==] identifier[transition] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[notifyChangeListenersStateTransition] operator[SEP] identifier[transition] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Utils] operator[SEP] identifier[isPermanentError] operator[SEP] identifier[ReplicationInternal] operator[SEP] Keyword[this] operator[SEP] identifier[error] operator[SEP] operator[&&] identifier[isContinuous] operator[SEP] operator[SEP] operator[SEP] {
identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[Log] operator[SEP] identifier[TAG_SYNC] , literal[String] operator[+] identifier[ReplicationInternal] operator[SEP] Keyword[this] operator[SEP] identifier[error] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[triggerStopGraceful] operator[SEP] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[IDLE] operator[SEP] operator[SEP] identifier[onExit] operator[SEP] Keyword[new] identifier[Action1] operator[<] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doIt] operator[SEP] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] identifier[transition] operator[SEP] {
identifier[Log] operator[SEP] identifier[v] operator[SEP] identifier[Log] operator[SEP] identifier[TAG_SYNC] , literal[String] operator[+] identifier[transition] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[transition] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] , identifier[ReplicationInternal] operator[SEP] Keyword[this] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[transition] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[==] identifier[transition] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[notifyChangeListenersStateTransition] operator[SEP] identifier[transition] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[OFFLINE] operator[SEP] operator[SEP] identifier[onEntry] operator[SEP] Keyword[new] identifier[Action1] operator[<] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doIt] operator[SEP] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] identifier[transition] operator[SEP] {
identifier[Log] operator[SEP] identifier[v] operator[SEP] identifier[Log] operator[SEP] identifier[TAG_SYNC] , literal[String] operator[+] identifier[transition] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[transition] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] , identifier[ReplicationInternal] operator[SEP] Keyword[this] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[goOffline] operator[SEP] operator[SEP] operator[SEP] identifier[notifyChangeListenersStateTransition] operator[SEP] identifier[transition] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[OFFLINE] operator[SEP] operator[SEP] identifier[onExit] operator[SEP] Keyword[new] identifier[Action1] operator[<] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doIt] operator[SEP] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] identifier[transition] operator[SEP] {
identifier[Log] operator[SEP] identifier[v] operator[SEP] identifier[Log] operator[SEP] identifier[TAG_SYNC] , literal[String] operator[+] identifier[transition] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[transition] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] , identifier[ReplicationInternal] operator[SEP] Keyword[this] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[goOnline] operator[SEP] operator[SEP] operator[SEP] identifier[notifyChangeListenersStateTransition] operator[SEP] identifier[transition] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPING] operator[SEP] operator[SEP] identifier[onEntry] operator[SEP] Keyword[new] identifier[Action1] operator[<] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doIt] operator[SEP] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] identifier[transition] operator[SEP] {
identifier[Log] operator[SEP] identifier[v] operator[SEP] identifier[Log] operator[SEP] identifier[TAG_SYNC] , literal[String] operator[+] identifier[transition] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[transition] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] , identifier[ReplicationInternal] operator[SEP] Keyword[this] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[transition] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[==] identifier[transition] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[stop] operator[SEP] operator[SEP] operator[SEP] identifier[notifyChangeListenersStateTransition] operator[SEP] identifier[transition] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[configure] operator[SEP] identifier[ReplicationState] operator[SEP] identifier[STOPPED] operator[SEP] operator[SEP] identifier[onEntry] operator[SEP] Keyword[new] identifier[Action1] operator[<] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doIt] operator[SEP] identifier[Transition] operator[<] identifier[ReplicationState] , identifier[ReplicationTrigger] operator[>] identifier[transition] operator[SEP] {
identifier[Log] operator[SEP] identifier[v] operator[SEP] identifier[Log] operator[SEP] identifier[TAG_SYNC] , literal[String] operator[+] identifier[transition] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[transition] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] , identifier[ReplicationInternal] operator[SEP] Keyword[this] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[transition] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[==] identifier[transition] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[saveLastSequence] operator[SEP] operator[SEP] operator[SEP] identifier[stopNetworkReachabilityManager] operator[SEP] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[clearDbRef] operator[SEP] operator[SEP] operator[SEP] identifier[notifyChangeListenersStateTransition] operator[SEP] identifier[transition] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[executor] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[executor] operator[SEP] identifier[isShutdown] operator[SEP] operator[SEP] operator[SEP] {
identifier[executor] operator[SEP] identifier[shutdown] operator[SEP] operator[SEP] operator[SEP]
}
}
}
} operator[SEP] operator[SEP]
}
|
protected final void setParentNode(final DiffNode parentNode)
{
if (this.parentNode != null && this.parentNode != parentNode)
{
throw new IllegalStateException("The parent of a node cannot be changed, once it's set.");
}
this.parentNode = parentNode;
} | class class_name[name] begin[{]
method[setParentNode, return_type[void], modifier[final protected], parameter[parentNode]] begin[{]
if[binary_operation[binary_operation[THIS[member[None.parentNode]], !=, literal[null]], &&, binary_operation[THIS[member[None.parentNode]], !=, member[.parentNode]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The parent of a node cannot be changed, once it's set.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[THIS[member[None.parentNode]], member[.parentNode]]
end[}]
END[}] | Keyword[protected] Keyword[final] Keyword[void] identifier[setParentNode] operator[SEP] Keyword[final] identifier[DiffNode] identifier[parentNode] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[parentNode] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[parentNode] operator[!=] identifier[parentNode] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[parentNode] operator[=] identifier[parentNode] operator[SEP]
}
|
public FileInfo getFileInfo() throws IOException {
try {
load(false);
if (m_resource.isFile()) {
// Fill in a file information object for this file/directory
long flen = m_resource.getLength();
//long alloc = (flen + 512L) & 0xFFFFFFFFFFFFFE00L;
long alloc = flen;
int fattr = 0;
if (m_cms.getRequestContext().getCurrentProject().isOnlineProject()) {
fattr += FileAttribute.ReadOnly;
}
// Create the file information
FileInfo finfo = new FileInfo(m_resource.getName(), flen, fattr);
long fdate = m_resource.getDateLastModified();
finfo.setModifyDateTime(fdate);
finfo.setAllocationSize(alloc);
finfo.setFileId(m_resource.getStructureId().hashCode());
finfo.setCreationDateTime(m_resource.getDateCreated());
finfo.setChangeDateTime(fdate);
return finfo;
} else {
// Fill in a file information object for this directory
int fattr = FileAttribute.Directory;
if (m_cms.getRequestContext().getCurrentProject().isOnlineProject()) {
fattr += FileAttribute.ReadOnly;
}
// Can't use negative file size here, since this stops Windows 7 from connecting
FileInfo finfo = new FileInfo(m_resource.getName(), 1, fattr);
long fdate = m_resource.getDateLastModified();
finfo.setModifyDateTime(fdate);
finfo.setAllocationSize(1);
finfo.setFileId(m_resource.getStructureId().hashCode());
finfo.setCreationDateTime(m_resource.getDateCreated());
finfo.setChangeDateTime(fdate);
return finfo;
}
} catch (CmsException e) {
throw CmsJlanDiskInterface.convertCmsException(e);
}
} | class class_name[name] begin[{]
method[getFileInfo, return_type[type[FileInfo]], modifier[public], parameter[]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=load, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isFile, postfix_operators=[], prefix_operators=[], qualifier=m_resource, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=Directory, postfix_operators=[], prefix_operators=[], qualifier=FileAttribute, selectors=[]), name=fattr)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[], member=getRequestContext, postfix_operators=[], prefix_operators=[], qualifier=m_cms, selectors=[MethodInvocation(arguments=[], member=getCurrentProject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=isOnlineProject, 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=fattr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=ReadOnly, postfix_operators=[], prefix_operators=[], qualifier=FileAttribute, selectors=[])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=m_resource, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=fattr, 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=FileInfo, sub_type=None)), name=finfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileInfo, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDateLastModified, postfix_operators=[], prefix_operators=[], qualifier=m_resource, selectors=[], type_arguments=None), name=fdate)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fdate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setModifyDateTime, postfix_operators=[], prefix_operators=[], qualifier=finfo, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=setAllocationSize, postfix_operators=[], prefix_operators=[], qualifier=finfo, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStructureId, postfix_operators=[], prefix_operators=[], qualifier=m_resource, selectors=[MethodInvocation(arguments=[], member=hashCode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setFileId, postfix_operators=[], prefix_operators=[], qualifier=finfo, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDateCreated, postfix_operators=[], prefix_operators=[], qualifier=m_resource, selectors=[], type_arguments=None)], member=setCreationDateTime, postfix_operators=[], prefix_operators=[], qualifier=finfo, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fdate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setChangeDateTime, postfix_operators=[], prefix_operators=[], qualifier=finfo, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=finfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=m_resource, selectors=[], type_arguments=None), name=flen)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=flen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=alloc)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=fattr)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[], member=getRequestContext, postfix_operators=[], prefix_operators=[], qualifier=m_cms, selectors=[MethodInvocation(arguments=[], member=getCurrentProject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=isOnlineProject, 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=fattr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=ReadOnly, postfix_operators=[], prefix_operators=[], qualifier=FileAttribute, selectors=[])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=m_resource, selectors=[], type_arguments=None), MemberReference(member=flen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fattr, 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=FileInfo, sub_type=None)), name=finfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileInfo, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDateLastModified, postfix_operators=[], prefix_operators=[], qualifier=m_resource, selectors=[], type_arguments=None), name=fdate)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fdate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setModifyDateTime, postfix_operators=[], prefix_operators=[], qualifier=finfo, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=alloc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAllocationSize, postfix_operators=[], prefix_operators=[], qualifier=finfo, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStructureId, postfix_operators=[], prefix_operators=[], qualifier=m_resource, selectors=[MethodInvocation(arguments=[], member=hashCode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setFileId, postfix_operators=[], prefix_operators=[], qualifier=finfo, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDateCreated, postfix_operators=[], prefix_operators=[], qualifier=m_resource, selectors=[], type_arguments=None)], member=setCreationDateTime, postfix_operators=[], prefix_operators=[], qualifier=finfo, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fdate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setChangeDateTime, postfix_operators=[], prefix_operators=[], qualifier=finfo, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=finfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertCmsException, postfix_operators=[], prefix_operators=[], qualifier=CmsJlanDiskInterface, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[FileInfo] identifier[getFileInfo] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[try] {
identifier[load] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_resource] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP] {
Keyword[long] identifier[flen] operator[=] identifier[m_resource] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[alloc] operator[=] identifier[flen] operator[SEP] Keyword[int] identifier[fattr] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[m_cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentProject] operator[SEP] operator[SEP] operator[SEP] identifier[isOnlineProject] operator[SEP] operator[SEP] operator[SEP] {
identifier[fattr] operator[+=] identifier[FileAttribute] operator[SEP] identifier[ReadOnly] operator[SEP]
}
identifier[FileInfo] identifier[finfo] operator[=] Keyword[new] identifier[FileInfo] operator[SEP] identifier[m_resource] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[flen] , identifier[fattr] operator[SEP] operator[SEP] Keyword[long] identifier[fdate] operator[=] identifier[m_resource] operator[SEP] identifier[getDateLastModified] operator[SEP] operator[SEP] operator[SEP] identifier[finfo] operator[SEP] identifier[setModifyDateTime] operator[SEP] identifier[fdate] operator[SEP] operator[SEP] identifier[finfo] operator[SEP] identifier[setAllocationSize] operator[SEP] identifier[alloc] operator[SEP] operator[SEP] identifier[finfo] operator[SEP] identifier[setFileId] operator[SEP] identifier[m_resource] operator[SEP] identifier[getStructureId] operator[SEP] operator[SEP] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[finfo] operator[SEP] identifier[setCreationDateTime] operator[SEP] identifier[m_resource] operator[SEP] identifier[getDateCreated] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[finfo] operator[SEP] identifier[setChangeDateTime] operator[SEP] identifier[fdate] operator[SEP] operator[SEP] Keyword[return] identifier[finfo] operator[SEP]
}
Keyword[else] {
Keyword[int] identifier[fattr] operator[=] identifier[FileAttribute] operator[SEP] identifier[Directory] operator[SEP] Keyword[if] operator[SEP] identifier[m_cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentProject] operator[SEP] operator[SEP] operator[SEP] identifier[isOnlineProject] operator[SEP] operator[SEP] operator[SEP] {
identifier[fattr] operator[+=] identifier[FileAttribute] operator[SEP] identifier[ReadOnly] operator[SEP]
}
identifier[FileInfo] identifier[finfo] operator[=] Keyword[new] identifier[FileInfo] operator[SEP] identifier[m_resource] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , Other[1] , identifier[fattr] operator[SEP] operator[SEP] Keyword[long] identifier[fdate] operator[=] identifier[m_resource] operator[SEP] identifier[getDateLastModified] operator[SEP] operator[SEP] operator[SEP] identifier[finfo] operator[SEP] identifier[setModifyDateTime] operator[SEP] identifier[fdate] operator[SEP] operator[SEP] identifier[finfo] operator[SEP] identifier[setAllocationSize] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[finfo] operator[SEP] identifier[setFileId] operator[SEP] identifier[m_resource] operator[SEP] identifier[getStructureId] operator[SEP] operator[SEP] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[finfo] operator[SEP] identifier[setCreationDateTime] operator[SEP] identifier[m_resource] operator[SEP] identifier[getDateCreated] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[finfo] operator[SEP] identifier[setChangeDateTime] operator[SEP] identifier[fdate] operator[SEP] operator[SEP] Keyword[return] identifier[finfo] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] {
Keyword[throw] identifier[CmsJlanDiskInterface] operator[SEP] identifier[convertCmsException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
public void removeSearchIndex(I_CmsSearchIndex searchIndex) {
// shut down index to remove potential config files of Solr indexes
searchIndex.shutDown();
if (searchIndex instanceof CmsSolrIndex) {
CmsSolrIndex solrIndex = (CmsSolrIndex)searchIndex;
m_coreContainer.unload(solrIndex.getCoreName(), true, true, true);
}
m_indexes.remove(searchIndex);
initOfflineIndexes();
if (LOG.isInfoEnabled()) {
LOG.info(
Messages.get().getBundle().key(
Messages.LOG_REMOVE_SEARCH_INDEX_2,
searchIndex.getName(),
searchIndex.getProject()));
}
} | class class_name[name] begin[{]
method[removeSearchIndex, return_type[void], modifier[public], parameter[searchIndex]] begin[{]
call[searchIndex.shutDown, parameter[]]
if[binary_operation[member[.searchIndex], instanceof, type[CmsSolrIndex]]] begin[{]
local_variable[type[CmsSolrIndex], solrIndex]
call[m_coreContainer.unload, parameter[call[solrIndex.getCoreName, parameter[]], literal[true], literal[true], literal[true]]]
else begin[{]
None
end[}]
call[m_indexes.remove, parameter[member[.searchIndex]]]
call[.initOfflineIndexes, parameter[]]
if[call[LOG.isInfoEnabled, parameter[]]] begin[{]
call[LOG.info, parameter[call[Messages.get, parameter[]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[removeSearchIndex] operator[SEP] identifier[I_CmsSearchIndex] identifier[searchIndex] operator[SEP] {
identifier[searchIndex] operator[SEP] identifier[shutDown] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[searchIndex] Keyword[instanceof] identifier[CmsSolrIndex] operator[SEP] {
identifier[CmsSolrIndex] identifier[solrIndex] operator[=] operator[SEP] identifier[CmsSolrIndex] operator[SEP] identifier[searchIndex] operator[SEP] identifier[m_coreContainer] operator[SEP] identifier[unload] operator[SEP] identifier[solrIndex] operator[SEP] identifier[getCoreName] operator[SEP] operator[SEP] , literal[boolean] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP]
}
identifier[m_indexes] operator[SEP] identifier[remove] operator[SEP] identifier[searchIndex] operator[SEP] operator[SEP] identifier[initOfflineIndexes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_REMOVE_SEARCH_INDEX_2] , identifier[searchIndex] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[searchIndex] operator[SEP] identifier[getProject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public long longer(Node element, String path) throws XmlException {
String str;
str = string(element, path);
try {
return Long.parseLong(str);
} catch (NumberFormatException e) {
throw new XmlException("number expected node " + path + ": " + str);
}
} | class class_name[name] begin[{]
method[longer, return_type[type[long]], modifier[public], parameter[element, path]] begin[{]
local_variable[type[String], str]
assign[member[.str], call[.string, parameter[member[.element], member[.path]]]]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="number expected node "), operandr=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MemberReference(member=str, 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=XmlException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[long] identifier[longer] operator[SEP] identifier[Node] identifier[element] , identifier[String] identifier[path] operator[SEP] Keyword[throws] identifier[XmlException] {
identifier[String] identifier[str] operator[SEP] identifier[str] operator[=] identifier[string] operator[SEP] identifier[element] , identifier[path] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[str] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[XmlException] operator[SEP] literal[String] operator[+] identifier[path] operator[+] literal[String] operator[+] identifier[str] operator[SEP] operator[SEP]
}
}
|
public static String feature2Dxf( FeatureMate featureMate, String layerName, String elevationAttrName, boolean suffix,
boolean force2CoordsToLine ) {
Geometry g = featureMate.getGeometry();
if (EGeometryType.isPoint(g)) {
return point2Dxf(featureMate, layerName, elevationAttrName);
} else if (EGeometryType.isLine(g)) {
return lineString2Dxf(featureMate, layerName, elevationAttrName, force2CoordsToLine);
} else if (EGeometryType.isPolygon(g)) {
return polygon2Dxf(featureMate, layerName, elevationAttrName, suffix);
} else if (g instanceof GeometryCollection) {
StringBuilder sb = new StringBuilder();
for( int i = 0; i < g.getNumGeometries(); i++ ) {
SimpleFeature ff = SimpleFeatureBuilder.copy(featureMate.getFeature());
ff.setDefaultGeometry(g.getGeometryN(i));
FeatureMate fm = new FeatureMate(ff);
sb.append(feature2Dxf(fm, layerName, elevationAttrName, suffix, force2CoordsToLine));
}
return sb.toString();
} else {
return null;
}
} | class class_name[name] begin[{]
method[feature2Dxf, return_type[type[String]], modifier[public static], parameter[featureMate, layerName, elevationAttrName, suffix, force2CoordsToLine]] begin[{]
local_variable[type[Geometry], g]
if[call[EGeometryType.isPoint, parameter[member[.g]]]] begin[{]
return[call[.point2Dxf, parameter[member[.featureMate], member[.layerName], member[.elevationAttrName]]]]
else begin[{]
if[call[EGeometryType.isLine, parameter[member[.g]]]] begin[{]
return[call[.lineString2Dxf, parameter[member[.featureMate], member[.layerName], member[.elevationAttrName], member[.force2CoordsToLine]]]]
else begin[{]
if[call[EGeometryType.isPolygon, parameter[member[.g]]]] begin[{]
return[call[.polygon2Dxf, parameter[member[.featureMate], member[.layerName], member[.elevationAttrName], member[.suffix]]]]
else begin[{]
if[binary_operation[member[.g], instanceof, type[GeometryCollection]]] begin[{]
local_variable[type[StringBuilder], sb]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFeature, postfix_operators=[], prefix_operators=[], qualifier=featureMate, selectors=[], type_arguments=None)], member=copy, postfix_operators=[], prefix_operators=[], qualifier=SimpleFeatureBuilder, selectors=[], type_arguments=None), name=ff)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SimpleFeature, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getGeometryN, postfix_operators=[], prefix_operators=[], qualifier=g, selectors=[], type_arguments=None)], member=setDefaultGeometry, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=ff, 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=FeatureMate, sub_type=None)), name=fm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FeatureMate, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=fm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=layerName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=elevationAttrName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=suffix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=force2CoordsToLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=feature2Dxf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], 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=MethodInvocation(arguments=[], member=getNumGeometries, postfix_operators=[], prefix_operators=[], qualifier=g, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[call[sb.toString, parameter[]]]
else begin[{]
return[literal[null]]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[feature2Dxf] operator[SEP] identifier[FeatureMate] identifier[featureMate] , identifier[String] identifier[layerName] , identifier[String] identifier[elevationAttrName] , Keyword[boolean] identifier[suffix] , Keyword[boolean] identifier[force2CoordsToLine] operator[SEP] {
identifier[Geometry] identifier[g] operator[=] identifier[featureMate] operator[SEP] identifier[getGeometry] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[EGeometryType] operator[SEP] identifier[isPoint] operator[SEP] identifier[g] operator[SEP] operator[SEP] {
Keyword[return] identifier[point2Dxf] operator[SEP] identifier[featureMate] , identifier[layerName] , identifier[elevationAttrName] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[EGeometryType] operator[SEP] identifier[isLine] operator[SEP] identifier[g] operator[SEP] operator[SEP] {
Keyword[return] identifier[lineString2Dxf] operator[SEP] identifier[featureMate] , identifier[layerName] , identifier[elevationAttrName] , identifier[force2CoordsToLine] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[EGeometryType] operator[SEP] identifier[isPolygon] operator[SEP] identifier[g] operator[SEP] operator[SEP] {
Keyword[return] identifier[polygon2Dxf] operator[SEP] identifier[featureMate] , identifier[layerName] , identifier[elevationAttrName] , identifier[suffix] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[g] Keyword[instanceof] identifier[GeometryCollection] 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[g] operator[SEP] identifier[getNumGeometries] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[SimpleFeature] identifier[ff] operator[=] identifier[SimpleFeatureBuilder] operator[SEP] identifier[copy] operator[SEP] identifier[featureMate] operator[SEP] identifier[getFeature] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ff] operator[SEP] identifier[setDefaultGeometry] operator[SEP] identifier[g] operator[SEP] identifier[getGeometryN] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[FeatureMate] identifier[fm] operator[=] Keyword[new] identifier[FeatureMate] operator[SEP] identifier[ff] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[feature2Dxf] operator[SEP] identifier[fm] , identifier[layerName] , identifier[elevationAttrName] , identifier[suffix] , identifier[force2CoordsToLine] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] Other[null] operator[SEP]
}
}
|
public Vector4i zero() {
Vector4i dest = thisOrNew();
MemUtil.INSTANCE.zero(dest);
return dest;
} | class class_name[name] begin[{]
method[zero, return_type[type[Vector4i]], modifier[public], parameter[]] begin[{]
local_variable[type[Vector4i], dest]
call[MemUtil.INSTANCE.zero, parameter[member[.dest]]]
return[member[.dest]]
end[}]
END[}] | Keyword[public] identifier[Vector4i] identifier[zero] operator[SEP] operator[SEP] {
identifier[Vector4i] identifier[dest] operator[=] identifier[thisOrNew] operator[SEP] operator[SEP] operator[SEP] identifier[MemUtil] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[zero] operator[SEP] identifier[dest] operator[SEP] operator[SEP] Keyword[return] identifier[dest] operator[SEP]
}
|
@Override
protected boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect) {
// convert from forward / backward notation to up / down / left / right
// (ugh).
if (direction == View.FOCUS_FORWARD) {
direction = View.FOCUS_DOWN;
} else if (direction == View.FOCUS_BACKWARD) {
direction = View.FOCUS_UP;
}
final View nextFocus = previouslyFocusedRect == null ?
FocusFinder.getInstance().findNextFocus(this, null, direction) :
FocusFinder.getInstance().findNextFocusFromRect(this,
previouslyFocusedRect, direction);
if (nextFocus == null) {
return false;
}
return nextFocus.requestFocus(direction, previouslyFocusedRect);
} | class class_name[name] begin[{]
method[onRequestFocusInDescendants, return_type[type[boolean]], modifier[protected], parameter[direction, previouslyFocusedRect]] begin[{]
if[binary_operation[member[.direction], ==, member[View.FOCUS_FORWARD]]] begin[{]
assign[member[.direction], member[View.FOCUS_DOWN]]
else begin[{]
if[binary_operation[member[.direction], ==, member[View.FOCUS_BACKWARD]]] begin[{]
assign[member[.direction], member[View.FOCUS_UP]]
else begin[{]
None
end[}]
end[}]
local_variable[type[View], nextFocus]
if[binary_operation[member[.nextFocus], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
return[call[nextFocus.requestFocus, parameter[member[.direction], member[.previouslyFocusedRect]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[boolean] identifier[onRequestFocusInDescendants] operator[SEP] Keyword[int] identifier[direction] , identifier[Rect] identifier[previouslyFocusedRect] operator[SEP] {
Keyword[if] operator[SEP] identifier[direction] operator[==] identifier[View] operator[SEP] identifier[FOCUS_FORWARD] operator[SEP] {
identifier[direction] operator[=] identifier[View] operator[SEP] identifier[FOCUS_DOWN] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[direction] operator[==] identifier[View] operator[SEP] identifier[FOCUS_BACKWARD] operator[SEP] {
identifier[direction] operator[=] identifier[View] operator[SEP] identifier[FOCUS_UP] operator[SEP]
}
Keyword[final] identifier[View] identifier[nextFocus] operator[=] identifier[previouslyFocusedRect] operator[==] Other[null] operator[?] identifier[FocusFinder] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[findNextFocus] operator[SEP] Keyword[this] , Other[null] , identifier[direction] operator[SEP] operator[:] identifier[FocusFinder] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[findNextFocusFromRect] operator[SEP] Keyword[this] , identifier[previouslyFocusedRect] , identifier[direction] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextFocus] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] identifier[nextFocus] operator[SEP] identifier[requestFocus] operator[SEP] identifier[direction] , identifier[previouslyFocusedRect] operator[SEP] operator[SEP]
}
|
public <T> T safeGet(String fieldName){
try {
return get(fieldName);
} catch (Exception e) {
return null;
}
} | class class_name[name] begin[{]
method[safeGet, return_type[type[T]], modifier[public], parameter[fieldName]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=, 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=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[safeGet] operator[SEP] identifier[String] identifier[fieldName] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[get] operator[SEP] identifier[fieldName] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
}
|
public void createResource(final InputStream inputStream, final String resourceName)
throws JaxRxException {
synchronized (resourceName) {
if (inputStream == null) {
throw new JaxRxException(400, "Bad user request");
} else {
try {
shred(inputStream, resourceName);
} catch (final TTException exce) {
throw new JaxRxException(exce);
}
}
}
} | class class_name[name] begin[{]
method[createResource, return_type[void], modifier[public], parameter[inputStream, resourceName]] begin[{]
SYNCHRONIZED[member[.resourceName]] BEGIN[{]
if[binary_operation[member[.inputStream], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=400), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Bad user request")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JaxRxException, sub_type=None)), label=None)
else begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=shred, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=exce, 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=JaxRxException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exce, types=['TTException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[createResource] operator[SEP] Keyword[final] identifier[InputStream] identifier[inputStream] , Keyword[final] identifier[String] identifier[resourceName] operator[SEP] Keyword[throws] identifier[JaxRxException] {
Keyword[synchronized] operator[SEP] identifier[resourceName] operator[SEP] {
Keyword[if] operator[SEP] identifier[inputStream] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[JaxRxException] operator[SEP] Other[400] , literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[try] {
identifier[shred] operator[SEP] identifier[inputStream] , identifier[resourceName] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[TTException] identifier[exce] operator[SEP] {
Keyword[throw] Keyword[new] identifier[JaxRxException] operator[SEP] identifier[exce] operator[SEP] operator[SEP]
}
}
}
}
|
long getInitialDelay(long stepSize) {
long now = clock().wallTime();
long stepBoundary = now / stepSize * stepSize;
// Buffer by 10% of the step interval on either side
long offset = stepSize / 10;
// Check if the current delay is within the acceptable range
long delay = now - stepBoundary;
if (delay < offset) {
return delay + offset;
} else if (delay > stepSize - offset) {
return stepSize - offset;
} else {
return delay;
}
} | class class_name[name] begin[{]
method[getInitialDelay, return_type[type[long]], modifier[default], parameter[stepSize]] begin[{]
local_variable[type[long], now]
local_variable[type[long], stepBoundary]
local_variable[type[long], offset]
local_variable[type[long], delay]
if[binary_operation[member[.delay], <, member[.offset]]] begin[{]
return[binary_operation[member[.delay], +, member[.offset]]]
else begin[{]
if[binary_operation[member[.delay], >, binary_operation[member[.stepSize], -, member[.offset]]]] begin[{]
return[binary_operation[member[.stepSize], -, member[.offset]]]
else begin[{]
return[member[.delay]]
end[}]
end[}]
end[}]
END[}] | Keyword[long] identifier[getInitialDelay] operator[SEP] Keyword[long] identifier[stepSize] operator[SEP] {
Keyword[long] identifier[now] operator[=] identifier[clock] operator[SEP] operator[SEP] operator[SEP] identifier[wallTime] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[stepBoundary] operator[=] identifier[now] operator[/] identifier[stepSize] operator[*] identifier[stepSize] operator[SEP] Keyword[long] identifier[offset] operator[=] identifier[stepSize] operator[/] Other[10] operator[SEP] Keyword[long] identifier[delay] operator[=] identifier[now] operator[-] identifier[stepBoundary] operator[SEP] Keyword[if] operator[SEP] identifier[delay] operator[<] identifier[offset] operator[SEP] {
Keyword[return] identifier[delay] operator[+] identifier[offset] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[delay] operator[>] identifier[stepSize] operator[-] identifier[offset] operator[SEP] {
Keyword[return] identifier[stepSize] operator[-] identifier[offset] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[delay] operator[SEP]
}
}
|
public ConsulResponse<List<ServiceHealth>> getHealthyServicesByDatacenterAndTag(final String serviceName,
final String datacenter,
final String tag) {
return getHealthyServices(serviceName, datacenter, tag, RequestOptions.BLANK);
} | class class_name[name] begin[{]
method[getHealthyServicesByDatacenterAndTag, return_type[type[ConsulResponse]], modifier[public], parameter[serviceName, datacenter, tag]] begin[{]
return[call[.getHealthyServices, parameter[member[.serviceName], member[.datacenter], member[.tag], member[RequestOptions.BLANK]]]]
end[}]
END[}] | Keyword[public] identifier[ConsulResponse] operator[<] identifier[List] operator[<] identifier[ServiceHealth] operator[>] operator[>] identifier[getHealthyServicesByDatacenterAndTag] operator[SEP] Keyword[final] identifier[String] identifier[serviceName] , Keyword[final] identifier[String] identifier[datacenter] , Keyword[final] identifier[String] identifier[tag] operator[SEP] {
Keyword[return] identifier[getHealthyServices] operator[SEP] identifier[serviceName] , identifier[datacenter] , identifier[tag] , identifier[RequestOptions] operator[SEP] identifier[BLANK] operator[SEP] operator[SEP]
}
|
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "mean")
public JAXBElement<MeanType> createMean(MeanType value) {
return new JAXBElement<MeanType>(_Mean_QNAME, MeanType.class, null, value);
} | class class_name[name] begin[{]
method[createMean, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=_Mean_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MeanType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=MeanType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[MeanType] operator[>] identifier[createMean] operator[SEP] identifier[MeanType] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[MeanType] operator[>] operator[SEP] identifier[_Mean_QNAME] , identifier[MeanType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP]
}
|
@Override
protected void onRemovedInternal() {
final List<AnalyzerChangeListener> listeners = getAllListeners();
for (final AnalyzerChangeListener listener : listeners) {
listener.onRemove(this);
}
} | class class_name[name] begin[{]
method[onRemovedInternal, return_type[void], modifier[protected], parameter[]] begin[{]
local_variable[type[List], listeners]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=onRemove, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=listeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=listener)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=AnalyzerChangeListener, sub_type=None))), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[onRemovedInternal] operator[SEP] operator[SEP] {
Keyword[final] identifier[List] operator[<] identifier[AnalyzerChangeListener] operator[>] identifier[listeners] operator[=] identifier[getAllListeners] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[AnalyzerChangeListener] identifier[listener] operator[:] identifier[listeners] operator[SEP] {
identifier[listener] operator[SEP] identifier[onRemove] operator[SEP] Keyword[this] operator[SEP] operator[SEP]
}
}
|
static void clearPartnerLevel() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "clearPartnerLevel");
partnerLevel.set(null);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "clearPartnerLevel");
} | class class_name[name] begin[{]
method[clearPartnerLevel, return_type[void], modifier[static], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["clearPartnerLevel"]]]
else begin[{]
None
end[}]
call[partnerLevel.set, parameter[literal[null]]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["clearPartnerLevel"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[static] Keyword[void] identifier[clearPartnerLevel] 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[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[partnerLevel] operator[SEP] identifier[set] operator[SEP] Other[null] 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 int append(ReadableByteChannel channel) throws IOException {
assert invariant(true);
int totalRead = 0;
try {
boolean done;
// precondition: the channel has data
do {
ByteBuffer dest = writableBuf();
int space = dest.remaining();
assert space > 0;
int read = channel.read(dest);
if (read >= 0) {
totalRead += read;
} else {
// end of stream (e.g. the other end closed the connection)
removeLastBufferIfEmpty();
sizeChanged();
assert invariant(true);
return -1;
}
// if buffer wasn't filled -> no data is available in channel
done = read < space;
} while (!done);
} finally {
removeLastBufferIfEmpty();
sizeChanged();
assert invariant(true);
}
return totalRead;
} | class class_name[name] begin[{]
method[append, return_type[type[int]], modifier[public], parameter[channel]] begin[{]
AssertStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=invariant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None, value=None)
local_variable[type[int], totalRead]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=done)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), DoStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=writableBuf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=dest)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteBuffer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=remaining, postfix_operators=[], prefix_operators=[], qualifier=dest, selectors=[], type_arguments=None), name=space)], modifiers=set(), type=BasicType(dimensions=[], name=int)), AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=space, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None, value=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=channel, selectors=[], type_arguments=None), name=read)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=removeLastBufferIfEmpty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=sizeChanged, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), AssertStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=invariant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None, value=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=totalRead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=done, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=space, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<)), label=None)]), condition=MemberReference(member=done, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=removeLastBufferIfEmpty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=sizeChanged, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), AssertStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=invariant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None, value=None)], label=None, resources=None)
return[member[.totalRead]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[append] operator[SEP] identifier[ReadableByteChannel] identifier[channel] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[assert] identifier[invariant] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[int] identifier[totalRead] operator[=] Other[0] operator[SEP] Keyword[try] {
Keyword[boolean] identifier[done] operator[SEP] Keyword[do] {
identifier[ByteBuffer] identifier[dest] operator[=] identifier[writableBuf] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[space] operator[=] identifier[dest] operator[SEP] identifier[remaining] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] identifier[space] operator[>] Other[0] operator[SEP] Keyword[int] identifier[read] operator[=] identifier[channel] operator[SEP] identifier[read] operator[SEP] identifier[dest] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[read] operator[>=] Other[0] operator[SEP] {
identifier[totalRead] operator[+=] identifier[read] operator[SEP]
}
Keyword[else] {
identifier[removeLastBufferIfEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[sizeChanged] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] identifier[invariant] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP]
}
identifier[done] operator[=] identifier[read] operator[<] identifier[space] operator[SEP]
}
Keyword[while] operator[SEP] operator[!] identifier[done] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[removeLastBufferIfEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[sizeChanged] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] identifier[invariant] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[return] identifier[totalRead] operator[SEP]
}
|
void loadVertexIndices(GraphTraversalSource traversalSource, Vertex schemaVertex) {
List<Path> indices = traversalSource
.V(schemaVertex)
.out(SQLG_SCHEMA_SCHEMA_VERTEX_EDGE).as("vertex")
.out(SQLG_SCHEMA_VERTEX_INDEX_EDGE).as("index")
.outE(SQLG_SCHEMA_INDEX_PROPERTY_EDGE)
.order().by(SQLG_SCHEMA_INDEX_PROPERTY_EDGE_SEQUENCE)
.inV().as("property")
.path()
.toList();
for (Path vertexIndices : indices) {
Vertex vertexVertex = null;
Vertex vertexIndex = null;
Vertex propertyIndex = null;
List<Set<String>> labelsList = vertexIndices.labels();
for (Set<String> labels : labelsList) {
for (String label : labels) {
switch (label) {
case "vertex":
vertexVertex = vertexIndices.get("vertex");
break;
case "index":
vertexIndex = vertexIndices.get("index");
break;
case "property":
propertyIndex = vertexIndices.get("property");
break;
case BaseStrategy.SQLG_PATH_FAKE_LABEL:
case BaseStrategy.SQLG_PATH_ORDER_RANGE_LABEL:
case Schema.MARKER:
break;
default:
throw new IllegalStateException(String.format("BUG: Only \"vertex\",\"index\" and \"property\" is expected as a label. Found %s", label));
}
}
}
Preconditions.checkState(vertexVertex != null, "BUG: Topology vertex not found.");
String schemaName = schemaVertex.value(SQLG_SCHEMA_SCHEMA_NAME);
String tableName = vertexVertex.value(SQLG_SCHEMA_VERTEX_LABEL_NAME);
VertexLabel vertexLabel = this.vertexLabels.get(schemaName + "." + VERTEX_PREFIX + tableName);
if (vertexLabel == null) {
vertexLabel = new VertexLabel(this, tableName);
this.vertexLabels.put(schemaName + "." + VERTEX_PREFIX + tableName, vertexLabel);
}
if (vertexIndex != null) {
String indexName = vertexIndex.value(SQLG_SCHEMA_INDEX_NAME);
Optional<Index> oidx = vertexLabel.getIndex(indexName);
Index idx;
if (oidx.isPresent()) {
idx = oidx.get();
} else {
idx = new Index(indexName, IndexType.fromString(vertexIndex.value(SQLG_SCHEMA_INDEX_INDEX_TYPE)), vertexLabel);
vertexLabel.addIndex(idx);
}
if (propertyIndex != null) {
String propertyName = propertyIndex.value(SQLG_SCHEMA_PROPERTY_NAME);
vertexLabel.getProperty(propertyName).ifPresent((PropertyColumn pc) -> idx.addProperty(pc));
}
}
}
} | class class_name[name] begin[{]
method[loadVertexIndices, return_type[void], modifier[default], parameter[traversalSource, schemaVertex]] begin[{]
local_variable[type[List], indices]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=vertexVertex)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Vertex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=vertexIndex)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Vertex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=propertyIndex)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Vertex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=labels, postfix_operators=[], prefix_operators=[], qualifier=vertexIndices, selectors=[], type_arguments=None), name=labelsList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="vertex")], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=vertexVertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="vertex")], member=get, postfix_operators=[], prefix_operators=[], qualifier=vertexIndices, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="index")], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=vertexIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="index")], member=get, postfix_operators=[], prefix_operators=[], qualifier=vertexIndices, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="property")], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=propertyIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="property")], member=get, postfix_operators=[], prefix_operators=[], qualifier=vertexIndices, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=SQLG_PATH_FAKE_LABEL, postfix_operators=[], prefix_operators=[], qualifier=BaseStrategy, selectors=[]), MemberReference(member=SQLG_PATH_ORDER_RANGE_LABEL, postfix_operators=[], prefix_operators=[], qualifier=BaseStrategy, selectors=[]), MemberReference(member=MARKER, postfix_operators=[], prefix_operators=[], qualifier=Schema, selectors=[])], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="BUG: Only \"vertex\",\"index\" and \"property\" is expected as a label. Found %s"), MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)])], expression=MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=labels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=label)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=labelsList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=labels)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=vertexVertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="BUG: Topology vertex not found.")], member=checkState, postfix_operators=[], prefix_operators=[], qualifier=Preconditions, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=SQLG_SCHEMA_SCHEMA_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=value, postfix_operators=[], prefix_operators=[], qualifier=schemaVertex, selectors=[], type_arguments=None), name=schemaName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=SQLG_SCHEMA_VERTEX_LABEL_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=value, postfix_operators=[], prefix_operators=[], qualifier=vertexVertex, selectors=[], type_arguments=None), name=tableName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=vertexLabels, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=schemaName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=VERTEX_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=vertexLabel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VertexLabel, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=vertexLabel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=vertexLabel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tableName, 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=VertexLabel, sub_type=None))), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=vertexLabels, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=schemaName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=VERTEX_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=vertexLabel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=vertexIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=SQLG_SCHEMA_INDEX_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=value, postfix_operators=[], prefix_operators=[], qualifier=vertexIndex, selectors=[], type_arguments=None), name=indexName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=indexName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=vertexLabel, selectors=[], type_arguments=None), name=oidx)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Index, sub_type=None))], dimensions=[], name=Optional, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=idx)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Index, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isPresent, postfix_operators=[], prefix_operators=[], qualifier=oidx, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=indexName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=SQLG_SCHEMA_INDEX_INDEX_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=value, postfix_operators=[], prefix_operators=[], qualifier=vertexIndex, selectors=[], type_arguments=None)], member=fromString, postfix_operators=[], prefix_operators=[], qualifier=IndexType, selectors=[], type_arguments=None), MemberReference(member=vertexLabel, 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=Index, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addIndex, postfix_operators=[], prefix_operators=[], qualifier=vertexLabel, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=oidx, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=propertyIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=SQLG_SCHEMA_PROPERTY_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=value, postfix_operators=[], prefix_operators=[], qualifier=propertyIndex, selectors=[], type_arguments=None), name=propertyName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=vertexLabel, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=pc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addProperty, postfix_operators=[], prefix_operators=[], qualifier=idx, selectors=[], type_arguments=None), parameters=[FormalParameter(annotations=[], modifiers=set(), name=pc, type=ReferenceType(arguments=None, dimensions=[], name=PropertyColumn, sub_type=None), varargs=False)])], member=ifPresent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=vertexIndices)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None))), label=None)
end[}]
END[}] | Keyword[void] identifier[loadVertexIndices] operator[SEP] identifier[GraphTraversalSource] identifier[traversalSource] , identifier[Vertex] identifier[schemaVertex] operator[SEP] {
identifier[List] operator[<] identifier[Path] operator[>] identifier[indices] operator[=] identifier[traversalSource] operator[SEP] identifier[V] operator[SEP] identifier[schemaVertex] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[SQLG_SCHEMA_SCHEMA_VERTEX_EDGE] operator[SEP] operator[SEP] identifier[as] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[SQLG_SCHEMA_VERTEX_INDEX_EDGE] operator[SEP] operator[SEP] identifier[as] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[outE] operator[SEP] identifier[SQLG_SCHEMA_INDEX_PROPERTY_EDGE] operator[SEP] operator[SEP] identifier[order] operator[SEP] operator[SEP] operator[SEP] identifier[by] operator[SEP] identifier[SQLG_SCHEMA_INDEX_PROPERTY_EDGE_SEQUENCE] operator[SEP] operator[SEP] identifier[inV] operator[SEP] operator[SEP] operator[SEP] identifier[as] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Path] identifier[vertexIndices] operator[:] identifier[indices] operator[SEP] {
identifier[Vertex] identifier[vertexVertex] operator[=] Other[null] operator[SEP] identifier[Vertex] identifier[vertexIndex] operator[=] Other[null] operator[SEP] identifier[Vertex] identifier[propertyIndex] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[labelsList] operator[=] identifier[vertexIndices] operator[SEP] identifier[labels] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[labels] operator[:] identifier[labelsList] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[label] operator[:] identifier[labels] operator[SEP] {
Keyword[switch] operator[SEP] identifier[label] operator[SEP] {
Keyword[case] literal[String] operator[:] identifier[vertexVertex] operator[=] identifier[vertexIndices] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[vertexIndex] operator[=] identifier[vertexIndices] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[propertyIndex] operator[=] identifier[vertexIndices] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[BaseStrategy] operator[SEP] identifier[SQLG_PATH_FAKE_LABEL] operator[:] Keyword[case] identifier[BaseStrategy] operator[SEP] identifier[SQLG_PATH_ORDER_RANGE_LABEL] operator[:] Keyword[case] identifier[Schema] operator[SEP] identifier[MARKER] operator[:] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[label] operator[SEP] operator[SEP] operator[SEP]
}
}
}
identifier[Preconditions] operator[SEP] identifier[checkState] operator[SEP] identifier[vertexVertex] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[schemaName] operator[=] identifier[schemaVertex] operator[SEP] identifier[value] operator[SEP] identifier[SQLG_SCHEMA_SCHEMA_NAME] operator[SEP] operator[SEP] identifier[String] identifier[tableName] operator[=] identifier[vertexVertex] operator[SEP] identifier[value] operator[SEP] identifier[SQLG_SCHEMA_VERTEX_LABEL_NAME] operator[SEP] operator[SEP] identifier[VertexLabel] identifier[vertexLabel] operator[=] Keyword[this] operator[SEP] identifier[vertexLabels] operator[SEP] identifier[get] operator[SEP] identifier[schemaName] operator[+] literal[String] operator[+] identifier[VERTEX_PREFIX] operator[+] identifier[tableName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vertexLabel] operator[==] Other[null] operator[SEP] {
identifier[vertexLabel] operator[=] Keyword[new] identifier[VertexLabel] operator[SEP] Keyword[this] , identifier[tableName] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[vertexLabels] operator[SEP] identifier[put] operator[SEP] identifier[schemaName] operator[+] literal[String] operator[+] identifier[VERTEX_PREFIX] operator[+] identifier[tableName] , identifier[vertexLabel] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[vertexIndex] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[indexName] operator[=] identifier[vertexIndex] operator[SEP] identifier[value] operator[SEP] identifier[SQLG_SCHEMA_INDEX_NAME] operator[SEP] operator[SEP] identifier[Optional] operator[<] identifier[Index] operator[>] identifier[oidx] operator[=] identifier[vertexLabel] operator[SEP] identifier[getIndex] operator[SEP] identifier[indexName] operator[SEP] operator[SEP] identifier[Index] identifier[idx] operator[SEP] Keyword[if] operator[SEP] identifier[oidx] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
identifier[idx] operator[=] identifier[oidx] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[idx] operator[=] Keyword[new] identifier[Index] operator[SEP] identifier[indexName] , identifier[IndexType] operator[SEP] identifier[fromString] operator[SEP] identifier[vertexIndex] operator[SEP] identifier[value] operator[SEP] identifier[SQLG_SCHEMA_INDEX_INDEX_TYPE] operator[SEP] operator[SEP] , identifier[vertexLabel] operator[SEP] operator[SEP] identifier[vertexLabel] operator[SEP] identifier[addIndex] operator[SEP] identifier[idx] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[propertyIndex] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[propertyName] operator[=] identifier[propertyIndex] operator[SEP] identifier[value] operator[SEP] identifier[SQLG_SCHEMA_PROPERTY_NAME] operator[SEP] operator[SEP] identifier[vertexLabel] operator[SEP] identifier[getProperty] operator[SEP] identifier[propertyName] operator[SEP] operator[SEP] identifier[ifPresent] operator[SEP] operator[SEP] identifier[PropertyColumn] identifier[pc] operator[SEP] operator[->] identifier[idx] operator[SEP] identifier[addProperty] operator[SEP] identifier[pc] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
|
protected @Nonnull List<BeanDefinitionReference> resolveBeanDefinitionReferences() {
final SoftServiceLoader<BeanDefinitionReference> definitions = SoftServiceLoader.load(BeanDefinitionReference.class, classLoader);
List<BeanDefinitionReference> list = new ArrayList<>(300);
for (ServiceDefinition<BeanDefinitionReference> definition : definitions) {
if (definition.isPresent()) {
final BeanDefinitionReference ref = definition.load();
list.add(ref);
}
}
return list;
} | class class_name[name] begin[{]
method[resolveBeanDefinitionReferences, return_type[type[List]], modifier[protected], parameter[]] begin[{]
local_variable[type[SoftServiceLoader], definitions]
local_variable[type[List], list]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isPresent, postfix_operators=[], prefix_operators=[], qualifier=definition, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=load, postfix_operators=[], prefix_operators=[], qualifier=definition, selectors=[], type_arguments=None), name=ref)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=BeanDefinitionReference, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=definitions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=definition)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BeanDefinitionReference, sub_type=None))], dimensions=[], name=ServiceDefinition, sub_type=None))), label=None)
return[member[.list]]
end[}]
END[}] | Keyword[protected] annotation[@] identifier[Nonnull] identifier[List] operator[<] identifier[BeanDefinitionReference] operator[>] identifier[resolveBeanDefinitionReferences] operator[SEP] operator[SEP] {
Keyword[final] identifier[SoftServiceLoader] operator[<] identifier[BeanDefinitionReference] operator[>] identifier[definitions] operator[=] identifier[SoftServiceLoader] operator[SEP] identifier[load] operator[SEP] identifier[BeanDefinitionReference] operator[SEP] Keyword[class] , identifier[classLoader] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[BeanDefinitionReference] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Other[300] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ServiceDefinition] operator[<] identifier[BeanDefinitionReference] operator[>] identifier[definition] operator[:] identifier[definitions] operator[SEP] {
Keyword[if] operator[SEP] identifier[definition] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[BeanDefinitionReference] identifier[ref] operator[=] identifier[definition] operator[SEP] identifier[load] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[ref] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[list] operator[SEP]
}
|
private static String createSecureRandom() {
try {
final String no = "" + SECURE_RANDOM.nextInt();
final MessageDigest md = MessageDigest.getInstance("SHA-1");
final byte[] digest = md.digest(no.getBytes());
return encodeBase64(digest);
} catch (final NoSuchAlgorithmException ex) {
throw new RuntimeException(ex);
}
} | class class_name[name] begin[{]
method[createSecureRandom, return_type[type[String]], modifier[private static], parameter[]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MethodInvocation(arguments=[], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=SECURE_RANDOM, selectors=[], type_arguments=None), operator=+), name=no)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SHA-1")], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=MessageDigest, selectors=[], type_arguments=None), name=md)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=MessageDigest, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=no, selectors=[], type_arguments=None)], member=digest, postfix_operators=[], prefix_operators=[], qualifier=md, selectors=[], type_arguments=None), name=digest)], modifiers={'final'}, type=BasicType(dimensions=[None], name=byte)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=digest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encodeBase64, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NoSuchAlgorithmException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] identifier[createSecureRandom] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[final] identifier[String] identifier[no] operator[=] literal[String] operator[+] identifier[SECURE_RANDOM] operator[SEP] identifier[nextInt] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[MessageDigest] identifier[md] operator[=] identifier[MessageDigest] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[digest] operator[=] identifier[md] operator[SEP] identifier[digest] operator[SEP] identifier[no] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[encodeBase64] operator[SEP] identifier[digest] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[NoSuchAlgorithmException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[ex] operator[SEP] operator[SEP]
}
}
|
public Content getMarkerAnchor(String anchorName, Content anchorContent) {
if (anchorContent == null)
anchorContent = new Comment(" ");
Content markerAnchor = HtmlTree.A(configuration.htmlVersion, anchorName, anchorContent);
return markerAnchor;
} | class class_name[name] begin[{]
method[getMarkerAnchor, return_type[type[Content]], modifier[public], parameter[anchorName, anchorContent]] begin[{]
if[binary_operation[member[.anchorContent], ==, literal[null]]] begin[{]
assign[member[.anchorContent], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Comment, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[Content], markerAnchor]
return[member[.markerAnchor]]
end[}]
END[}] | Keyword[public] identifier[Content] identifier[getMarkerAnchor] operator[SEP] identifier[String] identifier[anchorName] , identifier[Content] identifier[anchorContent] operator[SEP] {
Keyword[if] operator[SEP] identifier[anchorContent] operator[==] Other[null] operator[SEP] identifier[anchorContent] operator[=] Keyword[new] identifier[Comment] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Content] identifier[markerAnchor] operator[=] identifier[HtmlTree] operator[SEP] identifier[A] operator[SEP] identifier[configuration] operator[SEP] identifier[htmlVersion] , identifier[anchorName] , identifier[anchorContent] operator[SEP] operator[SEP] Keyword[return] identifier[markerAnchor] operator[SEP]
}
|
protected synchronized long popFirstAvailableHole(final int iRecordSize) throws IOException {
if (maxHoleSize > -1 && iRecordSize + ODataLocal.RECORD_FIX_SIZE + 50 > maxHoleSize)
// DON'T BROWSE: NO ONE HOLE WITH THIS SIZE IS AVAILABLE
return -1;
final long timer = OProfiler.getInstance().startChrono();
if (!availableHolesBySize.isEmpty()) {
cursor.size = iRecordSize;
// SEARCH THE HOLE WITH THE SAME SIZE
ODataHoleInfo hole = availableHolesBySize.get(cursor);
if (hole != null && hole.size == iRecordSize) {
// PERFECT MATCH: DELETE THE HOLE
OProfiler.getInstance().stopChrono(PROFILER_DATA_RECYCLED_COMPLETE, timer);
final long pos = hole.dataOffset;
deleteHole(hole.holeOffset);
return pos;
}
// TRY WITH THE BIGGEST HOLE
hole = availableHolesBySize.lastKey();
if (hole.size > iRecordSize + ODataLocal.RECORD_FIX_SIZE + 50) {
// GOOD MATCH SINCE THE HOLE IS BIG ENOUGH ALSO FOR ANOTHER RECORD: UPDATE THE HOLE WITH THE DIFFERENCE
final long pos = hole.dataOffset;
OProfiler.getInstance().stopChrono(PROFILER_DATA_RECYCLED_PARTIAL, timer);
updateHole(hole, hole.dataOffset + iRecordSize, hole.size - iRecordSize);
return pos;
}
}
OProfiler.getInstance().stopChrono(PROFILER_DATA_RECYCLED_NOTFOUND, timer);
return -1;
} | class class_name[name] begin[{]
method[popFirstAvailableHole, return_type[type[long]], modifier[synchronized protected], parameter[iRecordSize]] begin[{]
if[binary_operation[binary_operation[member[.maxHoleSize], >, literal[1]], &&, binary_operation[binary_operation[binary_operation[member[.iRecordSize], +, member[ODataLocal.RECORD_FIX_SIZE]], +, literal[50]], >, member[.maxHoleSize]]]] begin[{]
return[literal[1]]
else begin[{]
None
end[}]
local_variable[type[long], timer]
if[call[availableHolesBySize.isEmpty, parameter[]]] begin[{]
assign[member[cursor.size], member[.iRecordSize]]
local_variable[type[ODataHoleInfo], hole]
if[binary_operation[binary_operation[member[.hole], !=, literal[null]], &&, binary_operation[member[hole.size], ==, member[.iRecordSize]]]] begin[{]
call[OProfiler.getInstance, parameter[]]
local_variable[type[long], pos]
call[.deleteHole, parameter[member[hole.holeOffset]]]
return[member[.pos]]
else begin[{]
None
end[}]
assign[member[.hole], call[availableHolesBySize.lastKey, parameter[]]]
if[binary_operation[member[hole.size], >, binary_operation[binary_operation[member[.iRecordSize], +, member[ODataLocal.RECORD_FIX_SIZE]], +, literal[50]]]] begin[{]
local_variable[type[long], pos]
call[OProfiler.getInstance, parameter[]]
call[.updateHole, parameter[member[.hole], binary_operation[member[hole.dataOffset], +, member[.iRecordSize]], binary_operation[member[hole.size], -, member[.iRecordSize]]]]
return[member[.pos]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[OProfiler.getInstance, parameter[]]
return[literal[1]]
end[}]
END[}] | Keyword[protected] Keyword[synchronized] Keyword[long] identifier[popFirstAvailableHole] operator[SEP] Keyword[final] Keyword[int] identifier[iRecordSize] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[maxHoleSize] operator[>] operator[-] Other[1] operator[&&] identifier[iRecordSize] operator[+] identifier[ODataLocal] operator[SEP] identifier[RECORD_FIX_SIZE] operator[+] Other[50] operator[>] identifier[maxHoleSize] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] Keyword[final] Keyword[long] identifier[timer] operator[=] identifier[OProfiler] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[startChrono] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[availableHolesBySize] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[cursor] operator[SEP] identifier[size] operator[=] identifier[iRecordSize] operator[SEP] identifier[ODataHoleInfo] identifier[hole] operator[=] identifier[availableHolesBySize] operator[SEP] identifier[get] operator[SEP] identifier[cursor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hole] operator[!=] Other[null] operator[&&] identifier[hole] operator[SEP] identifier[size] operator[==] identifier[iRecordSize] operator[SEP] {
identifier[OProfiler] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[stopChrono] operator[SEP] identifier[PROFILER_DATA_RECYCLED_COMPLETE] , identifier[timer] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[pos] operator[=] identifier[hole] operator[SEP] identifier[dataOffset] operator[SEP] identifier[deleteHole] operator[SEP] identifier[hole] operator[SEP] identifier[holeOffset] operator[SEP] operator[SEP] Keyword[return] identifier[pos] operator[SEP]
}
identifier[hole] operator[=] identifier[availableHolesBySize] operator[SEP] identifier[lastKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hole] operator[SEP] identifier[size] operator[>] identifier[iRecordSize] operator[+] identifier[ODataLocal] operator[SEP] identifier[RECORD_FIX_SIZE] operator[+] Other[50] operator[SEP] {
Keyword[final] Keyword[long] identifier[pos] operator[=] identifier[hole] operator[SEP] identifier[dataOffset] operator[SEP] identifier[OProfiler] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[stopChrono] operator[SEP] identifier[PROFILER_DATA_RECYCLED_PARTIAL] , identifier[timer] operator[SEP] operator[SEP] identifier[updateHole] operator[SEP] identifier[hole] , identifier[hole] operator[SEP] identifier[dataOffset] operator[+] identifier[iRecordSize] , identifier[hole] operator[SEP] identifier[size] operator[-] identifier[iRecordSize] operator[SEP] operator[SEP] Keyword[return] identifier[pos] operator[SEP]
}
}
identifier[OProfiler] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[stopChrono] operator[SEP] identifier[PROFILER_DATA_RECYCLED_NOTFOUND] , identifier[timer] operator[SEP] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP]
}
|
public String getSelectedText( ParsedPage pp ){
if( pp == null ) return null;
StringBuilder sb = new StringBuilder();
levelModifier = pp.getSection(0).getLevel()-1;
if( pageHandling == null ){
if( firstParagraphHandling != null ){
handleContent( pp.getFirstParagraph(), firstParagraphHandling, sb );
deleteParagraph( pp.getFirstParagraphNr(), pp.getSections() );
}
for( Section s: pp.getSections() )
handleSection( s, sb );
}
else{
if( pageHandling.get( CIT.TEXT ) ){
sb.append( pp.getText() );
}
else{
if( pageHandling.get( CIT.BOLD )){
handleSpans( pp.getFormatSpans( FormatType.BOLD ), pp.getText(), sb );
}
if( pageHandling.get( CIT.ITALIC )){
handleSpans( pp.getFormatSpans( FormatType.ITALIC ), pp.getText(), sb );
}
}
if( pageHandling.get( CIT.LINK ))
handleLinks( pp.getLinks(), !pageHandling.get( CIT.TEXT ), sb );
}
return sb.toString().trim();
} | class class_name[name] begin[{]
method[getSelectedText, return_type[type[String]], modifier[public], parameter[pp]] begin[{]
if[binary_operation[member[.pp], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], sb]
assign[member[.levelModifier], binary_operation[call[pp.getSection, parameter[literal[0]]], -, literal[1]]]
if[binary_operation[member[.pageHandling], ==, literal[null]]] begin[{]
if[binary_operation[member[.firstParagraphHandling], !=, literal[null]]] begin[{]
call[.handleContent, parameter[call[pp.getFirstParagraph, parameter[]], member[.firstParagraphHandling], member[.sb]]]
call[.deleteParagraph, parameter[call[pp.getFirstParagraphNr, parameter[]], call[pp.getSections, parameter[]]]]
else begin[{]
None
end[}]
ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleSection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getSections, postfix_operators=[], prefix_operators=[], qualifier=pp, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Section, sub_type=None))), label=None)
else begin[{]
if[call[pageHandling.get, parameter[member[CIT.TEXT]]]] begin[{]
call[sb.append, parameter[call[pp.getText, parameter[]]]]
else begin[{]
if[call[pageHandling.get, parameter[member[CIT.BOLD]]]] begin[{]
call[.handleSpans, parameter[call[pp.getFormatSpans, parameter[member[FormatType.BOLD]]], call[pp.getText, parameter[]], member[.sb]]]
else begin[{]
None
end[}]
if[call[pageHandling.get, parameter[member[CIT.ITALIC]]]] begin[{]
call[.handleSpans, parameter[call[pp.getFormatSpans, parameter[member[FormatType.ITALIC]]], call[pp.getText, parameter[]], member[.sb]]]
else begin[{]
None
end[}]
end[}]
if[call[pageHandling.get, parameter[member[CIT.LINK]]]] begin[{]
call[.handleLinks, parameter[call[pp.getLinks, parameter[]], call[pageHandling.get, parameter[member[CIT.TEXT]]], member[.sb]]]
else begin[{]
None
end[}]
end[}]
return[call[sb.toString, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getSelectedText] operator[SEP] identifier[ParsedPage] identifier[pp] operator[SEP] {
Keyword[if] operator[SEP] identifier[pp] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[levelModifier] operator[=] identifier[pp] operator[SEP] identifier[getSection] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[pageHandling] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[firstParagraphHandling] operator[!=] Other[null] operator[SEP] {
identifier[handleContent] operator[SEP] identifier[pp] operator[SEP] identifier[getFirstParagraph] operator[SEP] operator[SEP] , identifier[firstParagraphHandling] , identifier[sb] operator[SEP] operator[SEP] identifier[deleteParagraph] operator[SEP] identifier[pp] operator[SEP] identifier[getFirstParagraphNr] operator[SEP] operator[SEP] , identifier[pp] operator[SEP] identifier[getSections] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Section] identifier[s] operator[:] identifier[pp] operator[SEP] identifier[getSections] operator[SEP] operator[SEP] operator[SEP] identifier[handleSection] operator[SEP] identifier[s] , identifier[sb] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[pageHandling] operator[SEP] identifier[get] operator[SEP] identifier[CIT] operator[SEP] identifier[TEXT] operator[SEP] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[pp] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[pageHandling] operator[SEP] identifier[get] operator[SEP] identifier[CIT] operator[SEP] identifier[BOLD] operator[SEP] operator[SEP] {
identifier[handleSpans] operator[SEP] identifier[pp] operator[SEP] identifier[getFormatSpans] operator[SEP] identifier[FormatType] operator[SEP] identifier[BOLD] operator[SEP] , identifier[pp] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , identifier[sb] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[pageHandling] operator[SEP] identifier[get] operator[SEP] identifier[CIT] operator[SEP] identifier[ITALIC] operator[SEP] operator[SEP] {
identifier[handleSpans] operator[SEP] identifier[pp] operator[SEP] identifier[getFormatSpans] operator[SEP] identifier[FormatType] operator[SEP] identifier[ITALIC] operator[SEP] , identifier[pp] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , identifier[sb] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[pageHandling] operator[SEP] identifier[get] operator[SEP] identifier[CIT] operator[SEP] identifier[LINK] operator[SEP] operator[SEP] identifier[handleLinks] operator[SEP] identifier[pp] operator[SEP] identifier[getLinks] operator[SEP] operator[SEP] , operator[!] identifier[pageHandling] operator[SEP] identifier[get] operator[SEP] identifier[CIT] operator[SEP] identifier[TEXT] operator[SEP] , identifier[sb] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void notifyHandlableAdded(Featurable featurable)
{
if (featurable.hasFeature(Refreshable.class))
{
final Refreshable refreshable = featurable.getFeature(Refreshable.class);
final Integer layer = getLayer(featurable);
final Collection<Refreshable> refreshables = getLayer(layer);
refreshables.add(refreshable);
indexs.add(layer);
}
} | class class_name[name] begin[{]
method[notifyHandlableAdded, return_type[void], modifier[public], parameter[featurable]] begin[{]
if[call[featurable.hasFeature, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Refreshable, sub_type=None))]]] begin[{]
local_variable[type[Refreshable], refreshable]
local_variable[type[Integer], layer]
local_variable[type[Collection], refreshables]
call[refreshables.add, parameter[member[.refreshable]]]
call[indexs.add, parameter[member[.layer]]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[notifyHandlableAdded] operator[SEP] identifier[Featurable] identifier[featurable] operator[SEP] {
Keyword[if] operator[SEP] identifier[featurable] operator[SEP] identifier[hasFeature] operator[SEP] identifier[Refreshable] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[final] identifier[Refreshable] identifier[refreshable] operator[=] identifier[featurable] operator[SEP] identifier[getFeature] operator[SEP] identifier[Refreshable] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[final] identifier[Integer] identifier[layer] operator[=] identifier[getLayer] operator[SEP] identifier[featurable] operator[SEP] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[Refreshable] operator[>] identifier[refreshables] operator[=] identifier[getLayer] operator[SEP] identifier[layer] operator[SEP] operator[SEP] identifier[refreshables] operator[SEP] identifier[add] operator[SEP] identifier[refreshable] operator[SEP] operator[SEP] identifier[indexs] operator[SEP] identifier[add] operator[SEP] identifier[layer] operator[SEP] operator[SEP]
}
}
|
@Override
protected void doGet( HttpServletRequest req, HttpServletResponse resp )
throws ServletException, IOException {
boolean responseSet = false;
boolean validRequest = Arrays.asList( CSS_STYLESHEET, BANNER_IMAGE ).contains( req.getServletPath());
if( ! validRequest )
this.logger.severe( "An unexpected resource was asked to Roboconf's interception servlet: " + req.getServletPath());
// If the resource exists in the Karaf ETC directory, then use it.
if( ! Utils.isEmptyOrWhitespaces( this.karafEtc )) {
File resource = null;
if( CSS_STYLESHEET.equals( req.getServletPath()))
resource = new File( this.karafEtc, OVERRIDE_CSS );
else if( BANNER_IMAGE.equals( req.getServletPath()))
resource = new File( this.karafEtc, OVERRIDE_IMAGE );
if( resource != null && resource.isFile()) {
this.logger.fine( "A custom resource was found for " + req.getServletPath());
Utils.copyStream( resource, resp.getOutputStream());
responseSet = true;
}
}
// Otherwise, return the default file
if( validRequest && ! responseSet ) {
InputStream in = getServletContext().getResourceAsStream( req.getServletPath());
try {
if( in != null ) {
Utils.copyStreamUnsafelyUseWithCaution( in, resp.getOutputStream());
responseSet = true;
}
} finally {
Utils.closeQuietly( in );
}
}
// Complete the result if necessary
if( ! responseSet ) {
if( validRequest )
resp.sendError( HttpServletResponse.SC_NOT_FOUND );
else
resp.sendError( HttpServletResponse.SC_FORBIDDEN );
}
} | class class_name[name] begin[{]
method[doGet, return_type[void], modifier[protected], parameter[req, resp]] begin[{]
local_variable[type[boolean], responseSet]
local_variable[type[boolean], validRequest]
if[member[.validRequest]] begin[{]
THIS[member[None.logger]call[None.severe, parameter[binary_operation[literal["An unexpected resource was asked to Roboconf's interception servlet: "], +, call[req.getServletPath, parameter[]]]]]]
else begin[{]
None
end[}]
if[call[Utils.isEmptyOrWhitespaces, parameter[THIS[member[None.karafEtc]]]]] begin[{]
local_variable[type[File], resource]
if[call[CSS_STYLESHEET.equals, parameter[call[req.getServletPath, parameter[]]]]] begin[{]
assign[member[.resource], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=karafEtc, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=OVERRIDE_CSS, 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=File, sub_type=None))]
else begin[{]
if[call[BANNER_IMAGE.equals, parameter[call[req.getServletPath, parameter[]]]]] begin[{]
assign[member[.resource], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=karafEtc, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=OVERRIDE_IMAGE, 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=File, sub_type=None))]
else begin[{]
None
end[}]
end[}]
if[binary_operation[binary_operation[member[.resource], !=, literal[null]], &&, call[resource.isFile, parameter[]]]] begin[{]
THIS[member[None.logger]call[None.fine, parameter[binary_operation[literal["A custom resource was found for "], +, call[req.getServletPath, parameter[]]]]]]
call[Utils.copyStream, parameter[member[.resource], call[resp.getOutputStream, parameter[]]]]
assign[member[.responseSet], literal[true]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[member[.validRequest], &&, member[.responseSet]]] begin[{]
local_variable[type[InputStream], in]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getOutputStream, postfix_operators=[], prefix_operators=[], qualifier=resp, selectors=[], type_arguments=None)], member=copyStreamUnsafelyUseWithCaution, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=responseSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
else begin[{]
None
end[}]
if[member[.responseSet]] begin[{]
if[member[.validRequest]] begin[{]
call[resp.sendError, parameter[member[HttpServletResponse.SC_NOT_FOUND]]]
else begin[{]
call[resp.sendError, parameter[member[HttpServletResponse.SC_FORBIDDEN]]]
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[doGet] operator[SEP] identifier[HttpServletRequest] identifier[req] , identifier[HttpServletResponse] identifier[resp] operator[SEP] Keyword[throws] identifier[ServletException] , identifier[IOException] {
Keyword[boolean] identifier[responseSet] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[validRequest] operator[=] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[CSS_STYLESHEET] , identifier[BANNER_IMAGE] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[req] operator[SEP] identifier[getServletPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[validRequest] operator[SEP] Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[severe] operator[SEP] literal[String] operator[+] identifier[req] operator[SEP] identifier[getServletPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Utils] operator[SEP] identifier[isEmptyOrWhitespaces] operator[SEP] Keyword[this] operator[SEP] identifier[karafEtc] operator[SEP] operator[SEP] {
identifier[File] identifier[resource] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[CSS_STYLESHEET] operator[SEP] identifier[equals] operator[SEP] identifier[req] operator[SEP] identifier[getServletPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[=] Keyword[new] identifier[File] operator[SEP] Keyword[this] operator[SEP] identifier[karafEtc] , identifier[OVERRIDE_CSS] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[BANNER_IMAGE] operator[SEP] identifier[equals] operator[SEP] identifier[req] operator[SEP] identifier[getServletPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[resource] operator[=] Keyword[new] identifier[File] operator[SEP] Keyword[this] operator[SEP] identifier[karafEtc] , identifier[OVERRIDE_IMAGE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resource] operator[!=] Other[null] operator[&&] identifier[resource] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] identifier[req] operator[SEP] identifier[getServletPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[copyStream] operator[SEP] identifier[resource] , identifier[resp] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[responseSet] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[validRequest] operator[&&] operator[!] identifier[responseSet] operator[SEP] {
identifier[InputStream] identifier[in] operator[=] identifier[getServletContext] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceAsStream] operator[SEP] identifier[req] operator[SEP] identifier[getServletPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[in] operator[!=] Other[null] operator[SEP] {
identifier[Utils] operator[SEP] identifier[copyStreamUnsafelyUseWithCaution] operator[SEP] identifier[in] , identifier[resp] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[responseSet] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[finally] {
identifier[Utils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[in] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[responseSet] operator[SEP] {
Keyword[if] operator[SEP] identifier[validRequest] operator[SEP] identifier[resp] operator[SEP] identifier[sendError] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[SC_NOT_FOUND] operator[SEP] operator[SEP] Keyword[else] identifier[resp] operator[SEP] identifier[sendError] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[SC_FORBIDDEN] operator[SEP] operator[SEP]
}
}
|
public void marshall(SnapshotOptionsStatus snapshotOptionsStatus, ProtocolMarshaller protocolMarshaller) {
if (snapshotOptionsStatus == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(snapshotOptionsStatus.getOptions(), OPTIONS_BINDING);
protocolMarshaller.marshall(snapshotOptionsStatus.getStatus(), STATUS_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[snapshotOptionsStatus, protocolMarshaller]] begin[{]
if[binary_operation[member[.snapshotOptionsStatus], ==, 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=getOptions, postfix_operators=[], prefix_operators=[], qualifier=snapshotOptionsStatus, selectors=[], type_arguments=None), MemberReference(member=OPTIONS_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=getStatus, postfix_operators=[], prefix_operators=[], qualifier=snapshotOptionsStatus, selectors=[], type_arguments=None), MemberReference(member=STATUS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], 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[SnapshotOptionsStatus] identifier[snapshotOptionsStatus] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[snapshotOptionsStatus] 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[snapshotOptionsStatus] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] , identifier[OPTIONS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[snapshotOptionsStatus] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[STATUS_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]
}
}
|
@SuppressWarnings("unchecked")
@Override
public E get(int index) {
stateLock.readLock().lock();
try {
switch (state) {
case BLOCKING:
if (waitForIndex(index)) {
return (E) elements[index];
}
// FALL THROUGH because waitForIndex() returned false and this list is now timed out
case TIMED_OUT:
// FALL THROUGH because TIMED_OUT and COMPLETE_WITH_FAILURES both involve missing elements
case COMPLETE_WITH_FAILURES:
return (E) elements[effectiveIndex[index]];
case COMPLETE:
return (E) elements[index];
default:
throw new IllegalStateException();
}
} finally {
stateLock.readLock().unlock();
}
} | class class_name[name] begin[{]
method[get, return_type[type[E]], modifier[public], parameter[index]] begin[{]
call[stateLock.readLock, parameter[]]
TryStatement(block=[SwitchStatement(cases=[SwitchStatementCase(case=['BLOCKING'], statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=waitForIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Cast(expression=MemberReference(member=elements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None)), label=None)]))]), SwitchStatementCase(case=['TIMED_OUT', 'COMPLETE_WITH_FAILURES'], statements=[ReturnStatement(expression=Cast(expression=MemberReference(member=elements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=effectiveIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))]), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None)), label=None)]), SwitchStatementCase(case=['COMPLETE'], statements=[ReturnStatement(expression=Cast(expression=MemberReference(member=elements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None)), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)])], expression=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=readLock, postfix_operators=[], prefix_operators=[], qualifier=stateLock, selectors=[MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[E] identifier[get] operator[SEP] Keyword[int] identifier[index] operator[SEP] {
identifier[stateLock] operator[SEP] identifier[readLock] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[switch] operator[SEP] identifier[state] operator[SEP] {
Keyword[case] identifier[BLOCKING] operator[:] Keyword[if] operator[SEP] identifier[waitForIndex] operator[SEP] identifier[index] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[E] operator[SEP] identifier[elements] operator[SEP] identifier[index] operator[SEP] operator[SEP]
}
Keyword[case] identifier[TIMED_OUT] operator[:] Keyword[case] identifier[COMPLETE_WITH_FAILURES] operator[:] Keyword[return] operator[SEP] identifier[E] operator[SEP] identifier[elements] operator[SEP] identifier[effectiveIndex] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[COMPLETE] operator[:] Keyword[return] operator[SEP] identifier[E] operator[SEP] identifier[elements] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[finally] {
identifier[stateLock] operator[SEP] identifier[readLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private static void partialSort(
final WordIterator[] a,
final int maxChangedIndex,
final int size,
final Comparator<WordIterator> comp
)
{
for (int i = maxChangedIndex; i >= 0; i--) {
WordIterator it = a[i];
for (int j = i + 1; j < size; j++) {
WordIterator it2 = a[j];
if (comp.compare(it, it2) <= 0) {
break;
}
a[j - 1] = it2;
a[j] = it;
}
}
} | class class_name[name] begin[{]
method[partialSort, return_type[void], modifier[private static], parameter[a, maxChangedIndex, size, comp]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WordIterator, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=it2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WordIterator, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=it, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=it2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compare, postfix_operators=[], prefix_operators=[], qualifier=comp, 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=[BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]), type==, value=MemberReference(member=it2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=it, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=maxChangedIndex, 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)
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[partialSort] operator[SEP] Keyword[final] identifier[WordIterator] operator[SEP] operator[SEP] identifier[a] , Keyword[final] Keyword[int] identifier[maxChangedIndex] , Keyword[final] Keyword[int] identifier[size] , Keyword[final] identifier[Comparator] operator[<] identifier[WordIterator] operator[>] identifier[comp] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[maxChangedIndex] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] identifier[i] operator[--] operator[SEP] {
identifier[WordIterator] identifier[it] operator[=] identifier[a] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[i] operator[+] Other[1] operator[SEP] identifier[j] operator[<] identifier[size] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[WordIterator] identifier[it2] operator[=] identifier[a] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[comp] operator[SEP] identifier[compare] operator[SEP] identifier[it] , identifier[it2] operator[SEP] operator[<=] Other[0] operator[SEP] {
Keyword[break] operator[SEP]
}
identifier[a] operator[SEP] identifier[j] operator[-] Other[1] operator[SEP] operator[=] identifier[it2] operator[SEP] identifier[a] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[it] operator[SEP]
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.