code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
---|---|---|
public int getValue(final K key)
{
@DoNotSub final int mask = values.length - 1;
@DoNotSub int index = Hashing.hash(key, mask);
int value;
while (missingValue != (value = values[index]))
{
if (key.equals(keys[index]))
{
break;
}
index = ++index & mask;
}
return value;
} | class class_name[name] begin[{]
method[getValue, return_type[type[int]], modifier[public], parameter[key]] begin[{]
local_variable[type[int], mask]
local_variable[type[int], index]
local_variable[type[int], value]
while[binary_operation[member[.missingValue], !=, assign[member[.value], member[.values]]]] begin[{]
if[call[key.equals, parameter[member[.keys]]]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
assign[member[.index], binary_operation[member[.index], &, member[.mask]]]
end[}]
return[member[.value]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[getValue] operator[SEP] Keyword[final] identifier[K] identifier[key] operator[SEP] {
annotation[@] identifier[DoNotSub] Keyword[final] Keyword[int] identifier[mask] operator[=] identifier[values] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] annotation[@] identifier[DoNotSub] Keyword[int] identifier[index] operator[=] identifier[Hashing] operator[SEP] identifier[hash] operator[SEP] identifier[key] , identifier[mask] operator[SEP] operator[SEP] Keyword[int] identifier[value] operator[SEP] Keyword[while] operator[SEP] identifier[missingValue] operator[!=] operator[SEP] identifier[value] operator[=] identifier[values] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[keys] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] {
Keyword[break] operator[SEP]
}
identifier[index] operator[=] operator[++] identifier[index] operator[&] identifier[mask] operator[SEP]
}
Keyword[return] identifier[value] operator[SEP]
}
|
public boolean isAfter(ReadableInterval interval) {
long endMillis;
if (interval == null) {
endMillis = DateTimeUtils.currentTimeMillis();
} else {
endMillis = interval.getEndMillis();
}
return (getStartMillis() >= endMillis);
} | class class_name[name] begin[{]
method[isAfter, return_type[type[boolean]], modifier[public], parameter[interval]] begin[{]
local_variable[type[long], endMillis]
if[binary_operation[member[.interval], ==, literal[null]]] begin[{]
assign[member[.endMillis], call[DateTimeUtils.currentTimeMillis, parameter[]]]
else begin[{]
assign[member[.endMillis], call[interval.getEndMillis, parameter[]]]
end[}]
return[binary_operation[call[.getStartMillis, parameter[]], >=, member[.endMillis]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isAfter] operator[SEP] identifier[ReadableInterval] identifier[interval] operator[SEP] {
Keyword[long] identifier[endMillis] operator[SEP] Keyword[if] operator[SEP] identifier[interval] operator[==] Other[null] operator[SEP] {
identifier[endMillis] operator[=] identifier[DateTimeUtils] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[endMillis] operator[=] identifier[interval] operator[SEP] identifier[getEndMillis] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] identifier[getStartMillis] operator[SEP] operator[SEP] operator[>=] identifier[endMillis] operator[SEP] operator[SEP]
}
|
private float calculateDy(float distanceY) {
int currentY = view.getScrollY();
float nextY = distanceY + currentY;
boolean isInsideVertically = nextY >= minY && nextY <= maxY;
return isInsideVertically ? distanceY : 0;
} | class class_name[name] begin[{]
method[calculateDy, return_type[type[float]], modifier[private], parameter[distanceY]] begin[{]
local_variable[type[int], currentY]
local_variable[type[float], nextY]
local_variable[type[boolean], isInsideVertically]
return[TernaryExpression(condition=MemberReference(member=isInsideVertically, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=MemberReference(member=distanceY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
end[}]
END[}] | Keyword[private] Keyword[float] identifier[calculateDy] operator[SEP] Keyword[float] identifier[distanceY] operator[SEP] {
Keyword[int] identifier[currentY] operator[=] identifier[view] operator[SEP] identifier[getScrollY] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[nextY] operator[=] identifier[distanceY] operator[+] identifier[currentY] operator[SEP] Keyword[boolean] identifier[isInsideVertically] operator[=] identifier[nextY] operator[>=] identifier[minY] operator[&&] identifier[nextY] operator[<=] identifier[maxY] operator[SEP] Keyword[return] identifier[isInsideVertically] operator[?] identifier[distanceY] operator[:] Other[0] operator[SEP]
}
|
public static int nvgraphWidestPath(
nvgraphHandle handle,
nvgraphGraphDescr descrG,
long weight_index,
Pointer source_vert,
long widest_path_index)
{
return checkResult(nvgraphWidestPathNative(handle, descrG, weight_index, source_vert, widest_path_index));
} | class class_name[name] begin[{]
method[nvgraphWidestPath, return_type[type[int]], modifier[public static], parameter[handle, descrG, weight_index, source_vert, widest_path_index]] begin[{]
return[call[.checkResult, parameter[call[.nvgraphWidestPathNative, parameter[member[.handle], member[.descrG], member[.weight_index], member[.source_vert], member[.widest_path_index]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[nvgraphWidestPath] operator[SEP] identifier[nvgraphHandle] identifier[handle] , identifier[nvgraphGraphDescr] identifier[descrG] , Keyword[long] identifier[weight_index] , identifier[Pointer] identifier[source_vert] , Keyword[long] identifier[widest_path_index] operator[SEP] {
Keyword[return] identifier[checkResult] operator[SEP] identifier[nvgraphWidestPathNative] operator[SEP] identifier[handle] , identifier[descrG] , identifier[weight_index] , identifier[source_vert] , identifier[widest_path_index] operator[SEP] operator[SEP] operator[SEP]
}
|
public String[] getColumnTexts(int columnIndex) {
int count = getCount();
if (count > 0) {
String[] texts = new String[count];
for (int i = 1; i <= count; i++) {
texts[i - 1] = getText(i, columnIndex);
}
return texts;
} else {
return null;
}
} | class class_name[name] begin[{]
method[getColumnTexts, return_type[type[String]], modifier[public], parameter[columnIndex]] begin[{]
local_variable[type[int], count]
if[binary_operation[member[.count], >, literal[0]]] begin[{]
local_variable[type[String], texts]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=texts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=columnIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.texts]]
else begin[{]
return[literal[null]]
end[}]
end[}]
END[}] | Keyword[public] identifier[String] operator[SEP] operator[SEP] identifier[getColumnTexts] operator[SEP] Keyword[int] identifier[columnIndex] operator[SEP] {
Keyword[int] identifier[count] operator[=] identifier[getCount] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[count] operator[>] Other[0] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[texts] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[count] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<=] identifier[count] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[texts] operator[SEP] identifier[i] operator[-] Other[1] operator[SEP] operator[=] identifier[getText] operator[SEP] identifier[i] , identifier[columnIndex] operator[SEP] operator[SEP]
}
Keyword[return] identifier[texts] operator[SEP]
}
Keyword[else] {
Keyword[return] Other[null] operator[SEP]
}
}
|
private void createIntervalList(){
synchronized(intervalLock){
if (_cachedIntervalInfos!=null)
return;
List<Interval> intervals = intervalRegistry.getIntervals();
_cachedIntervalInfos = new ArrayList<IntervalInfo>(intervals.size());
for (Interval interval : intervals) {
_cachedIntervalInfos.add(new IntervalInfo(interval));
interval.addSecondaryIntervalListener(this);
}
}
} | class class_name[name] begin[{]
method[createIntervalList, return_type[void], modifier[private], parameter[]] begin[{]
SYNCHRONIZED[member[.intervalLock]] BEGIN[{]
if[binary_operation[member[._cachedIntervalInfos], !=, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[List], intervals]
assign[member[._cachedIntervalInfos], ClassCreator(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=intervals, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IntervalInfo, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=interval, 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=IntervalInfo, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=_cachedIntervalInfos, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=addSecondaryIntervalListener, postfix_operators=[], prefix_operators=[], qualifier=interval, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=intervals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=interval)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Interval, sub_type=None))), label=None)
END[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[createIntervalList] operator[SEP] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[intervalLock] operator[SEP] {
Keyword[if] operator[SEP] identifier[_cachedIntervalInfos] operator[!=] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[List] operator[<] identifier[Interval] operator[>] identifier[intervals] operator[=] identifier[intervalRegistry] operator[SEP] identifier[getIntervals] operator[SEP] operator[SEP] operator[SEP] identifier[_cachedIntervalInfos] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[IntervalInfo] operator[>] operator[SEP] identifier[intervals] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Interval] identifier[interval] operator[:] identifier[intervals] operator[SEP] {
identifier[_cachedIntervalInfos] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[IntervalInfo] operator[SEP] identifier[interval] operator[SEP] operator[SEP] operator[SEP] identifier[interval] operator[SEP] identifier[addSecondaryIntervalListener] operator[SEP] Keyword[this] operator[SEP] operator[SEP]
}
}
}
|
@Override
public int start(String name) {
Integer id = re.groupId(name);
if (id == null) throw new IllegalArgumentException("<" + name + "> isn't defined");
return start(id);
} | class class_name[name] begin[{]
method[start, return_type[type[int]], modifier[public], parameter[name]] begin[{]
local_variable[type[Integer], id]
if[binary_operation[member[.id], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<"), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> isn't defined"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[.start, parameter[member[.id]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[start] operator[SEP] identifier[String] identifier[name] operator[SEP] {
identifier[Integer] identifier[id] operator[=] identifier[re] operator[SEP] identifier[groupId] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[id] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[start] operator[SEP] identifier[id] operator[SEP] operator[SEP]
}
|
public void setEnterpriseDuration(int index, Duration value)
{
set(selectField(AssignmentFieldLists.ENTERPRISE_DURATION, index), value);
} | class class_name[name] begin[{]
method[setEnterpriseDuration, return_type[void], modifier[public], parameter[index, value]] begin[{]
call[.set, parameter[call[.selectField, parameter[member[AssignmentFieldLists.ENTERPRISE_DURATION], member[.index]]], member[.value]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setEnterpriseDuration] operator[SEP] Keyword[int] identifier[index] , identifier[Duration] identifier[value] operator[SEP] {
identifier[set] operator[SEP] identifier[selectField] operator[SEP] identifier[AssignmentFieldLists] operator[SEP] identifier[ENTERPRISE_DURATION] , identifier[index] operator[SEP] , identifier[value] operator[SEP] operator[SEP]
}
|
private void rebuild()
{
pollact = null;
pollSize = pollers.size();
if (pollset != null) {
pollset.close();
}
pollset = context.poller(pollSize);
assert (pollset != null);
pollact = new SPoller[pollSize];
int itemNbr = 0;
for (SPoller poller : pollers) {
pollset.register(poller.item);
pollact[itemNbr] = poller;
itemNbr++;
}
dirty = false;
} | class class_name[name] begin[{]
method[rebuild, return_type[void], modifier[private], parameter[]] begin[{]
assign[member[.pollact], literal[null]]
assign[member[.pollSize], call[pollers.size, parameter[]]]
if[binary_operation[member[.pollset], !=, literal[null]]] begin[{]
call[pollset.close, parameter[]]
else begin[{]
None
end[}]
assign[member[.pollset], call[context.poller, parameter[member[.pollSize]]]]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=pollset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
assign[member[.pollact], ArrayCreator(dimensions=[MemberReference(member=pollSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SPoller, sub_type=None))]
local_variable[type[int], itemNbr]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=poller, selectors=[])], member=register, postfix_operators=[], prefix_operators=[], qualifier=pollset, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pollact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=itemNbr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=poller, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MemberReference(member=itemNbr, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=pollers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=poller)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SPoller, sub_type=None))), label=None)
assign[member[.dirty], literal[false]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[rebuild] operator[SEP] operator[SEP] {
identifier[pollact] operator[=] Other[null] operator[SEP] identifier[pollSize] operator[=] identifier[pollers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pollset] operator[!=] Other[null] operator[SEP] {
identifier[pollset] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
identifier[pollset] operator[=] identifier[context] operator[SEP] identifier[poller] operator[SEP] identifier[pollSize] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[pollset] operator[!=] Other[null] operator[SEP] operator[SEP] identifier[pollact] operator[=] Keyword[new] identifier[SPoller] operator[SEP] identifier[pollSize] operator[SEP] operator[SEP] Keyword[int] identifier[itemNbr] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[SPoller] identifier[poller] operator[:] identifier[pollers] operator[SEP] {
identifier[pollset] operator[SEP] identifier[register] operator[SEP] identifier[poller] operator[SEP] identifier[item] operator[SEP] operator[SEP] identifier[pollact] operator[SEP] identifier[itemNbr] operator[SEP] operator[=] identifier[poller] operator[SEP] identifier[itemNbr] operator[++] operator[SEP]
}
identifier[dirty] operator[=] literal[boolean] operator[SEP]
}
|
public static int sum( InterleavedS8 img ) {
if( BoofConcurrency.USE_CONCURRENT ) {
return ImplImageStatistics_MT.sum(img);
} else {
return ImplImageStatistics.sum(img);
}
} | class class_name[name] begin[{]
method[sum, return_type[type[int]], modifier[public static], parameter[img]] begin[{]
if[member[BoofConcurrency.USE_CONCURRENT]] begin[{]
return[call[ImplImageStatistics_MT.sum, parameter[member[.img]]]]
else begin[{]
return[call[ImplImageStatistics.sum, parameter[member[.img]]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[sum] operator[SEP] identifier[InterleavedS8] identifier[img] operator[SEP] {
Keyword[if] operator[SEP] identifier[BoofConcurrency] operator[SEP] identifier[USE_CONCURRENT] operator[SEP] {
Keyword[return] identifier[ImplImageStatistics_MT] operator[SEP] identifier[sum] operator[SEP] identifier[img] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[ImplImageStatistics] operator[SEP] identifier[sum] operator[SEP] identifier[img] operator[SEP] operator[SEP]
}
}
|
@XmlElementDecl(namespace = "https://adwords.google.com/api/adwords/o/v201809", name = "RequestHeader")
public JAXBElement<SoapHeader> createRequestHeader(SoapHeader value) {
return new JAXBElement<SoapHeader>(_RequestHeader_QNAME, SoapHeader.class, null, value);
} | class class_name[name] begin[{]
method[createRequestHeader, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=_RequestHeader_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SoapHeader, 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=SoapHeader, 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[SoapHeader] operator[>] identifier[createRequestHeader] operator[SEP] identifier[SoapHeader] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[SoapHeader] operator[>] operator[SEP] identifier[_RequestHeader_QNAME] , identifier[SoapHeader] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP]
}
|
private boolean isDenyUncoveredHttpMethods(List<SecurityConstraint> scList) {
for (SecurityConstraint sc : scList) {
List<WebResourceCollection> wrcList = sc.getWebResourceCollections();
for (WebResourceCollection wrc : wrcList) {
if (wrc.getDenyUncoveredHttpMethods()) {
return true;
}
}
}
return false;
} | class class_name[name] begin[{]
method[isDenyUncoveredHttpMethods, return_type[type[boolean]], modifier[private], parameter[scList]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getWebResourceCollections, postfix_operators=[], prefix_operators=[], qualifier=sc, selectors=[], type_arguments=None), name=wrcList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=WebResourceCollection, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getDenyUncoveredHttpMethods, postfix_operators=[], prefix_operators=[], qualifier=wrc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=wrcList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=wrc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WebResourceCollection, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=scList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SecurityConstraint, sub_type=None))), label=None)
return[literal[false]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[isDenyUncoveredHttpMethods] operator[SEP] identifier[List] operator[<] identifier[SecurityConstraint] operator[>] identifier[scList] operator[SEP] {
Keyword[for] operator[SEP] identifier[SecurityConstraint] identifier[sc] operator[:] identifier[scList] operator[SEP] {
identifier[List] operator[<] identifier[WebResourceCollection] operator[>] identifier[wrcList] operator[=] identifier[sc] operator[SEP] identifier[getWebResourceCollections] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[WebResourceCollection] identifier[wrc] operator[:] identifier[wrcList] operator[SEP] {
Keyword[if] operator[SEP] identifier[wrc] operator[SEP] identifier[getDenyUncoveredHttpMethods] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static Calendar addMinutes(Calendar origin, int value) {
Calendar cal = sync((Calendar) origin.clone());
cal.add(Calendar.MINUTE, value);
return sync(cal);
} | class class_name[name] begin[{]
method[addMinutes, return_type[type[Calendar]], modifier[public static], parameter[origin, value]] begin[{]
local_variable[type[Calendar], cal]
call[cal.add, parameter[member[Calendar.MINUTE], member[.value]]]
return[call[.sync, parameter[member[.cal]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Calendar] identifier[addMinutes] operator[SEP] identifier[Calendar] identifier[origin] , Keyword[int] identifier[value] operator[SEP] {
identifier[Calendar] identifier[cal] operator[=] identifier[sync] operator[SEP] operator[SEP] identifier[Calendar] operator[SEP] identifier[origin] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[add] operator[SEP] identifier[Calendar] operator[SEP] identifier[MINUTE] , identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[sync] operator[SEP] identifier[cal] operator[SEP] operator[SEP]
}
|
public static Boolean getBoolean(boolean validate, String key) {
return Boolean.valueOf(getString(validate, key));
} | class class_name[name] begin[{]
method[getBoolean, return_type[type[Boolean]], modifier[public static], parameter[validate, key]] begin[{]
return[call[Boolean.valueOf, parameter[call[.getString, parameter[member[.validate], member[.key]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Boolean] identifier[getBoolean] operator[SEP] Keyword[boolean] identifier[validate] , identifier[String] identifier[key] operator[SEP] {
Keyword[return] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[getString] operator[SEP] identifier[validate] , identifier[key] operator[SEP] operator[SEP] operator[SEP]
}
|
private void loadAllWithAsyncLoader(final CacheOperationCompletionListener _listener, final Set<K> _keysToLoad) {
final AtomicInteger _countDown = new AtomicInteger(_keysToLoad.size());
EntryAction.ActionCompletedCallback cb = new EntryAction.ActionCompletedCallback() {
@Override
public void entryActionCompleted(final EntryAction ea) {
int v = _countDown.decrementAndGet();
if (v == 0) {
_listener.onCompleted();
return;
}
}
};
for (K k : _keysToLoad) {
final K key = k;
executeAsync(key, null, SPEC.GET, cb);
}
} | class class_name[name] begin[{]
method[loadAllWithAsyncLoader, return_type[void], modifier[private], parameter[_listener, _keysToLoad]] begin[{]
local_variable[type[AtomicInteger], _countDown]
local_variable[type[EntryAction], cb]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=key)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=GET, postfix_operators=[], prefix_operators=[], qualifier=SPEC, selectors=[]), MemberReference(member=cb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=executeAsync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=_keysToLoad, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=k)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None))), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[loadAllWithAsyncLoader] operator[SEP] Keyword[final] identifier[CacheOperationCompletionListener] identifier[_listener] , Keyword[final] identifier[Set] operator[<] identifier[K] operator[>] identifier[_keysToLoad] operator[SEP] {
Keyword[final] identifier[AtomicInteger] identifier[_countDown] operator[=] Keyword[new] identifier[AtomicInteger] operator[SEP] identifier[_keysToLoad] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[EntryAction] operator[SEP] identifier[ActionCompletedCallback] identifier[cb] operator[=] Keyword[new] identifier[EntryAction] operator[SEP] identifier[ActionCompletedCallback] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[entryActionCompleted] operator[SEP] Keyword[final] identifier[EntryAction] identifier[ea] operator[SEP] {
Keyword[int] identifier[v] operator[=] identifier[_countDown] operator[SEP] identifier[decrementAndGet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[==] Other[0] operator[SEP] {
identifier[_listener] operator[SEP] identifier[onCompleted] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
}
} operator[SEP] Keyword[for] operator[SEP] identifier[K] identifier[k] operator[:] identifier[_keysToLoad] operator[SEP] {
Keyword[final] identifier[K] identifier[key] operator[=] identifier[k] operator[SEP] identifier[executeAsync] operator[SEP] identifier[key] , Other[null] , identifier[SPEC] operator[SEP] identifier[GET] , identifier[cb] operator[SEP] operator[SEP]
}
}
|
@Nonnull
public static String replaceMultipleAsString (@Nullable final String sInputString,
@Nonnull final char [] aSearchChars,
final char cReplacementChar)
{
ValueEnforcer.notNull (aSearchChars, "SearchChars");
if (hasNoText (sInputString))
return "";
final StringBuilder aSB = new StringBuilder (sInputString.length ());
replaceMultipleTo (sInputString, aSearchChars, cReplacementChar, aSB);
return aSB.toString ();
} | class class_name[name] begin[{]
method[replaceMultipleAsString, return_type[type[String]], modifier[public static], parameter[sInputString, aSearchChars, cReplacementChar]] begin[{]
call[ValueEnforcer.notNull, parameter[member[.aSearchChars], literal["SearchChars"]]]
if[call[.hasNoText, parameter[member[.sInputString]]]] begin[{]
return[literal[""]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], aSB]
call[.replaceMultipleTo, parameter[member[.sInputString], member[.aSearchChars], member[.cReplacementChar], member[.aSB]]]
return[call[aSB.toString, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[String] identifier[replaceMultipleAsString] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[String] identifier[sInputString] , annotation[@] identifier[Nonnull] Keyword[final] Keyword[char] operator[SEP] operator[SEP] identifier[aSearchChars] , Keyword[final] Keyword[char] identifier[cReplacementChar] operator[SEP] {
identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aSearchChars] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasNoText] operator[SEP] identifier[sInputString] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP] Keyword[final] identifier[StringBuilder] identifier[aSB] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[sInputString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[replaceMultipleTo] operator[SEP] identifier[sInputString] , identifier[aSearchChars] , identifier[cReplacementChar] , identifier[aSB] operator[SEP] operator[SEP] Keyword[return] identifier[aSB] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
private SimpleHash buildModel(ValueStack stack, Component component) {
Map<?, ?> context = stack.getContext();
HttpServletRequest req = (HttpServletRequest) context.get(ServletActionContext.HTTP_REQUEST);
// build hash
SimpleHash model = (SimpleHash) req.getAttribute(FreemarkerManager.ATTR_TEMPLATE_MODEL);
if (null == model) {
model = freemarkerManager.buildTemplateModel(stack, null,
(ServletContext) context.get(ServletActionContext.SERVLET_CONTEXT), req,
(HttpServletResponse) context.get(ServletActionContext.HTTP_RESPONSE), config.getObjectWrapper());
req.setAttribute(FreemarkerManager.ATTR_TEMPLATE_MODEL, model);
}
return model;
} | class class_name[name] begin[{]
method[buildModel, return_type[type[SimpleHash]], modifier[private], parameter[stack, component]] begin[{]
local_variable[type[Map], context]
local_variable[type[HttpServletRequest], req]
local_variable[type[SimpleHash], model]
if[binary_operation[literal[null], ==, member[.model]]] begin[{]
assign[member[.model], call[freemarkerManager.buildTemplateModel, parameter[member[.stack], literal[null], Cast(expression=MethodInvocation(arguments=[MemberReference(member=SERVLET_CONTEXT, postfix_operators=[], prefix_operators=[], qualifier=ServletActionContext, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ServletContext, sub_type=None)), member[.req], Cast(expression=MethodInvocation(arguments=[MemberReference(member=HTTP_RESPONSE, postfix_operators=[], prefix_operators=[], qualifier=ServletActionContext, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=HttpServletResponse, sub_type=None)), call[config.getObjectWrapper, parameter[]]]]]
call[req.setAttribute, parameter[member[FreemarkerManager.ATTR_TEMPLATE_MODEL], member[.model]]]
else begin[{]
None
end[}]
return[member[.model]]
end[}]
END[}] | Keyword[private] identifier[SimpleHash] identifier[buildModel] operator[SEP] identifier[ValueStack] identifier[stack] , identifier[Component] identifier[component] operator[SEP] {
identifier[Map] operator[<] operator[?] , operator[?] operator[>] identifier[context] operator[=] identifier[stack] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[HttpServletRequest] identifier[req] operator[=] operator[SEP] identifier[HttpServletRequest] operator[SEP] identifier[context] operator[SEP] identifier[get] operator[SEP] identifier[ServletActionContext] operator[SEP] identifier[HTTP_REQUEST] operator[SEP] operator[SEP] identifier[SimpleHash] identifier[model] operator[=] operator[SEP] identifier[SimpleHash] operator[SEP] identifier[req] operator[SEP] identifier[getAttribute] operator[SEP] identifier[FreemarkerManager] operator[SEP] identifier[ATTR_TEMPLATE_MODEL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[model] operator[SEP] {
identifier[model] operator[=] identifier[freemarkerManager] operator[SEP] identifier[buildTemplateModel] operator[SEP] identifier[stack] , Other[null] , operator[SEP] identifier[ServletContext] operator[SEP] identifier[context] operator[SEP] identifier[get] operator[SEP] identifier[ServletActionContext] operator[SEP] identifier[SERVLET_CONTEXT] operator[SEP] , identifier[req] , operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[context] operator[SEP] identifier[get] operator[SEP] identifier[ServletActionContext] operator[SEP] identifier[HTTP_RESPONSE] operator[SEP] , identifier[config] operator[SEP] identifier[getObjectWrapper] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[req] operator[SEP] identifier[setAttribute] operator[SEP] identifier[FreemarkerManager] operator[SEP] identifier[ATTR_TEMPLATE_MODEL] , identifier[model] operator[SEP] operator[SEP]
}
Keyword[return] identifier[model] operator[SEP]
}
|
static void lowLevelUncompressPairs(
final int[] pairArray, // output
final int numPairsToDecode, // input, size of output, must be int
final int numBaseBits, // input, cannot exceed 6 bits
final int[] compressedWords, // input
final long numCompressedWords) { // input
int pairIndex = 0;
final long[] ptrArr = new long[3];
int nextWordIndex = 0;
long bitBuf = 0;
int bufBits = 0;
final long golombLoMask = (1L << numBaseBits) - 1L;
int predictedRowIndex = 0;
int predictedColIndex = 0;
// for each pair we need to read:
// xDelta (12-bit length-limited unary)
// yDeltaHi (unary)
// yDeltaLo (basebits)
for (pairIndex = 0; pairIndex < numPairsToDecode; pairIndex++) {
//MAYBE_FILL_BITBUF(compressedWords,wordIndex,12); // ensure 12 bits in bit buffer
if (bufBits < 12) { // Prepare for a 12-bit peek into the bitstream.
bitBuf |= ((compressedWords[nextWordIndex++] & 0XFFFF_FFFFL) << bufBits);
bufBits += 32;
}
final int peek12 = (int) (bitBuf & 0XFFFL);
final int lookup = lengthLimitedUnaryDecodingTable65[peek12] & 0XFFFF;
final int codeWordLength = lookup >>> 8;
final int xDelta = lookup & 0XFF;
bitBuf >>>= codeWordLength;
bufBits -= codeWordLength;
//TODO Inline ReadUnary
ptrArr[NEXT_WORD_IDX] = nextWordIndex;
ptrArr[BIT_BUF] = bitBuf;
ptrArr[BUF_BITS] = bufBits;
assert nextWordIndex == ptrArr[NEXT_WORD_IDX]; //catch sign extension error
final long golombHi = readUnary(compressedWords, ptrArr);
nextWordIndex = (int) ptrArr[NEXT_WORD_IDX];
bitBuf = ptrArr[BIT_BUF];
bufBits = (int) ptrArr[BUF_BITS];
assert nextWordIndex == ptrArr[NEXT_WORD_IDX]; //catch truncation error
//END Inline ReadUnary
//MAYBE_FILL_BITBUF(compressedWords,wordIndex,numBaseBits); // ensure numBaseBits in bit buffer
if (bufBits < numBaseBits) { // Prepare for a numBaseBits peek into the bitstream.
bitBuf |= ((compressedWords[nextWordIndex++] & 0XFFFF_FFFFL) << bufBits);
bufBits += 32;
}
final long golombLo = bitBuf & golombLoMask;
bitBuf >>>= numBaseBits;
bufBits -= numBaseBits;
final long yDelta = (golombHi << numBaseBits) | golombLo;
// Now that we have yDelta and xDelta, we can compute the pair's row and column.
if (yDelta > 0) { predictedColIndex = 0; }
final int rowIndex = predictedRowIndex + (int) yDelta;
final int colIndex = predictedColIndex + xDelta;
final int rowCol = (rowIndex << 6) | colIndex;
pairArray[pairIndex] = rowCol;
predictedRowIndex = rowIndex;
predictedColIndex = colIndex + 1;
}
// check for buffer over-run
assert (nextWordIndex <= numCompressedWords)
: "nextWdIdx: " + nextWordIndex + ", #CompWds: " + numCompressedWords;
} | class class_name[name] begin[{]
method[lowLevelUncompressPairs, return_type[void], modifier[static], parameter[pairArray, numPairsToDecode, numBaseBits, compressedWords, numCompressedWords]] begin[{]
local_variable[type[int], pairIndex]
local_variable[type[long], ptrArr]
local_variable[type[int], nextWordIndex]
local_variable[type[long], bitBuf]
local_variable[type[int], bufBits]
local_variable[type[long], golombLoMask]
local_variable[type[int], predictedRowIndex]
local_variable[type[int], predictedColIndex]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bufBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bitBuf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=compressedWords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=nextWordIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0XFFFF_FFFFL), operator=&), operandr=MemberReference(member=bufBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bufBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=BinaryOperation(operandl=MemberReference(member=bitBuf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0XFFFL), operator=&), type=BasicType(dimensions=[], name=int)), name=peek12)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=lengthLimitedUnaryDecodingTable65, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=peek12, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0XFFFF), operator=&), name=lookup)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=lookup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>>), name=codeWordLength)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=lookup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0XFF), operator=&), name=xDelta)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bitBuf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=>>>=, value=MemberReference(member=codeWordLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bufBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=MemberReference(member=codeWordLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ptrArr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=NEXT_WORD_IDX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=nextWordIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ptrArr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=BIT_BUF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=bitBuf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ptrArr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=BUF_BITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=bufBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=nextWordIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ptrArr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=NEXT_WORD_IDX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator===), label=None, value=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=compressedWords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ptrArr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readUnary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=golombHi)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nextWordIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=ptrArr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=NEXT_WORD_IDX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=BasicType(dimensions=[], name=int))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bitBuf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=ptrArr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=BIT_BUF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bufBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=ptrArr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=BUF_BITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=BasicType(dimensions=[], name=int))), label=None), AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=nextWordIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ptrArr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=NEXT_WORD_IDX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator===), label=None, value=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bufBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numBaseBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bitBuf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=compressedWords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=nextWordIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0XFFFF_FFFFL), operator=&), operandr=MemberReference(member=bufBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bufBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=bitBuf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=golombLoMask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), name=golombLo)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bitBuf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=>>>=, value=MemberReference(member=numBaseBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bufBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=MemberReference(member=numBaseBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=golombHi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numBaseBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<), operandr=MemberReference(member=golombLo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|), name=yDelta)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=yDelta, 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=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=predictedColIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=predictedRowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Cast(expression=MemberReference(member=yDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int)), operator=+), name=rowIndex)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=predictedColIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=xDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=colIndex)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=rowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), operator=<<), operandr=MemberReference(member=colIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|), name=rowCol)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pairArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pairIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=rowCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=predictedRowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=rowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=predictedColIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=colIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=pairIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numPairsToDecode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=pairIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=pairIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=nextWordIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numCompressedWords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), label=None, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="nextWdIdx: "), operandr=MemberReference(member=nextWordIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", #CompWds: "), operator=+), operandr=MemberReference(member=numCompressedWords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))
end[}]
END[}] | Keyword[static] Keyword[void] identifier[lowLevelUncompressPairs] operator[SEP] Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[pairArray] , Keyword[final] Keyword[int] identifier[numPairsToDecode] , Keyword[final] Keyword[int] identifier[numBaseBits] , Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[compressedWords] , Keyword[final] Keyword[long] identifier[numCompressedWords] operator[SEP] {
Keyword[int] identifier[pairIndex] operator[=] Other[0] operator[SEP] Keyword[final] Keyword[long] operator[SEP] operator[SEP] identifier[ptrArr] operator[=] Keyword[new] Keyword[long] operator[SEP] Other[3] operator[SEP] operator[SEP] Keyword[int] identifier[nextWordIndex] operator[=] Other[0] operator[SEP] Keyword[long] identifier[bitBuf] operator[=] Other[0] operator[SEP] Keyword[int] identifier[bufBits] operator[=] Other[0] operator[SEP] Keyword[final] Keyword[long] identifier[golombLoMask] operator[=] operator[SEP] Other[1L] operator[<<] identifier[numBaseBits] operator[SEP] operator[-] Other[1L] operator[SEP] Keyword[int] identifier[predictedRowIndex] operator[=] Other[0] operator[SEP] Keyword[int] identifier[predictedColIndex] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[pairIndex] operator[=] Other[0] operator[SEP] identifier[pairIndex] operator[<] identifier[numPairsToDecode] operator[SEP] identifier[pairIndex] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[bufBits] operator[<] Other[12] operator[SEP] {
identifier[bitBuf] operator[|=] operator[SEP] operator[SEP] identifier[compressedWords] operator[SEP] identifier[nextWordIndex] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] identifier[bufBits] operator[SEP] operator[SEP] identifier[bufBits] operator[+=] Other[32] operator[SEP]
}
Keyword[final] Keyword[int] identifier[peek12] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[bitBuf] operator[&] literal[Integer] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[lookup] operator[=] identifier[lengthLimitedUnaryDecodingTable65] operator[SEP] identifier[peek12] operator[SEP] operator[&] literal[Integer] operator[SEP] Keyword[final] Keyword[int] identifier[codeWordLength] operator[=] identifier[lookup] operator[>] operator[>] operator[>] Other[8] operator[SEP] Keyword[final] Keyword[int] identifier[xDelta] operator[=] identifier[lookup] operator[&] literal[Integer] operator[SEP] identifier[bitBuf] operator[>>>=] identifier[codeWordLength] operator[SEP] identifier[bufBits] operator[-=] identifier[codeWordLength] operator[SEP] identifier[ptrArr] operator[SEP] identifier[NEXT_WORD_IDX] operator[SEP] operator[=] identifier[nextWordIndex] operator[SEP] identifier[ptrArr] operator[SEP] identifier[BIT_BUF] operator[SEP] operator[=] identifier[bitBuf] operator[SEP] identifier[ptrArr] operator[SEP] identifier[BUF_BITS] operator[SEP] operator[=] identifier[bufBits] operator[SEP] Keyword[assert] identifier[nextWordIndex] operator[==] identifier[ptrArr] operator[SEP] identifier[NEXT_WORD_IDX] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[golombHi] operator[=] identifier[readUnary] operator[SEP] identifier[compressedWords] , identifier[ptrArr] operator[SEP] operator[SEP] identifier[nextWordIndex] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[ptrArr] operator[SEP] identifier[NEXT_WORD_IDX] operator[SEP] operator[SEP] identifier[bitBuf] operator[=] identifier[ptrArr] operator[SEP] identifier[BIT_BUF] operator[SEP] operator[SEP] identifier[bufBits] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[ptrArr] operator[SEP] identifier[BUF_BITS] operator[SEP] operator[SEP] Keyword[assert] identifier[nextWordIndex] operator[==] identifier[ptrArr] operator[SEP] identifier[NEXT_WORD_IDX] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bufBits] operator[<] identifier[numBaseBits] operator[SEP] {
identifier[bitBuf] operator[|=] operator[SEP] operator[SEP] identifier[compressedWords] operator[SEP] identifier[nextWordIndex] operator[++] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] identifier[bufBits] operator[SEP] operator[SEP] identifier[bufBits] operator[+=] Other[32] operator[SEP]
}
Keyword[final] Keyword[long] identifier[golombLo] operator[=] identifier[bitBuf] operator[&] identifier[golombLoMask] operator[SEP] identifier[bitBuf] operator[>>>=] identifier[numBaseBits] operator[SEP] identifier[bufBits] operator[-=] identifier[numBaseBits] operator[SEP] Keyword[final] Keyword[long] identifier[yDelta] operator[=] operator[SEP] identifier[golombHi] operator[<<] identifier[numBaseBits] operator[SEP] operator[|] identifier[golombLo] operator[SEP] Keyword[if] operator[SEP] identifier[yDelta] operator[>] Other[0] operator[SEP] {
identifier[predictedColIndex] operator[=] Other[0] operator[SEP]
}
Keyword[final] Keyword[int] identifier[rowIndex] operator[=] identifier[predictedRowIndex] operator[+] operator[SEP] Keyword[int] operator[SEP] identifier[yDelta] operator[SEP] Keyword[final] Keyword[int] identifier[colIndex] operator[=] identifier[predictedColIndex] operator[+] identifier[xDelta] operator[SEP] Keyword[final] Keyword[int] identifier[rowCol] operator[=] operator[SEP] identifier[rowIndex] operator[<<] Other[6] operator[SEP] operator[|] identifier[colIndex] operator[SEP] identifier[pairArray] operator[SEP] identifier[pairIndex] operator[SEP] operator[=] identifier[rowCol] operator[SEP] identifier[predictedRowIndex] operator[=] identifier[rowIndex] operator[SEP] identifier[predictedColIndex] operator[=] identifier[colIndex] operator[+] Other[1] operator[SEP]
}
Keyword[assert] operator[SEP] identifier[nextWordIndex] operator[<=] identifier[numCompressedWords] operator[SEP] operator[:] literal[String] operator[+] identifier[nextWordIndex] operator[+] literal[String] operator[+] identifier[numCompressedWords] operator[SEP]
}
|
public void ifPresentOrElse(@NotNull Consumer<? super T> consumer, @NotNull Runnable emptyAction) {
if (value != null) {
consumer.accept(value);
} else {
emptyAction.run();
}
} | class class_name[name] begin[{]
method[ifPresentOrElse, return_type[void], modifier[public], parameter[consumer, emptyAction]] begin[{]
if[binary_operation[member[.value], !=, literal[null]]] begin[{]
call[consumer.accept, parameter[member[.value]]]
else begin[{]
call[emptyAction.run, parameter[]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[ifPresentOrElse] operator[SEP] annotation[@] identifier[NotNull] identifier[Consumer] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[consumer] , annotation[@] identifier[NotNull] identifier[Runnable] identifier[emptyAction] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] {
identifier[consumer] operator[SEP] identifier[accept] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[emptyAction] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public long addBoxObstacle(float[] center, float[] extents, float yRadians) {
TileCacheObstacle ob = allocObstacle();
ob.type = TileCacheObstacleType.ORIENTED_BOX;
vCopy(ob.center, center);
vCopy(ob.extents, extents);
float coshalf = (float) Math.cos(0.5f * yRadians);
float sinhalf = (float) Math.sin(-0.5f * yRadians);
ob.rotAux[0] = coshalf * sinhalf;
ob.rotAux[1] = coshalf * coshalf - 0.5f;
return addObstacleRequest(ob).ref;
} | class class_name[name] begin[{]
method[addBoxObstacle, return_type[type[long]], modifier[public], parameter[center, extents, yRadians]] begin[{]
local_variable[type[TileCacheObstacle], ob]
assign[member[ob.type], member[TileCacheObstacleType.ORIENTED_BOX]]
call[.vCopy, parameter[member[ob.center], member[.center]]]
call[.vCopy, parameter[member[ob.extents], member[.extents]]]
local_variable[type[float], coshalf]
local_variable[type[float], sinhalf]
assign[member[ob.rotAux], binary_operation[member[.coshalf], *, member[.sinhalf]]]
assign[member[ob.rotAux], binary_operation[binary_operation[member[.coshalf], *, member[.coshalf]], -, literal[0.5f]]]
return[call[.addObstacleRequest, parameter[member[.ob]]]]
end[}]
END[}] | Keyword[public] Keyword[long] identifier[addBoxObstacle] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[center] , Keyword[float] operator[SEP] operator[SEP] identifier[extents] , Keyword[float] identifier[yRadians] operator[SEP] {
identifier[TileCacheObstacle] identifier[ob] operator[=] identifier[allocObstacle] operator[SEP] operator[SEP] operator[SEP] identifier[ob] operator[SEP] identifier[type] operator[=] identifier[TileCacheObstacleType] operator[SEP] identifier[ORIENTED_BOX] operator[SEP] identifier[vCopy] operator[SEP] identifier[ob] operator[SEP] identifier[center] , identifier[center] operator[SEP] operator[SEP] identifier[vCopy] operator[SEP] identifier[ob] operator[SEP] identifier[extents] , identifier[extents] operator[SEP] operator[SEP] Keyword[float] identifier[coshalf] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[Math] operator[SEP] identifier[cos] operator[SEP] literal[Float] operator[*] identifier[yRadians] operator[SEP] operator[SEP] Keyword[float] identifier[sinhalf] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[Math] operator[SEP] identifier[sin] operator[SEP] operator[-] literal[Float] operator[*] identifier[yRadians] operator[SEP] operator[SEP] identifier[ob] operator[SEP] identifier[rotAux] operator[SEP] Other[0] operator[SEP] operator[=] identifier[coshalf] operator[*] identifier[sinhalf] operator[SEP] identifier[ob] operator[SEP] identifier[rotAux] operator[SEP] Other[1] operator[SEP] operator[=] identifier[coshalf] operator[*] identifier[coshalf] operator[-] literal[Float] operator[SEP] Keyword[return] identifier[addObstacleRequest] operator[SEP] identifier[ob] operator[SEP] operator[SEP] identifier[ref] operator[SEP]
}
|
private boolean isQuotableParam(String name){
boolean isQuotableParameter = false;
List<String> params = getQuotableParams();
for (String param : params){
if (param.equalsIgnoreCase(name)){
isQuotableParameter = true;
break;
}
}
return isQuotableParameter;
} | class class_name[name] begin[{]
method[isQuotableParam, return_type[type[boolean]], modifier[private], parameter[name]] begin[{]
local_variable[type[boolean], isQuotableParameter]
local_variable[type[List], params]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isQuotableParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=param)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.isQuotableParameter]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[isQuotableParam] operator[SEP] identifier[String] identifier[name] operator[SEP] {
Keyword[boolean] identifier[isQuotableParameter] operator[=] literal[boolean] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[params] operator[=] identifier[getQuotableParams] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[param] operator[:] identifier[params] operator[SEP] {
Keyword[if] operator[SEP] identifier[param] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[isQuotableParameter] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[return] identifier[isQuotableParameter] operator[SEP]
}
|
public static double getLimitByUserAndCounter(EntityManager em, PrincipalUser user, PolicyCounter counter) {
PolicyLimit pLimit = findPolicyLimitByUserAndCounter(em, user, counter);
if (pLimit != null) {
return pLimit.getLimit();
}
return counter.getDefaultValue();
} | class class_name[name] begin[{]
method[getLimitByUserAndCounter, return_type[type[double]], modifier[public static], parameter[em, user, counter]] begin[{]
local_variable[type[PolicyLimit], pLimit]
if[binary_operation[member[.pLimit], !=, literal[null]]] begin[{]
return[call[pLimit.getLimit, parameter[]]]
else begin[{]
None
end[}]
return[call[counter.getDefaultValue, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[double] identifier[getLimitByUserAndCounter] operator[SEP] identifier[EntityManager] identifier[em] , identifier[PrincipalUser] identifier[user] , identifier[PolicyCounter] identifier[counter] operator[SEP] {
identifier[PolicyLimit] identifier[pLimit] operator[=] identifier[findPolicyLimitByUserAndCounter] operator[SEP] identifier[em] , identifier[user] , identifier[counter] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pLimit] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[pLimit] operator[SEP] identifier[getLimit] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[counter] operator[SEP] identifier[getDefaultValue] operator[SEP] operator[SEP] operator[SEP]
}
|
public void write(@NonNull Normalizer normalizer, @NonNull File file) throws IOException {
try (OutputStream out = new BufferedOutputStream(new FileOutputStream(file))) {
write(normalizer, out);
}
} | class class_name[name] begin[{]
method[write, return_type[void], modifier[public], parameter[normalizer, file]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=normalizer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=out, type=ReferenceType(arguments=None, dimensions=[], name=OutputStream, sub_type=None), value=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedOutputStream, sub_type=None)))])
end[}]
END[}] | Keyword[public] Keyword[void] identifier[write] operator[SEP] annotation[@] identifier[NonNull] identifier[Normalizer] identifier[normalizer] , annotation[@] identifier[NonNull] identifier[File] identifier[file] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[try] operator[SEP] identifier[OutputStream] identifier[out] operator[=] Keyword[new] identifier[BufferedOutputStream] operator[SEP] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] operator[SEP] {
identifier[write] operator[SEP] identifier[normalizer] , identifier[out] operator[SEP] operator[SEP]
}
}
|
private UserProfile readProfile(String userName, Node profileNode) throws RepositoryException
{
UserProfile profile = createUserProfileInstance(userName);
PropertyIterator attributes = profileNode.getProperties();
while (attributes.hasNext())
{
Property prop = attributes.nextProperty();
if (prop.getName().startsWith(ATTRIBUTE_PREFIX))
{
String name = prop.getName().substring(ATTRIBUTE_PREFIX.length());
String value = prop.getString();
profile.setAttribute(name, value);
}
}
return profile;
} | class class_name[name] begin[{]
method[readProfile, return_type[type[UserProfile]], modifier[private], parameter[userName, profileNode]] begin[{]
local_variable[type[UserProfile], profile]
local_variable[type[PropertyIterator], attributes]
while[call[attributes.hasNext, parameter[]]] begin[{]
local_variable[type[Property], prop]
if[call[prop.getName, parameter[]]] begin[{]
local_variable[type[String], name]
local_variable[type[String], value]
call[profile.setAttribute, parameter[member[.name], member[.value]]]
else begin[{]
None
end[}]
end[}]
return[member[.profile]]
end[}]
END[}] | Keyword[private] identifier[UserProfile] identifier[readProfile] operator[SEP] identifier[String] identifier[userName] , identifier[Node] identifier[profileNode] operator[SEP] Keyword[throws] identifier[RepositoryException] {
identifier[UserProfile] identifier[profile] operator[=] identifier[createUserProfileInstance] operator[SEP] identifier[userName] operator[SEP] operator[SEP] identifier[PropertyIterator] identifier[attributes] operator[=] identifier[profileNode] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[attributes] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[Property] identifier[prop] operator[=] identifier[attributes] operator[SEP] identifier[nextProperty] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prop] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[ATTRIBUTE_PREFIX] operator[SEP] operator[SEP] {
identifier[String] identifier[name] operator[=] identifier[prop] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] identifier[ATTRIBUTE_PREFIX] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] identifier[prop] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] identifier[profile] operator[SEP] identifier[setAttribute] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[profile] operator[SEP]
}
|
@VisibleForTesting
static void register(final SpanExporter spanExporter, final SpanExporter.Handler handler) {
spanExporter.registerHandler(REGISTER_NAME, handler);
} | class class_name[name] begin[{]
method[register, return_type[void], modifier[static], parameter[spanExporter, handler]] begin[{]
call[spanExporter.registerHandler, parameter[member[.REGISTER_NAME], member[.handler]]]
end[}]
END[}] | annotation[@] identifier[VisibleForTesting] Keyword[static] Keyword[void] identifier[register] operator[SEP] Keyword[final] identifier[SpanExporter] identifier[spanExporter] , Keyword[final] identifier[SpanExporter] operator[SEP] identifier[Handler] identifier[handler] operator[SEP] {
identifier[spanExporter] operator[SEP] identifier[registerHandler] operator[SEP] identifier[REGISTER_NAME] , identifier[handler] operator[SEP] operator[SEP]
}
|
boolean trySetCancelled() {
synchronized (lock) {
if (complete) {
return false;
}
complete = true;
cancelled = true;
lock.notifyAll();
runContinuations();
return true;
}
} | class class_name[name] begin[{]
method[trySetCancelled, return_type[type[boolean]], modifier[default], parameter[]] begin[{]
SYNCHRONIZED[member[.lock]] BEGIN[{]
if[member[.complete]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
assign[member[.complete], literal[true]]
assign[member[.cancelled], literal[true]]
call[lock.notifyAll, parameter[]]
call[.runContinuations, parameter[]]
return[literal[true]]
END[}]
end[}]
END[}] | Keyword[boolean] identifier[trySetCancelled] operator[SEP] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] {
Keyword[if] operator[SEP] identifier[complete] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[complete] operator[=] literal[boolean] operator[SEP] identifier[cancelled] operator[=] literal[boolean] operator[SEP] identifier[lock] operator[SEP] identifier[notifyAll] operator[SEP] operator[SEP] operator[SEP] identifier[runContinuations] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
}
|
public static Long executeForGeneratedKey(Connection conn, String sql, Map<String, Object> paramMap) throws SQLException {
final NamedSql namedSql = new NamedSql(sql, paramMap);
return executeForGeneratedKey(conn, namedSql.getSql(), namedSql.getParams());
} | class class_name[name] begin[{]
method[executeForGeneratedKey, return_type[type[Long]], modifier[public static], parameter[conn, sql, paramMap]] begin[{]
local_variable[type[NamedSql], namedSql]
return[call[.executeForGeneratedKey, parameter[member[.conn], call[namedSql.getSql, parameter[]], call[namedSql.getParams, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Long] identifier[executeForGeneratedKey] operator[SEP] identifier[Connection] identifier[conn] , identifier[String] identifier[sql] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[paramMap] operator[SEP] Keyword[throws] identifier[SQLException] {
Keyword[final] identifier[NamedSql] identifier[namedSql] operator[=] Keyword[new] identifier[NamedSql] operator[SEP] identifier[sql] , identifier[paramMap] operator[SEP] operator[SEP] Keyword[return] identifier[executeForGeneratedKey] operator[SEP] identifier[conn] , identifier[namedSql] operator[SEP] identifier[getSql] operator[SEP] operator[SEP] , identifier[namedSql] operator[SEP] identifier[getParams] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void createSpace(StorageProvider targetProvider,
String storeId,
String spaceId)
throws StorageException {
targetProvider.createSpace(spaceId);
} | class class_name[name] begin[{]
method[createSpace, return_type[void], modifier[public], parameter[targetProvider, storeId, spaceId]] begin[{]
call[targetProvider.createSpace, parameter[member[.spaceId]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[createSpace] operator[SEP] identifier[StorageProvider] identifier[targetProvider] , identifier[String] identifier[storeId] , identifier[String] identifier[spaceId] operator[SEP] Keyword[throws] identifier[StorageException] {
identifier[targetProvider] operator[SEP] identifier[createSpace] operator[SEP] identifier[spaceId] operator[SEP] operator[SEP]
}
|
public Map getMapOfValue(Object key) {
for (Scope cur=this; cur!=null; cur=cur.parent) {
if (cur.data != null && cur.data.containsKey(key)) {
return cur.data;
}
}
return null;
} | class class_name[name] begin[{]
method[getMapOfValue, return_type[type[Map]], modifier[public], parameter[key]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=cur, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=cur.data, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=cur, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=cur, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), name=cur)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Scope, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=cur, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=cur, selectors=[]))]), label=None)
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[Map] identifier[getMapOfValue] operator[SEP] identifier[Object] identifier[key] operator[SEP] {
Keyword[for] operator[SEP] identifier[Scope] identifier[cur] operator[=] Keyword[this] operator[SEP] identifier[cur] operator[!=] Other[null] operator[SEP] identifier[cur] operator[=] identifier[cur] operator[SEP] identifier[parent] operator[SEP] {
Keyword[if] operator[SEP] identifier[cur] operator[SEP] identifier[data] operator[!=] Other[null] operator[&&] identifier[cur] operator[SEP] identifier[data] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] {
Keyword[return] identifier[cur] operator[SEP] identifier[data] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public void addHeaderItemRule(ItemRule headerItemRule) {
if (headerItemRuleMap == null) {
headerItemRuleMap = new ItemRuleMap();
}
headerItemRuleMap.putItemRule(headerItemRule);
} | class class_name[name] begin[{]
method[addHeaderItemRule, return_type[void], modifier[public], parameter[headerItemRule]] begin[{]
if[binary_operation[member[.headerItemRuleMap], ==, literal[null]]] begin[{]
assign[member[.headerItemRuleMap], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ItemRuleMap, sub_type=None))]
else begin[{]
None
end[}]
call[headerItemRuleMap.putItemRule, parameter[member[.headerItemRule]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addHeaderItemRule] operator[SEP] identifier[ItemRule] identifier[headerItemRule] operator[SEP] {
Keyword[if] operator[SEP] identifier[headerItemRuleMap] operator[==] Other[null] operator[SEP] {
identifier[headerItemRuleMap] operator[=] Keyword[new] identifier[ItemRuleMap] operator[SEP] operator[SEP] operator[SEP]
}
identifier[headerItemRuleMap] operator[SEP] identifier[putItemRule] operator[SEP] identifier[headerItemRule] operator[SEP] operator[SEP]
}
|
public static long getTxInfoCacheWeight(FluoConfiguration conf) {
long size = conf.getLong(TX_INFO_CACHE_WEIGHT, TX_INFO_CACHE_WEIGHT_DEFAULT);
if (size <= 0) {
throw new IllegalArgumentException("Cache size must be positive for " + TX_INFO_CACHE_WEIGHT);
}
return size;
} | class class_name[name] begin[{]
method[getTxInfoCacheWeight, return_type[type[long]], modifier[public static], parameter[conf]] begin[{]
local_variable[type[long], size]
if[binary_operation[member[.size], <=, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cache size must be positive for "), operandr=MemberReference(member=TX_INFO_CACHE_WEIGHT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.size]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[long] identifier[getTxInfoCacheWeight] operator[SEP] identifier[FluoConfiguration] identifier[conf] operator[SEP] {
Keyword[long] identifier[size] operator[=] identifier[conf] operator[SEP] identifier[getLong] operator[SEP] identifier[TX_INFO_CACHE_WEIGHT] , identifier[TX_INFO_CACHE_WEIGHT_DEFAULT] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[<=] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[TX_INFO_CACHE_WEIGHT] operator[SEP] operator[SEP]
}
Keyword[return] identifier[size] operator[SEP]
}
|
public double readDouble(double defaultValue, String attribute)
{
return Double.parseDouble(getValue(String.valueOf(defaultValue), attribute));
} | class class_name[name] begin[{]
method[readDouble, return_type[type[double]], modifier[public], parameter[defaultValue, attribute]] begin[{]
return[call[Double.parseDouble, parameter[call[.getValue, parameter[call[String.valueOf, parameter[member[.defaultValue]]], member[.attribute]]]]]]
end[}]
END[}] | Keyword[public] Keyword[double] identifier[readDouble] operator[SEP] Keyword[double] identifier[defaultValue] , identifier[String] identifier[attribute] operator[SEP] {
Keyword[return] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[getValue] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[defaultValue] operator[SEP] , identifier[attribute] operator[SEP] operator[SEP] operator[SEP]
}
|
protected AddressArray createAddressArray(File homeDir,
int batchSize,
int numSyncBatches,
boolean indexesCached) throws Exception {
AddressArrayFactory factory = new AddressArrayFactory(indexesCached);
AddressArray addrArray = factory.createDynamicAddressArray(homeDir, batchSize, numSyncBatches);
return addrArray;
} | class class_name[name] begin[{]
method[createAddressArray, return_type[type[AddressArray]], modifier[protected], parameter[homeDir, batchSize, numSyncBatches, indexesCached]] begin[{]
local_variable[type[AddressArrayFactory], factory]
local_variable[type[AddressArray], addrArray]
return[member[.addrArray]]
end[}]
END[}] | Keyword[protected] identifier[AddressArray] identifier[createAddressArray] operator[SEP] identifier[File] identifier[homeDir] , Keyword[int] identifier[batchSize] , Keyword[int] identifier[numSyncBatches] , Keyword[boolean] identifier[indexesCached] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[AddressArrayFactory] identifier[factory] operator[=] Keyword[new] identifier[AddressArrayFactory] operator[SEP] identifier[indexesCached] operator[SEP] operator[SEP] identifier[AddressArray] identifier[addrArray] operator[=] identifier[factory] operator[SEP] identifier[createDynamicAddressArray] operator[SEP] identifier[homeDir] , identifier[batchSize] , identifier[numSyncBatches] operator[SEP] operator[SEP] Keyword[return] identifier[addrArray] operator[SEP]
}
|
public static String buildCleanedParametersURIRepresentation(org.apache.commons.httpclient.URI uri,
SpiderParam.HandleParametersOption handleParameters, boolean handleODataParametersVisited) throws URIException {
// If the option is set to use all the information, just use the default string representation
if (handleParameters.equals(HandleParametersOption.USE_ALL)) {
return uri.toString();
}
// If the option is set to ignore parameters completely, ignore the query completely
if (handleParameters.equals(HandleParametersOption.IGNORE_COMPLETELY)) {
return createBaseUriWithCleanedPath(uri, handleParameters, handleODataParametersVisited);
}
// If the option is set to ignore the value, we get the parameters and we only add their name to the
// query
if (handleParameters.equals(HandleParametersOption.IGNORE_VALUE)) {
StringBuilder retVal = new StringBuilder(
createBaseUriWithCleanedPath(uri, handleParameters, handleODataParametersVisited));
String cleanedQuery = getCleanedQuery(uri.getEscapedQuery());
// Add the parameters' names to the uri representation.
if(cleanedQuery.length()>0) {
retVal.append('?').append(cleanedQuery);
}
return retVal.toString();
}
// Should not be reached
return uri.toString();
} | class class_name[name] begin[{]
method[buildCleanedParametersURIRepresentation, return_type[type[String]], modifier[public static], parameter[uri, handleParameters, handleODataParametersVisited]] begin[{]
if[call[handleParameters.equals, parameter[member[HandleParametersOption.USE_ALL]]]] begin[{]
return[call[uri.toString, parameter[]]]
else begin[{]
None
end[}]
if[call[handleParameters.equals, parameter[member[HandleParametersOption.IGNORE_COMPLETELY]]]] begin[{]
return[call[.createBaseUriWithCleanedPath, parameter[member[.uri], member[.handleParameters], member[.handleODataParametersVisited]]]]
else begin[{]
None
end[}]
if[call[handleParameters.equals, parameter[member[HandleParametersOption.IGNORE_VALUE]]]] begin[{]
local_variable[type[StringBuilder], retVal]
local_variable[type[String], cleanedQuery]
if[binary_operation[call[cleanedQuery.length, parameter[]], >, literal[0]]] begin[{]
call[retVal.append, parameter[literal['?']]]
else begin[{]
None
end[}]
return[call[retVal.toString, parameter[]]]
else begin[{]
None
end[}]
return[call[uri.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[buildCleanedParametersURIRepresentation] operator[SEP] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[commons] operator[SEP] identifier[httpclient] operator[SEP] identifier[URI] identifier[uri] , identifier[SpiderParam] operator[SEP] identifier[HandleParametersOption] identifier[handleParameters] , Keyword[boolean] identifier[handleODataParametersVisited] operator[SEP] Keyword[throws] identifier[URIException] {
Keyword[if] operator[SEP] identifier[handleParameters] operator[SEP] identifier[equals] operator[SEP] identifier[HandleParametersOption] operator[SEP] identifier[USE_ALL] operator[SEP] operator[SEP] {
Keyword[return] identifier[uri] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[handleParameters] operator[SEP] identifier[equals] operator[SEP] identifier[HandleParametersOption] operator[SEP] identifier[IGNORE_COMPLETELY] operator[SEP] operator[SEP] {
Keyword[return] identifier[createBaseUriWithCleanedPath] operator[SEP] identifier[uri] , identifier[handleParameters] , identifier[handleODataParametersVisited] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[handleParameters] operator[SEP] identifier[equals] operator[SEP] identifier[HandleParametersOption] operator[SEP] identifier[IGNORE_VALUE] operator[SEP] operator[SEP] {
identifier[StringBuilder] identifier[retVal] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[createBaseUriWithCleanedPath] operator[SEP] identifier[uri] , identifier[handleParameters] , identifier[handleODataParametersVisited] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[cleanedQuery] operator[=] identifier[getCleanedQuery] operator[SEP] identifier[uri] operator[SEP] identifier[getEscapedQuery] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cleanedQuery] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[retVal] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[cleanedQuery] operator[SEP] operator[SEP]
}
Keyword[return] identifier[retVal] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[uri] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String resolveTemplate(String rawString, Table table) {
if (StringUtils.isBlank(rawString)) {
return rawString;
}
return StringUtils.replaceEach(rawString, new String[] { DATABASE_TOKEN, TABLE_TOKEN }, new String[] { table.getDbName(), table.getTableName() });
} | class class_name[name] begin[{]
method[resolveTemplate, return_type[type[String]], modifier[public static], parameter[rawString, table]] begin[{]
if[call[StringUtils.isBlank, parameter[member[.rawString]]]] begin[{]
return[member[.rawString]]
else begin[{]
None
end[}]
return[call[StringUtils.replaceEach, parameter[member[.rawString], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=DATABASE_TOKEN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=TABLE_TOKEN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getDbName, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getTableName, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[resolveTemplate] operator[SEP] identifier[String] identifier[rawString] , identifier[Table] identifier[table] operator[SEP] {
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[rawString] operator[SEP] operator[SEP] {
Keyword[return] identifier[rawString] operator[SEP]
}
Keyword[return] identifier[StringUtils] operator[SEP] identifier[replaceEach] operator[SEP] identifier[rawString] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[DATABASE_TOKEN] , identifier[TABLE_TOKEN]
} , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[table] operator[SEP] identifier[getDbName] operator[SEP] operator[SEP] , identifier[table] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP]
}
|
public static List<Number> findIndexValues(Object self, Number startIndex, Closure closure) {
List<Number> result = new ArrayList<Number>();
long count = 0;
long startCount = startIndex.longValue();
BooleanClosureWrapper bcw = new BooleanClosureWrapper(closure);
for (Iterator iter = InvokerHelper.asIterator(self); iter.hasNext(); count++) {
Object value = iter.next();
if (count < startCount) {
continue;
}
if (bcw.call(value)) {
result.add(count);
}
}
return result;
} | class class_name[name] begin[{]
method[findIndexValues, return_type[type[List]], modifier[public static], parameter[self, startIndex, closure]] begin[{]
local_variable[type[List], result]
local_variable[type[long], count]
local_variable[type[long], startCount]
local_variable[type[BooleanClosureWrapper], bcw]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=startCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=call, postfix_operators=[], prefix_operators=[], qualifier=bcw, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[MemberReference(member=self, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asIterator, postfix_operators=[], prefix_operators=[], qualifier=InvokerHelper, selectors=[], type_arguments=None), name=iter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=[MemberReference(member=count, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Number] operator[>] identifier[findIndexValues] operator[SEP] identifier[Object] identifier[self] , identifier[Number] identifier[startIndex] , identifier[Closure] identifier[closure] operator[SEP] {
identifier[List] operator[<] identifier[Number] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Number] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[count] operator[=] Other[0] operator[SEP] Keyword[long] identifier[startCount] operator[=] identifier[startIndex] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] identifier[BooleanClosureWrapper] identifier[bcw] operator[=] Keyword[new] identifier[BooleanClosureWrapper] operator[SEP] identifier[closure] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] identifier[iter] operator[=] identifier[InvokerHelper] operator[SEP] identifier[asIterator] operator[SEP] identifier[self] operator[SEP] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] identifier[count] operator[++] operator[SEP] {
identifier[Object] identifier[value] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[count] operator[<] identifier[startCount] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[bcw] operator[SEP] identifier[call] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[count] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
public static ImmutableList<SoyMsgPart> convertMsgPartsToEmbeddedIcuSyntax(
ImmutableList<SoyMsgPart> origMsgParts) {
// If origMsgParts doesn't have plural/select parts, simply return it.
if (!MsgPartUtils.hasPlrselPart(origMsgParts)) {
return origMsgParts;
}
// Build the new msg parts.
ImmutableList.Builder<SoyMsgPart> newMsgPartsBuilder = ImmutableList.builder();
StringBuilder currRawTextSb = new StringBuilder();
convertMsgPartsHelper(
newMsgPartsBuilder, currRawTextSb, origMsgParts, /* isInPlrselPart= */ false);
if (currRawTextSb.length() > 0) {
newMsgPartsBuilder.add(SoyMsgRawTextPart.of(currRawTextSb.toString()));
}
return newMsgPartsBuilder.build();
} | class class_name[name] begin[{]
method[convertMsgPartsToEmbeddedIcuSyntax, return_type[type[ImmutableList]], modifier[public static], parameter[origMsgParts]] begin[{]
if[call[MsgPartUtils.hasPlrselPart, parameter[member[.origMsgParts]]]] begin[{]
return[member[.origMsgParts]]
else begin[{]
None
end[}]
local_variable[type[ImmutableList], newMsgPartsBuilder]
local_variable[type[StringBuilder], currRawTextSb]
call[.convertMsgPartsHelper, parameter[member[.newMsgPartsBuilder], member[.currRawTextSb], member[.origMsgParts], literal[false]]]
if[binary_operation[call[currRawTextSb.length, parameter[]], >, literal[0]]] begin[{]
call[newMsgPartsBuilder.add, parameter[call[SoyMsgRawTextPart.of, parameter[call[currRawTextSb.toString, parameter[]]]]]]
else begin[{]
None
end[}]
return[call[newMsgPartsBuilder.build, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ImmutableList] operator[<] identifier[SoyMsgPart] operator[>] identifier[convertMsgPartsToEmbeddedIcuSyntax] operator[SEP] identifier[ImmutableList] operator[<] identifier[SoyMsgPart] operator[>] identifier[origMsgParts] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[MsgPartUtils] operator[SEP] identifier[hasPlrselPart] operator[SEP] identifier[origMsgParts] operator[SEP] operator[SEP] {
Keyword[return] identifier[origMsgParts] operator[SEP]
}
identifier[ImmutableList] operator[SEP] identifier[Builder] operator[<] identifier[SoyMsgPart] operator[>] identifier[newMsgPartsBuilder] operator[=] identifier[ImmutableList] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[currRawTextSb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[convertMsgPartsHelper] operator[SEP] identifier[newMsgPartsBuilder] , identifier[currRawTextSb] , identifier[origMsgParts] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currRawTextSb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[newMsgPartsBuilder] operator[SEP] identifier[add] operator[SEP] identifier[SoyMsgRawTextPart] operator[SEP] identifier[of] operator[SEP] identifier[currRawTextSb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[newMsgPartsBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
public static <T extends ImageGray<T>, TD extends TupleDesc>
DetectDescribePoint<T, TD> createFromPremade( Class<T> imageType ) {
return (DetectDescribePoint)FactoryDetectDescribe.surfStable(
new ConfigFastHessian(1, 2, 200, 1, 9, 4, 4), null,null, imageType);
// return (DetectDescribePoint)FactoryDetectDescribe.sift(new ConfigCompleteSift(-1,5,300));
} | class class_name[name] begin[{]
method[createFromPremade, return_type[type[DetectDescribePoint]], modifier[public static], parameter[imageType]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=200), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=9), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigFastHessian, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=imageType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=surfStable, postfix_operators=[], prefix_operators=[], qualifier=FactoryDetectDescribe, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=DetectDescribePoint, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[ImageGray] operator[<] identifier[T] operator[>] , identifier[TD] Keyword[extends] identifier[TupleDesc] operator[>] identifier[DetectDescribePoint] operator[<] identifier[T] , identifier[TD] operator[>] identifier[createFromPremade] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[imageType] operator[SEP] {
Keyword[return] operator[SEP] identifier[DetectDescribePoint] operator[SEP] identifier[FactoryDetectDescribe] operator[SEP] identifier[surfStable] operator[SEP] Keyword[new] identifier[ConfigFastHessian] operator[SEP] Other[1] , Other[2] , Other[200] , Other[1] , Other[9] , Other[4] , Other[4] operator[SEP] , Other[null] , Other[null] , identifier[imageType] operator[SEP] operator[SEP]
}
|
public Map<Class<?>, ThreadLocalProxy<?>> getConstructorProxies() {
if (constructorProxiesAvailable) {
return getConstructorProxyMap(false).get(serviceClass);
}
return null;
} | class class_name[name] begin[{]
method[getConstructorProxies, return_type[type[Map]], modifier[public], parameter[]] begin[{]
if[member[.constructorProxiesAvailable]] begin[{]
return[call[.getConstructorProxyMap, parameter[literal[false]]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[Map] operator[<] identifier[Class] operator[<] operator[?] operator[>] , identifier[ThreadLocalProxy] operator[<] operator[?] operator[>] operator[>] identifier[getConstructorProxies] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[constructorProxiesAvailable] operator[SEP] {
Keyword[return] identifier[getConstructorProxyMap] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[serviceClass] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public void marshall(LogPublishingOption logPublishingOption, ProtocolMarshaller protocolMarshaller) {
if (logPublishingOption == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(logPublishingOption.getCloudWatchLogsLogGroupArn(), CLOUDWATCHLOGSLOGGROUPARN_BINDING);
protocolMarshaller.marshall(logPublishingOption.getEnabled(), ENABLED_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[logPublishingOption, protocolMarshaller]] begin[{]
if[binary_operation[member[.logPublishingOption], ==, 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=getCloudWatchLogsLogGroupArn, postfix_operators=[], prefix_operators=[], qualifier=logPublishingOption, selectors=[], type_arguments=None), MemberReference(member=CLOUDWATCHLOGSLOGGROUPARN_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=getEnabled, postfix_operators=[], prefix_operators=[], qualifier=logPublishingOption, selectors=[], type_arguments=None), MemberReference(member=ENABLED_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[LogPublishingOption] identifier[logPublishingOption] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[logPublishingOption] 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[logPublishingOption] operator[SEP] identifier[getCloudWatchLogsLogGroupArn] operator[SEP] operator[SEP] , identifier[CLOUDWATCHLOGSLOGGROUPARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[logPublishingOption] operator[SEP] identifier[getEnabled] operator[SEP] operator[SEP] , identifier[ENABLED_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void runTask(Handler<Task> task) {
if (currentTask == null) {
currentTask = new Task(this);
task.handle(currentTask);
} else {
queue.add(task);
}
} | class class_name[name] begin[{]
method[runTask, return_type[void], modifier[public], parameter[task]] begin[{]
if[binary_operation[member[.currentTask], ==, literal[null]]] begin[{]
assign[member[.currentTask], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Task, sub_type=None))]
call[task.handle, parameter[member[.currentTask]]]
else begin[{]
call[queue.add, parameter[member[.task]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[runTask] operator[SEP] identifier[Handler] operator[<] identifier[Task] operator[>] identifier[task] operator[SEP] {
Keyword[if] operator[SEP] identifier[currentTask] operator[==] Other[null] operator[SEP] {
identifier[currentTask] operator[=] Keyword[new] identifier[Task] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[task] operator[SEP] identifier[handle] operator[SEP] identifier[currentTask] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[queue] operator[SEP] identifier[add] operator[SEP] identifier[task] operator[SEP] operator[SEP]
}
}
|
@Override
public JsonElement serialize(DateMidnight src, Type typeOfSrc, JsonSerializationContext context)
{
final DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
return new JsonPrimitive(fmt.print(src));
} | class class_name[name] begin[{]
method[serialize, return_type[type[JsonElement]], modifier[public], parameter[src, typeOfSrc, context]] begin[{]
local_variable[type[DateTimeFormatter], fmt]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=fmt, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonPrimitive, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[JsonElement] identifier[serialize] operator[SEP] identifier[DateMidnight] identifier[src] , identifier[Type] identifier[typeOfSrc] , identifier[JsonSerializationContext] identifier[context] operator[SEP] {
Keyword[final] identifier[DateTimeFormatter] identifier[fmt] operator[=] identifier[ISODateTimeFormat] operator[SEP] identifier[dateTime] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[JsonPrimitive] operator[SEP] identifier[fmt] operator[SEP] identifier[print] operator[SEP] identifier[src] operator[SEP] operator[SEP] operator[SEP]
}
|
public ManagedConnection matchManagedConnections(@SuppressWarnings("rawtypes") final Set connectionSet,
final Subject subject, ConnectionRequestInfo cxRequestInfo)
throws ResourceException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(this, tc, "matchManagedConnections", connectionSet == null ? null : connectionSet.size(),
subject == null ? null : "subject", cxRequestInfo);
// Return null (no match) if null is specified for the set of connections.
if (connectionSet == null)
{
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(this, tc, "matchManagedConnections", null);
return null;
}
// Convert the CRI to the RRA implementation class. If the CRI doesn't convert, then
// we cannot find a match.
final WSConnectionRequestInfoImpl finalCRI;
try {
finalCRI = (WSConnectionRequestInfoImpl) cxRequestInfo;
} catch (ClassCastException castX) {
// No FFDC code needed. If it's not the RRA's CRI class, then it doesn't match.
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(this, tc, "matchManagedConnections", null);
return null;
}
// Need to keep this variable because currentmc will end up not being null but
// may not be a match
WSRdbManagedConnectionImpl matchedmc = null;
// the J2c component will always send us a set of one and only one mc. Therefore, there
// is no need to go through a loop. Just far sanity check, i am printing the size in a debug
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(this, tc, "the size of the set should be 1, and it is", connectionSet.size());
WSRdbManagedConnectionImpl currentmc;
Iterator<?> iter = connectionSet.iterator();
currentmc = (WSRdbManagedConnectionImpl) iter.next();
//: if the mc is claimed victim, means it never matched the initial hash test done by j2c,
// so at this point, we know that reauthentication is enabled and connection needs to be
// reauthenticated, so ignore the subject and do the isReconfigurable checkign only.
if (currentmc._claimedVictim && finalCRI.isReconfigurable(currentmc.cri, true)) {
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(this, tc, "mc is claimedVictim matched", currentmc);
matchedmc = currentmc;
} else if (subject == null) // no reauthentication is enabled from here on
{
// Compare using .isReconfigurable instead of .equals in order to return
// any ManagedConnection that can be made to match the CRI instead of only those
// ManagedConnections which already match.
// The DataSource Config ID field of the CRI is not considered reconfigurable
// for a connection.
if ((currentmc.getSubject() == null) &&
finalCRI.isReconfigurable(currentmc.cri, false))
{
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(this, tc, "mc matched", currentmc);
matchedmc = currentmc;
}
} else {
Subject _sub = currentmc.getSubject();
if (_sub != null)
{
Equals e = new Equals();
e.setSubjects(subject, _sub);
if (((Boolean) (AccessController.doPrivileged(e))).booleanValue() &&
finalCRI.isReconfigurable(currentmc.cri, false)) {
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(this, tc, "mc matched", currentmc);
matchedmc = currentmc;
}
}
}
//Removed a call to matchedmc.setAutoCommit(defaultAutoCommit)
// because it should now be reset before putting it back into
// the pool
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(this, tc, "matchManagedConnections", matchedmc);
return matchedmc;
} | class class_name[name] begin[{]
method[matchManagedConnections, return_type[type[ManagedConnection]], modifier[public], parameter[connectionSet, subject, cxRequestInfo]] begin[{]
local_variable[type[boolean], isTraceOn]
if[binary_operation[member[.isTraceOn], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[Tr.entry, parameter[THIS[], member[.tc], literal["matchManagedConnections"], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=connectionSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=connectionSet, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=subject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="subject"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), member[.cxRequestInfo]]]
else begin[{]
None
end[}]
if[binary_operation[member[.connectionSet], ==, literal[null]]] begin[{]
if[binary_operation[member[.isTraceOn], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[Tr.exit, parameter[THIS[], member[.tc], literal["matchManagedConnections"], literal[null]]]
else begin[{]
None
end[}]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[WSConnectionRequestInfoImpl], finalCRI]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=finalCRI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=cxRequestInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WSConnectionRequestInfoImpl, sub_type=None))), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isTraceOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="matchManagedConnections"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, 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=castX, types=['ClassCastException']))], finally_block=None, label=None, resources=None)
local_variable[type[WSRdbManagedConnectionImpl], matchedmc]
if[binary_operation[member[.isTraceOn], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[THIS[], member[.tc], literal["the size of the set should be 1, and it is"], call[connectionSet.size, parameter[]]]]
else begin[{]
None
end[}]
local_variable[type[WSRdbManagedConnectionImpl], currentmc]
local_variable[type[Iterator], iter]
assign[member[.currentmc], Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=WSRdbManagedConnectionImpl, sub_type=None))]
if[binary_operation[member[currentmc._claimedVictim], &&, call[finalCRI.isReconfigurable, parameter[member[currentmc.cri], literal[true]]]]] begin[{]
if[binary_operation[member[.isTraceOn], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[THIS[], member[.tc], literal["mc is claimedVictim matched"], member[.currentmc]]]
else begin[{]
None
end[}]
assign[member[.matchedmc], member[.currentmc]]
else begin[{]
if[binary_operation[member[.subject], ==, literal[null]]] begin[{]
if[binary_operation[binary_operation[call[currentmc.getSubject, parameter[]], ==, literal[null]], &&, call[finalCRI.isReconfigurable, parameter[member[currentmc.cri], literal[false]]]]] begin[{]
if[binary_operation[member[.isTraceOn], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[THIS[], member[.tc], literal["mc matched"], member[.currentmc]]]
else begin[{]
None
end[}]
assign[member[.matchedmc], member[.currentmc]]
else begin[{]
None
end[}]
else begin[{]
local_variable[type[Subject], _sub]
if[binary_operation[member[._sub], !=, literal[null]]] begin[{]
local_variable[type[Equals], e]
call[e.setSubjects, parameter[member[.subject], member[._sub]]]
if[binary_operation[Cast(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doPrivileged, postfix_operators=[], prefix_operators=[], qualifier=AccessController, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None)), &&, call[finalCRI.isReconfigurable, parameter[member[currentmc.cri], literal[false]]]]] begin[{]
if[binary_operation[member[.isTraceOn], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[THIS[], member[.tc], literal["mc matched"], member[.currentmc]]]
else begin[{]
None
end[}]
assign[member[.matchedmc], member[.currentmc]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
end[}]
if[binary_operation[member[.isTraceOn], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[Tr.exit, parameter[THIS[], member[.tc], literal["matchManagedConnections"], member[.matchedmc]]]
else begin[{]
None
end[}]
return[member[.matchedmc]]
end[}]
END[}] | Keyword[public] identifier[ManagedConnection] identifier[matchManagedConnections] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[Set] identifier[connectionSet] , Keyword[final] identifier[Subject] identifier[subject] , identifier[ConnectionRequestInfo] identifier[cxRequestInfo] operator[SEP] Keyword[throws] identifier[ResourceException] {
Keyword[final] Keyword[boolean] identifier[isTraceOn] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[connectionSet] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[connectionSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[subject] operator[==] Other[null] operator[?] Other[null] operator[:] literal[String] , identifier[cxRequestInfo] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[connectionSet] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , Other[null] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
Keyword[final] identifier[WSConnectionRequestInfoImpl] identifier[finalCRI] operator[SEP] Keyword[try] {
identifier[finalCRI] operator[=] operator[SEP] identifier[WSConnectionRequestInfoImpl] operator[SEP] identifier[cxRequestInfo] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[castX] operator[SEP] {
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , Other[null] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
identifier[WSRdbManagedConnectionImpl] identifier[matchedmc] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[connectionSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[WSRdbManagedConnectionImpl] identifier[currentmc] operator[SEP] identifier[Iterator] operator[<] operator[?] operator[>] identifier[iter] operator[=] identifier[connectionSet] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[currentmc] operator[=] operator[SEP] identifier[WSRdbManagedConnectionImpl] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentmc] operator[SEP] identifier[_claimedVictim] operator[&&] identifier[finalCRI] operator[SEP] identifier[isReconfigurable] operator[SEP] identifier[currentmc] operator[SEP] identifier[cri] , literal[boolean] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[currentmc] operator[SEP] operator[SEP] identifier[matchedmc] operator[=] identifier[currentmc] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[subject] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[currentmc] operator[SEP] identifier[getSubject] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[&&] identifier[finalCRI] operator[SEP] identifier[isReconfigurable] operator[SEP] identifier[currentmc] operator[SEP] identifier[cri] , literal[boolean] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[currentmc] operator[SEP] operator[SEP] identifier[matchedmc] operator[=] identifier[currentmc] operator[SEP]
}
}
Keyword[else] {
identifier[Subject] identifier[_sub] operator[=] identifier[currentmc] operator[SEP] identifier[getSubject] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_sub] operator[!=] Other[null] operator[SEP] {
identifier[Equals] identifier[e] operator[=] Keyword[new] identifier[Equals] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setSubjects] operator[SEP] identifier[subject] , identifier[_sub] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[Boolean] operator[SEP] operator[SEP] identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[&&] identifier[finalCRI] operator[SEP] identifier[isReconfigurable] operator[SEP] identifier[currentmc] operator[SEP] identifier[cri] , literal[boolean] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[currentmc] operator[SEP] operator[SEP] identifier[matchedmc] operator[=] identifier[currentmc] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[matchedmc] operator[SEP] operator[SEP] Keyword[return] identifier[matchedmc] operator[SEP]
}
|
public static double angle(Circle circle, double x, double y)
{
return angle(circle.getX(), circle.getY(), x, y);
} | class class_name[name] begin[{]
method[angle, return_type[type[double]], modifier[public static], parameter[circle, x, y]] begin[{]
return[call[.angle, parameter[call[circle.getX, parameter[]], call[circle.getY, parameter[]], member[.x], member[.y]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[double] identifier[angle] operator[SEP] identifier[Circle] identifier[circle] , Keyword[double] identifier[x] , Keyword[double] identifier[y] operator[SEP] {
Keyword[return] identifier[angle] operator[SEP] identifier[circle] operator[SEP] identifier[getX] operator[SEP] operator[SEP] , identifier[circle] operator[SEP] identifier[getY] operator[SEP] operator[SEP] , identifier[x] , identifier[y] operator[SEP] operator[SEP]
}
|
public static Distribution guessSigma(DataSet d, DistanceMetric dist)
{
//we will use a simple strategy of estimating the mean sigma to test based on the pair wise distances of random points
//to avoid n^2 work for this, we will use a sqrt(n) sized sample as n increases so that we only do O(n) work
List<Vec> allVecs = d.getDataVectors();
int toSample = d.size();
if (toSample > 5000)
toSample = 5000 + (int) Math.floor(Math.sqrt(d.size() - 5000));
DoubleList vals = new DoubleList(toSample*toSample);
if (d instanceof ClassificationDataSet && ((ClassificationDataSet) d).getPredicting().getNumOfCategories() == 2)
{
ClassificationDataSet cdata = (ClassificationDataSet) d;
List<Vec> class0 = new ArrayList<Vec>(toSample / 2);
List<Vec> class1 = new ArrayList<Vec>(toSample / 2);
IntList randOrder = new IntList(d.size());
ListUtils.addRange(randOrder, 0, d.size(), 1);
Collections.shuffle(randOrder);
//collet a random sample of data
for (int i = 0; i < randOrder.size(); i++)
{
int indx = randOrder.getI(i);
if (cdata.getDataPointCategory(indx) == 0 && class0.size() < toSample / 2)
class0.add(cdata.getDataPoint(indx).getNumericalValues());
else if (cdata.getDataPointCategory(indx) == 1 && class0.size() < toSample / 2)
class1.add(cdata.getDataPoint(indx).getNumericalValues());
}
int j_start = class0.size();
class0.addAll(class1);
List<Double> cache = dist.getAccelerationCache(class0);
for (int i = 0; i < j_start; i++)
for (int j = j_start; j < class0.size(); j++)
vals.add(dist.dist(i, j, allVecs, cache));
}
else
{
Collections.shuffle(allVecs);
if (d.size() > 5000)
allVecs = allVecs.subList(0, toSample);
List<Double> cache = dist.getAccelerationCache(allVecs);
for (int i = 0; i < allVecs.size(); i++)
for (int j = i + 1; j < allVecs.size(); j++)
vals.add(dist.dist(i, j, allVecs, cache));
}
Collections.sort(vals);
double median = vals.get(vals.size()/2);
return new LogUniform(Math.exp(Math.log(median)-4), Math.exp(Math.log(median)+4));
} | class class_name[name] begin[{]
method[guessSigma, return_type[type[Distribution]], modifier[public static], parameter[d, dist]] begin[{]
local_variable[type[List], allVecs]
local_variable[type[int], toSample]
if[binary_operation[member[.toSample], >, literal[5000]]] begin[{]
assign[member[.toSample], binary_operation[literal[5000], +, Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=d, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5000), operator=-)], member=sqrt, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)], member=floor, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))]]
else begin[{]
None
end[}]
local_variable[type[DoubleList], vals]
if[binary_operation[binary_operation[member[.d], instanceof, type[ClassificationDataSet]], &&, binary_operation[Cast(expression=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ClassificationDataSet, sub_type=None)), ==, literal[2]]]] begin[{]
local_variable[type[ClassificationDataSet], cdata]
local_variable[type[List], class0]
local_variable[type[List], class1]
local_variable[type[IntList], randOrder]
call[ListUtils.addRange, parameter[member[.randOrder], literal[0], call[d.size, parameter[]], literal[1]]]
call[Collections.shuffle, parameter[member[.randOrder]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getI, postfix_operators=[], prefix_operators=[], qualifier=randOrder, selectors=[], type_arguments=None), name=indx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=indx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDataPointCategory, postfix_operators=[], prefix_operators=[], qualifier=cdata, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=class0, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=toSample, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operator=<), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=indx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDataPointCategory, postfix_operators=[], prefix_operators=[], qualifier=cdata, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=class0, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=toSample, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operator=<), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=indx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDataPoint, postfix_operators=[], prefix_operators=[], qualifier=cdata, selectors=[MethodInvocation(arguments=[], member=getNumericalValues, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=class1, selectors=[], type_arguments=None), label=None)), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=indx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDataPoint, postfix_operators=[], prefix_operators=[], qualifier=cdata, selectors=[MethodInvocation(arguments=[], member=getNumericalValues, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=class0, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=randOrder, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[int], j_start]
call[class0.addAll, parameter[member[.class1]]]
local_variable[type[List], cache]
ForStatement(body=ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=allVecs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=dist, postfix_operators=[], prefix_operators=[], qualifier=dist, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=vals, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=class0, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=j_start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=MemberReference(member=j_start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
call[Collections.shuffle, parameter[member[.allVecs]]]
if[binary_operation[call[d.size, parameter[]], >, literal[5000]]] begin[{]
assign[member[.allVecs], call[allVecs.subList, parameter[literal[0], member[.toSample]]]]
else begin[{]
None
end[}]
local_variable[type[List], cache]
ForStatement(body=ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=allVecs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=dist, postfix_operators=[], prefix_operators=[], qualifier=dist, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=vals, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=allVecs, selectors=[], type_arguments=None), 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=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=allVecs, 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[}]
call[Collections.sort, parameter[member[.vals]]]
local_variable[type[double], median]
return[ClassCreator(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=median, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=-)], member=exp, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=median, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=+)], member=exp, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LogUniform, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Distribution] identifier[guessSigma] operator[SEP] identifier[DataSet] identifier[d] , identifier[DistanceMetric] identifier[dist] operator[SEP] {
identifier[List] operator[<] identifier[Vec] operator[>] identifier[allVecs] operator[=] identifier[d] operator[SEP] identifier[getDataVectors] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[toSample] operator[=] identifier[d] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[toSample] operator[>] Other[5000] operator[SEP] identifier[toSample] operator[=] Other[5000] operator[+] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[floor] operator[SEP] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[d] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[5000] operator[SEP] operator[SEP] operator[SEP] identifier[DoubleList] identifier[vals] operator[=] Keyword[new] identifier[DoubleList] operator[SEP] identifier[toSample] operator[*] identifier[toSample] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[d] Keyword[instanceof] identifier[ClassificationDataSet] operator[&&] operator[SEP] operator[SEP] identifier[ClassificationDataSet] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[getPredicting] operator[SEP] operator[SEP] operator[SEP] identifier[getNumOfCategories] operator[SEP] operator[SEP] operator[==] Other[2] operator[SEP] {
identifier[ClassificationDataSet] identifier[cdata] operator[=] operator[SEP] identifier[ClassificationDataSet] operator[SEP] identifier[d] operator[SEP] identifier[List] operator[<] identifier[Vec] operator[>] identifier[class0] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Vec] operator[>] operator[SEP] identifier[toSample] operator[/] Other[2] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Vec] operator[>] identifier[class1] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Vec] operator[>] operator[SEP] identifier[toSample] operator[/] Other[2] operator[SEP] operator[SEP] identifier[IntList] identifier[randOrder] operator[=] Keyword[new] identifier[IntList] operator[SEP] identifier[d] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ListUtils] operator[SEP] identifier[addRange] operator[SEP] identifier[randOrder] , Other[0] , identifier[d] operator[SEP] identifier[size] operator[SEP] operator[SEP] , Other[1] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[shuffle] operator[SEP] identifier[randOrder] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[randOrder] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[int] identifier[indx] operator[=] identifier[randOrder] operator[SEP] identifier[getI] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cdata] operator[SEP] identifier[getDataPointCategory] operator[SEP] identifier[indx] operator[SEP] operator[==] Other[0] operator[&&] identifier[class0] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[toSample] operator[/] Other[2] operator[SEP] identifier[class0] operator[SEP] identifier[add] operator[SEP] identifier[cdata] operator[SEP] identifier[getDataPoint] operator[SEP] identifier[indx] operator[SEP] operator[SEP] identifier[getNumericalValues] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[cdata] operator[SEP] identifier[getDataPointCategory] operator[SEP] identifier[indx] operator[SEP] operator[==] Other[1] operator[&&] identifier[class0] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[toSample] operator[/] Other[2] operator[SEP] identifier[class1] operator[SEP] identifier[add] operator[SEP] identifier[cdata] operator[SEP] identifier[getDataPoint] operator[SEP] identifier[indx] operator[SEP] operator[SEP] identifier[getNumericalValues] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[int] identifier[j_start] operator[=] identifier[class0] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[class0] operator[SEP] identifier[addAll] operator[SEP] identifier[class1] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Double] operator[>] identifier[cache] operator[=] identifier[dist] operator[SEP] identifier[getAccelerationCache] operator[SEP] identifier[class0] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[j_start] operator[SEP] identifier[i] operator[++] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[j_start] operator[SEP] identifier[j] operator[<] identifier[class0] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] identifier[vals] operator[SEP] identifier[add] operator[SEP] identifier[dist] operator[SEP] identifier[dist] operator[SEP] identifier[i] , identifier[j] , identifier[allVecs] , identifier[cache] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Collections] operator[SEP] identifier[shuffle] operator[SEP] identifier[allVecs] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[d] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[5000] operator[SEP] identifier[allVecs] operator[=] identifier[allVecs] operator[SEP] identifier[subList] operator[SEP] Other[0] , identifier[toSample] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Double] operator[>] identifier[cache] operator[=] identifier[dist] operator[SEP] identifier[getAccelerationCache] operator[SEP] identifier[allVecs] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[allVecs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[i] operator[+] Other[1] operator[SEP] identifier[j] operator[<] identifier[allVecs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] identifier[vals] operator[SEP] identifier[add] operator[SEP] identifier[dist] operator[SEP] identifier[dist] operator[SEP] identifier[i] , identifier[j] , identifier[allVecs] , identifier[cache] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[vals] operator[SEP] operator[SEP] Keyword[double] identifier[median] operator[=] identifier[vals] operator[SEP] identifier[get] operator[SEP] identifier[vals] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[/] Other[2] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[LogUniform] operator[SEP] identifier[Math] operator[SEP] identifier[exp] operator[SEP] identifier[Math] operator[SEP] identifier[log] operator[SEP] identifier[median] operator[SEP] operator[-] Other[4] operator[SEP] , identifier[Math] operator[SEP] identifier[exp] operator[SEP] identifier[Math] operator[SEP] identifier[log] operator[SEP] identifier[median] operator[SEP] operator[+] Other[4] operator[SEP] operator[SEP] operator[SEP]
}
|
public void loadAndShow() {
CmsRpcAction<CmsRenameInfoBean> infoAction = new CmsRpcAction<CmsRenameInfoBean>() {
@Override
public void execute() {
start(0, true);
CmsCoreProvider.getVfsService().getRenameInfo(m_structureId, this);
}
@Override
protected void onResponse(CmsRenameInfoBean renameInfo) {
stop(false);
CmsRenameView view = new CmsRenameView(renameInfo, m_renameHandler);
for (CmsPushButton button : view.getDialogButtons()) {
addButton(button);
}
setMainContent(view);
view.setDialog(CmsRenameDialog.this);
center();
}
};
infoAction.execute();
} | class class_name[name] begin[{]
method[loadAndShow, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[CmsRpcAction], infoAction]
call[infoAction.execute, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[loadAndShow] operator[SEP] operator[SEP] {
identifier[CmsRpcAction] operator[<] identifier[CmsRenameInfoBean] operator[>] identifier[infoAction] operator[=] Keyword[new] identifier[CmsRpcAction] operator[<] identifier[CmsRenameInfoBean] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[execute] operator[SEP] operator[SEP] {
identifier[start] operator[SEP] Other[0] , literal[boolean] operator[SEP] operator[SEP] identifier[CmsCoreProvider] operator[SEP] identifier[getVfsService] operator[SEP] operator[SEP] operator[SEP] identifier[getRenameInfo] operator[SEP] identifier[m_structureId] , Keyword[this] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[onResponse] operator[SEP] identifier[CmsRenameInfoBean] identifier[renameInfo] operator[SEP] {
identifier[stop] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[CmsRenameView] identifier[view] operator[=] Keyword[new] identifier[CmsRenameView] operator[SEP] identifier[renameInfo] , identifier[m_renameHandler] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsPushButton] identifier[button] operator[:] identifier[view] operator[SEP] identifier[getDialogButtons] operator[SEP] operator[SEP] operator[SEP] {
identifier[addButton] operator[SEP] identifier[button] operator[SEP] operator[SEP]
}
identifier[setMainContent] operator[SEP] identifier[view] operator[SEP] operator[SEP] identifier[view] operator[SEP] identifier[setDialog] operator[SEP] identifier[CmsRenameDialog] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[center] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] identifier[infoAction] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Version parse(String version) {
Assert.hasText(version, "Version must not be null o empty!");
String[] parts = version.trim().split("\\.");
int[] intParts = new int[parts.length];
for (int i = 0; i < parts.length; i++) {
String input = i == parts.length - 1 ? parts[i].replaceAll("\\D.*", "") : parts[i];
if (StringUtils.hasText(input)) {
try {
intParts[i] = Integer.parseInt(input);
} catch (IllegalArgumentException o_O) {
throw new IllegalArgumentException(String.format(VERSION_PARSE_ERROR, input, version), o_O);
}
}
}
return new Version(intParts);
} | class class_name[name] begin[{]
method[parse, return_type[type[Version]], modifier[public static], parameter[version]] begin[{]
call[Assert.hasText, parameter[member[.version], literal["Version must not be null o empty!"]]]
local_variable[type[String], parts]
local_variable[type[int], intParts]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=parts, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator===), if_false=MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), if_true=MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\D.*"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replaceAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), name=input)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasText, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=intParts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=VERSION_PARSE_ERROR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=o_O, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=o_O, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=parts, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[ClassCreator(arguments=[MemberReference(member=intParts, 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=Version, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Version] identifier[parse] operator[SEP] identifier[String] identifier[version] operator[SEP] {
identifier[Assert] operator[SEP] identifier[hasText] operator[SEP] identifier[version] , literal[String] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[parts] operator[=] identifier[version] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[intParts] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[parts] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[String] identifier[input] operator[=] identifier[i] operator[==] identifier[parts] operator[SEP] identifier[length] operator[-] Other[1] operator[?] identifier[parts] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[:] identifier[parts] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[input] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[intParts] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[input] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[o_O] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[VERSION_PARSE_ERROR] , identifier[input] , identifier[version] operator[SEP] , identifier[o_O] operator[SEP] operator[SEP]
}
}
}
Keyword[return] Keyword[new] identifier[Version] operator[SEP] identifier[intParts] 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.rm.AdwordsUserListServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
com.google.api.ads.adwords.axis.v201809.rm.AdwordsUserListServiceSoapBindingStub _stub = new com.google.api.ads.adwords.axis.v201809.rm.AdwordsUserListServiceSoapBindingStub(new java.net.URL(AdwordsUserListServiceInterfacePort_address), this);
_stub.setPortName(getAdwordsUserListServiceInterfacePortWSDDServiceName());
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.rm, 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=AdwordsUserListServiceInterface, 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=AdwordsUserListServiceInterfacePort_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=rm, sub_type=ReferenceType(arguments=None, dimensions=None, name=AdwordsUserListServiceSoapBindingStub, 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=rm, sub_type=ReferenceType(arguments=None, dimensions=None, name=AdwordsUserListServiceSoapBindingStub, sub_type=None)))))))))), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAdwordsUserListServiceInterfacePortWSDDServiceName, 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[rm] operator[SEP] identifier[AdwordsUserListServiceInterface] 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[rm] operator[SEP] identifier[AdwordsUserListServiceSoapBindingStub] 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[rm] operator[SEP] identifier[AdwordsUserListServiceSoapBindingStub] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[URL] operator[SEP] identifier[AdwordsUserListServiceInterfacePort_address] operator[SEP] , Keyword[this] operator[SEP] operator[SEP] identifier[_stub] operator[SEP] identifier[setPortName] operator[SEP] identifier[getAdwordsUserListServiceInterfacePortWSDDServiceName] 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]
}
|
public static double BrayCurtis(double x1, double y1, double x2, double y2) {
double sumN = Math.abs(x1 - x2) + Math.abs(y1 - y2);
double sumP = Math.abs(x1 + x2) + Math.abs(y1 + y2);
return sumN / sumP;
} | class class_name[name] begin[{]
method[BrayCurtis, return_type[type[double]], modifier[public static], parameter[x1, y1, x2, y2]] begin[{]
local_variable[type[double], sumN]
local_variable[type[double], sumP]
return[binary_operation[member[.sumN], /, member[.sumP]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[double] identifier[BrayCurtis] operator[SEP] Keyword[double] identifier[x1] , Keyword[double] identifier[y1] , Keyword[double] identifier[x2] , Keyword[double] identifier[y2] operator[SEP] {
Keyword[double] identifier[sumN] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[x1] operator[-] identifier[x2] operator[SEP] operator[+] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[y1] operator[-] identifier[y2] operator[SEP] operator[SEP] Keyword[double] identifier[sumP] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[x1] operator[+] identifier[x2] operator[SEP] operator[+] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[y1] operator[+] identifier[y2] operator[SEP] operator[SEP] Keyword[return] identifier[sumN] operator[/] identifier[sumP] operator[SEP]
}
|
public boolean isInstrumentableClass() {
// Don't instrument interfaces
if (isInterface) {
return false;
}
// Don't instrument methods that are not in the source
if (isSynthetic) {
return false;
}
// Stay away from java.lang.Object
if (classInternalName.equals("java/lang/Object")) {
return false;
}
// Don't instrument dynamic proxies
if (classInternalName.startsWith("$Proxy")) {
return false;
}
// Don't instrument package-info
if (classInternalName.endsWith("/package-info")) {
return false;
}
return true;
} | class class_name[name] begin[{]
method[isInstrumentableClass, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
if[member[.isInterface]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[member[.isSynthetic]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[call[classInternalName.equals, parameter[literal["java/lang/Object"]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[call[classInternalName.startsWith, parameter[literal["$Proxy"]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[call[classInternalName.endsWith, parameter[literal["/package-info"]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isInstrumentableClass] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isInterface] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isSynthetic] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[classInternalName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[classInternalName] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[classInternalName] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static void printAllVirtualDns() {
List<Host> list = dns.list();
for (Host host : list) {
System.out.println(host);
}
} | class class_name[name] begin[{]
method[printAllVirtualDns, return_type[void], modifier[public static], parameter[]] begin[{]
local_variable[type[List], list]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=host)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Host, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[printAllVirtualDns] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[Host] operator[>] identifier[list] operator[=] identifier[dns] operator[SEP] identifier[list] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Host] identifier[host] operator[:] identifier[list] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[host] operator[SEP] operator[SEP]
}
}
|
public int[] toArray(int[] dest) {
if (dest == null || dest.length < size()) {
dest = new int[size];
}
System.arraycopy(data, 0, dest, 0, size);
return dest;
} | class class_name[name] begin[{]
method[toArray, return_type[type[int]], modifier[public], parameter[dest]] begin[{]
if[binary_operation[binary_operation[member[.dest], ==, literal[null]], ||, binary_operation[member[dest.length], <, call[.size, parameter[]]]]] begin[{]
assign[member[.dest], ArrayCreator(dimensions=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]
else begin[{]
None
end[}]
call[System.arraycopy, parameter[member[.data], literal[0], member[.dest], literal[0], member[.size]]]
return[member[.dest]]
end[}]
END[}] | Keyword[public] Keyword[int] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[dest] operator[SEP] {
Keyword[if] operator[SEP] identifier[dest] operator[==] Other[null] operator[||] identifier[dest] operator[SEP] identifier[length] operator[<] identifier[size] operator[SEP] operator[SEP] operator[SEP] {
identifier[dest] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[size] operator[SEP] operator[SEP]
}
identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[data] , Other[0] , identifier[dest] , Other[0] , identifier[size] operator[SEP] operator[SEP] Keyword[return] identifier[dest] operator[SEP]
}
|
public void actionRename(I_CmsReport report) {
m_report = report;
List locales = OpenCms.getLocaleManager().getAvailableLocales();
List xmlPages = getXmlPages();
if (ALL.equals(getParamLocale())) {
Iterator i = locales.iterator();
while (i.hasNext()) {
Locale locale = (Locale)i.next();
performRenameOperation(xmlPages, locale);
}
} else {
performRenameOperation(xmlPages, CmsLocaleManager.getLocale(getParamLocale()));
}
} | class class_name[name] begin[{]
method[actionRename, return_type[void], modifier[public], parameter[report]] begin[{]
assign[member[.m_report], member[.report]]
local_variable[type[List], locales]
local_variable[type[List], xmlPages]
if[call[ALL.equals, parameter[call[.getParamLocale, parameter[]]]]] begin[{]
local_variable[type[Iterator], i]
while[call[i.hasNext, parameter[]]] begin[{]
local_variable[type[Locale], locale]
call[.performRenameOperation, parameter[member[.xmlPages], member[.locale]]]
end[}]
else begin[{]
call[.performRenameOperation, parameter[member[.xmlPages], call[CmsLocaleManager.getLocale, parameter[call[.getParamLocale, parameter[]]]]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[actionRename] operator[SEP] identifier[I_CmsReport] identifier[report] operator[SEP] {
identifier[m_report] operator[=] identifier[report] operator[SEP] identifier[List] identifier[locales] operator[=] identifier[OpenCms] operator[SEP] identifier[getLocaleManager] operator[SEP] operator[SEP] operator[SEP] identifier[getAvailableLocales] operator[SEP] operator[SEP] operator[SEP] identifier[List] identifier[xmlPages] operator[=] identifier[getXmlPages] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ALL] operator[SEP] identifier[equals] operator[SEP] identifier[getParamLocale] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[Iterator] identifier[i] operator[=] identifier[locales] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[Locale] identifier[locale] operator[=] operator[SEP] identifier[Locale] operator[SEP] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[performRenameOperation] operator[SEP] identifier[xmlPages] , identifier[locale] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[performRenameOperation] operator[SEP] identifier[xmlPages] , identifier[CmsLocaleManager] operator[SEP] identifier[getLocale] operator[SEP] identifier[getParamLocale] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static IMessageSession acceptSessionFromConnectionStringBuilder(ConnectionStringBuilder amqpConnectionStringBuilder, String sessionId, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException {
return Utils.completeFuture(acceptSessionFromConnectionStringBuilderAsync(amqpConnectionStringBuilder, sessionId, receiveMode));
} | class class_name[name] begin[{]
method[acceptSessionFromConnectionStringBuilder, return_type[type[IMessageSession]], modifier[public static], parameter[amqpConnectionStringBuilder, sessionId, receiveMode]] begin[{]
return[call[Utils.completeFuture, parameter[call[.acceptSessionFromConnectionStringBuilderAsync, parameter[member[.amqpConnectionStringBuilder], member[.sessionId], member[.receiveMode]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[IMessageSession] identifier[acceptSessionFromConnectionStringBuilder] operator[SEP] identifier[ConnectionStringBuilder] identifier[amqpConnectionStringBuilder] , identifier[String] identifier[sessionId] , identifier[ReceiveMode] identifier[receiveMode] operator[SEP] Keyword[throws] identifier[InterruptedException] , identifier[ServiceBusException] {
Keyword[return] identifier[Utils] operator[SEP] identifier[completeFuture] operator[SEP] identifier[acceptSessionFromConnectionStringBuilderAsync] operator[SEP] identifier[amqpConnectionStringBuilder] , identifier[sessionId] , identifier[receiveMode] operator[SEP] operator[SEP] operator[SEP]
}
|
public static byte[] intArrayToBytes(Collection<Integer> values)
{
ByteBuffer buffer = ByteBuffer.allocate(values.size() * Integer.BYTES);
for (int value : values) {
buffer.putInt(value);
}
return buffer.array();
} | class class_name[name] begin[{]
method[intArrayToBytes, return_type[type[byte]], modifier[public static], parameter[values]] begin[{]
local_variable[type[ByteBuffer], buffer]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putInt, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None)
return[call[buffer.array, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[intArrayToBytes] operator[SEP] identifier[Collection] operator[<] identifier[Integer] operator[>] identifier[values] operator[SEP] {
identifier[ByteBuffer] identifier[buffer] operator[=] identifier[ByteBuffer] operator[SEP] identifier[allocate] operator[SEP] identifier[values] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[*] identifier[Integer] operator[SEP] identifier[BYTES] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[value] operator[:] identifier[values] operator[SEP] {
identifier[buffer] operator[SEP] identifier[putInt] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[return] identifier[buffer] operator[SEP] identifier[array] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Treenode findNodeByLabel(Treeview tree, String label, boolean caseSensitive) {
for (Treenode item : tree.getChildren(Treenode.class)) {
if (caseSensitive ? label.equals(item.getLabel()) : label.equalsIgnoreCase(item.getLabel())) {
return item;
}
}
return null;
} | class class_name[name] begin[{]
method[findNodeByLabel, return_type[type[Treenode]], modifier[public static], parameter[tree, label, caseSensitive]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=TernaryExpression(condition=MemberReference(member=caseSensitive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLabel, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None)], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=label, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLabel, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=label, selectors=[], type_arguments=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Treenode, sub_type=None))], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Treenode, sub_type=None))), label=None)
return[literal[null]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Treenode] identifier[findNodeByLabel] operator[SEP] identifier[Treeview] identifier[tree] , identifier[String] identifier[label] , Keyword[boolean] identifier[caseSensitive] operator[SEP] {
Keyword[for] operator[SEP] identifier[Treenode] identifier[item] operator[:] identifier[tree] operator[SEP] identifier[getChildren] operator[SEP] identifier[Treenode] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[caseSensitive] operator[?] identifier[label] operator[SEP] identifier[equals] operator[SEP] identifier[item] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[label] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[item] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[item] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public ItemRule newParameterItemRule(String parameterName) {
ItemRule itemRule = new ItemRule();
itemRule.setName(parameterName);
addParameterItemRule(itemRule);
return itemRule;
} | class class_name[name] begin[{]
method[newParameterItemRule, return_type[type[ItemRule]], modifier[public], parameter[parameterName]] begin[{]
local_variable[type[ItemRule], itemRule]
call[itemRule.setName, parameter[member[.parameterName]]]
call[.addParameterItemRule, parameter[member[.itemRule]]]
return[member[.itemRule]]
end[}]
END[}] | Keyword[public] identifier[ItemRule] identifier[newParameterItemRule] operator[SEP] identifier[String] identifier[parameterName] operator[SEP] {
identifier[ItemRule] identifier[itemRule] operator[=] Keyword[new] identifier[ItemRule] operator[SEP] operator[SEP] operator[SEP] identifier[itemRule] operator[SEP] identifier[setName] operator[SEP] identifier[parameterName] operator[SEP] operator[SEP] identifier[addParameterItemRule] operator[SEP] identifier[itemRule] operator[SEP] operator[SEP] Keyword[return] identifier[itemRule] operator[SEP]
}
|
public final void setDividerColor(@ColorInt final int color) {
this.seekBarColor = color;
try {
Field divider = getClass().getSuperclass().getDeclaredField("mSelectionDivider");
divider.setAccessible(true);
divider.set(this, new ColorDrawable(color));
} catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) {
Log.w(TAG, "Failed to set divider color", e);
}
} | class class_name[name] begin[{]
method[setDividerColor, return_type[void], modifier[final public], parameter[color]] begin[{]
assign[THIS[member[None.seekBarColor]], member[.color]]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSuperclass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="mSelectionDivider")], member=getDeclaredField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=divider)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAccessible, postfix_operators=[], prefix_operators=[], qualifier=divider, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), ClassCreator(arguments=[MemberReference(member=color, 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=ColorDrawable, sub_type=None))], member=set, postfix_operators=[], prefix_operators=[], qualifier=divider, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to set divider color"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=w, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchFieldException', 'IllegalArgumentException', 'IllegalAccessException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[setDividerColor] operator[SEP] annotation[@] identifier[ColorInt] Keyword[final] Keyword[int] identifier[color] operator[SEP] {
Keyword[this] operator[SEP] identifier[seekBarColor] operator[=] identifier[color] operator[SEP] Keyword[try] {
identifier[Field] identifier[divider] operator[=] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] identifier[getDeclaredField] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[divider] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[divider] operator[SEP] identifier[set] operator[SEP] Keyword[this] , Keyword[new] identifier[ColorDrawable] operator[SEP] identifier[color] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchFieldException] operator[|] identifier[IllegalArgumentException] operator[|] identifier[IllegalAccessException] identifier[e] operator[SEP] {
identifier[Log] operator[SEP] identifier[w] operator[SEP] identifier[TAG] , literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public static HttpURLConnection update(final URI rootUri, final TableRequestOptions tableOptions,
final UriQueryBuilder queryBuilder, final OperationContext opContext, final String tableName,
final String identity, final String eTag) throws IOException, URISyntaxException, StorageException {
final HttpURLConnection retConnection = coreCreate(rootUri, tableOptions, queryBuilder, opContext, tableName,
eTag, identity, "PUT");
retConnection.setDoOutput(true);
return retConnection;
} | class class_name[name] begin[{]
method[update, return_type[type[HttpURLConnection]], modifier[public static], parameter[rootUri, tableOptions, queryBuilder, opContext, tableName, identity, eTag]] begin[{]
local_variable[type[HttpURLConnection], retConnection]
call[retConnection.setDoOutput, parameter[literal[true]]]
return[member[.retConnection]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[HttpURLConnection] identifier[update] operator[SEP] Keyword[final] identifier[URI] identifier[rootUri] , Keyword[final] identifier[TableRequestOptions] identifier[tableOptions] , Keyword[final] identifier[UriQueryBuilder] identifier[queryBuilder] , Keyword[final] identifier[OperationContext] identifier[opContext] , Keyword[final] identifier[String] identifier[tableName] , Keyword[final] identifier[String] identifier[identity] , Keyword[final] identifier[String] identifier[eTag] operator[SEP] Keyword[throws] identifier[IOException] , identifier[URISyntaxException] , identifier[StorageException] {
Keyword[final] identifier[HttpURLConnection] identifier[retConnection] operator[=] identifier[coreCreate] operator[SEP] identifier[rootUri] , identifier[tableOptions] , identifier[queryBuilder] , identifier[opContext] , identifier[tableName] , identifier[eTag] , identifier[identity] , literal[String] operator[SEP] operator[SEP] identifier[retConnection] operator[SEP] identifier[setDoOutput] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[retConnection] operator[SEP]
}
|
private String ensurePadding(String base64) {
int length = base64.length();
if (length % 4 != 0) {
StringBuilder sb = new StringBuilder(base64);
for (int i = 0; i < length % 4; ++i) {
sb.append('=');
}
base64 = sb.toString();
}
return base64;
} | class class_name[name] begin[{]
method[ensurePadding, return_type[type[String]], modifier[private], parameter[base64]] begin[{]
local_variable[type[int], length]
if[binary_operation[binary_operation[member[.length], %, literal[4]], !=, literal[0]]] begin[{]
local_variable[type[StringBuilder], sb]
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=sb, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), 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)
assign[member[.base64], call[sb.toString, parameter[]]]
else begin[{]
None
end[}]
return[member[.base64]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[ensurePadding] operator[SEP] identifier[String] identifier[base64] operator[SEP] {
Keyword[int] identifier[length] operator[=] identifier[base64] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[length] operator[%] Other[4] operator[!=] Other[0] operator[SEP] {
identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[base64] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[%] Other[4] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[base64] operator[=] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[base64] operator[SEP]
}
|
@SafeVarargs
private static Map<Pattern, Pass> asMap(
final Map.Entry<Pattern, Pass>... entries) {
final Map<Pattern, Pass> map = new HashMap<>(entries.length);
for (final Map.Entry<Pattern, Pass> ent : entries) {
map.put(ent.getKey(), ent.getValue());
}
return map;
} | class class_name[name] begin[{]
method[asMap, return_type[type[Map]], modifier[private static], parameter[entries]] begin[{]
local_variable[type[Map], map]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=ent, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=ent, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=entries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ent)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Pattern, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Pass, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
return[member[.map]]
end[}]
END[}] | annotation[@] identifier[SafeVarargs] Keyword[private] Keyword[static] identifier[Map] operator[<] identifier[Pattern] , identifier[Pass] operator[>] identifier[asMap] operator[SEP] Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Pattern] , identifier[Pass] operator[>] operator[...] identifier[entries] operator[SEP] {
Keyword[final] identifier[Map] operator[<] identifier[Pattern] , identifier[Pass] operator[>] identifier[map] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] identifier[entries] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Pattern] , identifier[Pass] operator[>] identifier[ent] operator[:] identifier[entries] operator[SEP] {
identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[ent] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[ent] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[map] operator[SEP]
}
|
public static LocalDate of(int year, Month month, int dayOfMonth) {
YEAR.checkValidValue(year);
Objects.requireNonNull(month, "month");
DAY_OF_MONTH.checkValidValue(dayOfMonth);
return create(year, month.getValue(), dayOfMonth);
} | class class_name[name] begin[{]
method[of, return_type[type[LocalDate]], modifier[public static], parameter[year, month, dayOfMonth]] begin[{]
call[YEAR.checkValidValue, parameter[member[.year]]]
call[Objects.requireNonNull, parameter[member[.month], literal["month"]]]
call[DAY_OF_MONTH.checkValidValue, parameter[member[.dayOfMonth]]]
return[call[.create, parameter[member[.year], call[month.getValue, parameter[]], member[.dayOfMonth]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[LocalDate] identifier[of] operator[SEP] Keyword[int] identifier[year] , identifier[Month] identifier[month] , Keyword[int] identifier[dayOfMonth] operator[SEP] {
identifier[YEAR] operator[SEP] identifier[checkValidValue] operator[SEP] identifier[year] operator[SEP] operator[SEP] identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[month] , literal[String] operator[SEP] operator[SEP] identifier[DAY_OF_MONTH] operator[SEP] identifier[checkValidValue] operator[SEP] identifier[dayOfMonth] operator[SEP] operator[SEP] Keyword[return] identifier[create] operator[SEP] identifier[year] , identifier[month] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[dayOfMonth] operator[SEP] operator[SEP]
}
|
public Observable<ServiceResponse<IotHubDescriptionInner>> updateWithServiceResponseAsync(String resourceGroupName, String resourceName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (resourceName == null) {
throw new IllegalArgumentException("Parameter resourceName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
final Map<String, String> tags = null;
TagsResource iotHubTags = new TagsResource();
iotHubTags.withTags(null);
Observable<Response<ResponseBody>> observable = service.update(this.client.subscriptionId(), resourceGroupName, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), iotHubTags, this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<IotHubDescriptionInner>() { }.getType());
} | class class_name[name] begin[{]
method[updateWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, resourceName]] begin[{]
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[.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[.resourceName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceName 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[}]
local_variable[type[Map], tags]
local_variable[type[TagsResource], iotHubTags]
call[iotHubTags.withTags, parameter[literal[null]]]
local_variable[type[Observable], observable]
return[call[client.getAzureClient, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[IotHubDescriptionInner] operator[>] operator[>] identifier[updateWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[resourceName] 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[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[resourceName] 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[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[tags] operator[=] Other[null] operator[SEP] identifier[TagsResource] identifier[iotHubTags] operator[=] Keyword[new] identifier[TagsResource] operator[SEP] operator[SEP] operator[SEP] identifier[iotHubTags] operator[SEP] identifier[withTags] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[Observable] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] operator[>] identifier[observable] operator[=] identifier[service] operator[SEP] identifier[update] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , identifier[resourceGroupName] , identifier[resourceName] , 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] , identifier[iotHubTags] , 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[getPutOrPatchResultAsync] operator[SEP] identifier[observable] , Keyword[new] identifier[TypeToken] operator[<] identifier[IotHubDescriptionInner] operator[>] operator[SEP] operator[SEP] {
} operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void marshall(DeleteSamplingRuleRequest deleteSamplingRuleRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteSamplingRuleRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteSamplingRuleRequest.getRuleName(), RULENAME_BINDING);
protocolMarshaller.marshall(deleteSamplingRuleRequest.getRuleARN(), RULEARN_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[deleteSamplingRuleRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.deleteSamplingRuleRequest], ==, 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=getRuleName, postfix_operators=[], prefix_operators=[], qualifier=deleteSamplingRuleRequest, selectors=[], type_arguments=None), MemberReference(member=RULENAME_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=getRuleARN, postfix_operators=[], prefix_operators=[], qualifier=deleteSamplingRuleRequest, selectors=[], type_arguments=None), MemberReference(member=RULEARN_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[DeleteSamplingRuleRequest] identifier[deleteSamplingRuleRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[deleteSamplingRuleRequest] 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[deleteSamplingRuleRequest] operator[SEP] identifier[getRuleName] operator[SEP] operator[SEP] , identifier[RULENAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteSamplingRuleRequest] operator[SEP] identifier[getRuleARN] operator[SEP] operator[SEP] , identifier[RULEARN_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public int getAdIndex(int position) {
int index = -1;
if(position >= getOffsetValue())
index = (position - getOffsetValue()) / (getNoOfDataBetweenAds()+1);
//Log.d("POSITION", "index " + index + " for position " + position);
return index;
} | class class_name[name] begin[{]
method[getAdIndex, return_type[type[int]], modifier[public], parameter[position]] begin[{]
local_variable[type[int], index]
if[binary_operation[member[.position], >=, call[.getOffsetValue, parameter[]]]] begin[{]
assign[member[.index], binary_operation[binary_operation[member[.position], -, call[.getOffsetValue, parameter[]]], /, binary_operation[call[.getNoOfDataBetweenAds, parameter[]], +, literal[1]]]]
else begin[{]
None
end[}]
return[member[.index]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[getAdIndex] operator[SEP] Keyword[int] identifier[position] operator[SEP] {
Keyword[int] identifier[index] operator[=] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[position] operator[>=] identifier[getOffsetValue] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[=] operator[SEP] identifier[position] operator[-] identifier[getOffsetValue] operator[SEP] operator[SEP] operator[SEP] operator[/] operator[SEP] identifier[getNoOfDataBetweenAds] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[index] operator[SEP]
}
|
@NonNull
public Observable<T> autoConnect(int numberOfSubscribers, @NonNull Consumer<? super Disposable> connection) {
if (numberOfSubscribers <= 0) {
this.connect(connection);
return RxJavaPlugins.onAssembly(this);
}
return RxJavaPlugins.onAssembly(new ObservableAutoConnect<T>(this, numberOfSubscribers, connection));
} | class class_name[name] begin[{]
method[autoConnect, return_type[type[Observable]], modifier[public], parameter[numberOfSubscribers, connection]] begin[{]
if[binary_operation[member[.numberOfSubscribers], <=, literal[0]]] begin[{]
THIS[call[None.connect, parameter[member[.connection]]]]
return[call[RxJavaPlugins.onAssembly, parameter[THIS[]]]]
else begin[{]
None
end[}]
return[call[RxJavaPlugins.onAssembly, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=numberOfSubscribers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=ObservableAutoConnect, sub_type=None))]]]
end[}]
END[}] | annotation[@] identifier[NonNull] Keyword[public] identifier[Observable] operator[<] identifier[T] operator[>] identifier[autoConnect] operator[SEP] Keyword[int] identifier[numberOfSubscribers] , annotation[@] identifier[NonNull] identifier[Consumer] operator[<] operator[?] Keyword[super] identifier[Disposable] operator[>] identifier[connection] operator[SEP] {
Keyword[if] operator[SEP] identifier[numberOfSubscribers] operator[<=] Other[0] operator[SEP] {
Keyword[this] operator[SEP] identifier[connect] operator[SEP] identifier[connection] operator[SEP] operator[SEP] Keyword[return] identifier[RxJavaPlugins] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[this] operator[SEP] operator[SEP]
}
Keyword[return] identifier[RxJavaPlugins] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[new] identifier[ObservableAutoConnect] operator[<] identifier[T] operator[>] operator[SEP] Keyword[this] , identifier[numberOfSubscribers] , identifier[connection] operator[SEP] operator[SEP] operator[SEP]
}
|
public String getSkeleton(String pattern) {
synchronized (this) { // synchronized since a getter must be thread-safe
current.set(pattern, fp, false);
return current.toString();
}
} | class class_name[name] begin[{]
method[getSkeleton, return_type[type[String]], modifier[public], parameter[pattern]] begin[{]
SYNCHRONIZED[THIS[]] BEGIN[{]
call[current.set, parameter[member[.pattern], member[.fp], literal[false]]]
return[call[current.toString, parameter[]]]
END[}]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getSkeleton] operator[SEP] identifier[String] identifier[pattern] operator[SEP] {
Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] {
identifier[current] operator[SEP] identifier[set] operator[SEP] identifier[pattern] , identifier[fp] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[current] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void log(LogLevel level, String msg, Throwable t)
{
if (level != LogLevel.OFF && level.level <= logLevel.level)
logger.add(writers, name, level, msg, t);
} | class class_name[name] begin[{]
method[log, return_type[void], modifier[public], parameter[level, msg, t]] begin[{]
if[binary_operation[binary_operation[member[.level], !=, member[LogLevel.OFF]], &&, binary_operation[member[level.level], <=, member[logLevel.level]]]] begin[{]
call[logger.add, parameter[member[.writers], member[.name], member[.level], member[.msg], member[.t]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[log] operator[SEP] identifier[LogLevel] identifier[level] , identifier[String] identifier[msg] , identifier[Throwable] identifier[t] operator[SEP] {
Keyword[if] operator[SEP] identifier[level] operator[!=] identifier[LogLevel] operator[SEP] identifier[OFF] operator[&&] identifier[level] operator[SEP] identifier[level] operator[<=] identifier[logLevel] operator[SEP] identifier[level] operator[SEP] identifier[logger] operator[SEP] identifier[add] operator[SEP] identifier[writers] , identifier[name] , identifier[level] , identifier[msg] , identifier[t] operator[SEP] operator[SEP]
}
|
public static int findTab(byte [] utf) {
return org.apache.hadoop.util.UTF8ByteArrayUtils.findNthByte(utf, 0,
utf.length, (byte)'\t', 1);
} | class class_name[name] begin[{]
method[findTab, return_type[type[int]], modifier[public static], parameter[utf]] begin[{]
return[call[org.apache.hadoop.util.UTF8ByteArrayUtils.findNthByte, parameter[member[.utf], literal[0], member[utf.length], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\t'), type=BasicType(dimensions=[], name=byte)), literal[1]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[findTab] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[utf] operator[SEP] {
Keyword[return] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[hadoop] operator[SEP] identifier[util] operator[SEP] identifier[UTF8ByteArrayUtils] operator[SEP] identifier[findNthByte] operator[SEP] identifier[utf] , Other[0] , identifier[utf] operator[SEP] identifier[length] , operator[SEP] Keyword[byte] operator[SEP] literal[String] , Other[1] operator[SEP] operator[SEP]
}
|
public com.google.api.ads.adwords.axis.v201809.cm.SharedSetStatus getStatus() {
return status;
} | class class_name[name] begin[{]
method[getStatus, return_type[type[com]], modifier[public], parameter[]] begin[{]
return[member[.status]]
end[}]
END[}] | Keyword[public] 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[cm] operator[SEP] identifier[SharedSetStatus] identifier[getStatus] operator[SEP] operator[SEP] {
Keyword[return] identifier[status] operator[SEP]
}
|
@Override
public UpdateGcmChannelResult updateGcmChannel(UpdateGcmChannelRequest request) {
request = beforeClientExecution(request);
return executeUpdateGcmChannel(request);
} | class class_name[name] begin[{]
method[updateGcmChannel, return_type[type[UpdateGcmChannelResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeUpdateGcmChannel, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[UpdateGcmChannelResult] identifier[updateGcmChannel] operator[SEP] identifier[UpdateGcmChannelRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeUpdateGcmChannel] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public char[] loadPassword(String account) {
byte[] pwBytes = loadPassword0(account.getBytes(UTF_8));
if (pwBytes == null) {
return null;
} else {
CharBuffer pwBuf = UTF_8.decode(ByteBuffer.wrap(pwBytes));
char[] pw = new char[pwBuf.remaining()];
pwBuf.get(pw);
Arrays.fill(pwBytes, (byte) 0x00);
Arrays.fill(pwBuf.array(), (char) 0x00);
return pw;
}
} | class class_name[name] begin[{]
method[loadPassword, return_type[type[char]], modifier[public], parameter[account]] begin[{]
local_variable[type[byte], pwBytes]
if[binary_operation[member[.pwBytes], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
local_variable[type[CharBuffer], pwBuf]
local_variable[type[char], pw]
call[pwBuf.get, parameter[member[.pw]]]
call[Arrays.fill, parameter[member[.pwBytes], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x00), type=BasicType(dimensions=[], name=byte))]]
call[Arrays.fill, parameter[call[pwBuf.array, parameter[]], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x00), type=BasicType(dimensions=[], name=char))]]
return[member[.pw]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[char] operator[SEP] operator[SEP] identifier[loadPassword] operator[SEP] identifier[String] identifier[account] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[pwBytes] operator[=] identifier[loadPassword0] operator[SEP] identifier[account] operator[SEP] identifier[getBytes] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pwBytes] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[else] {
identifier[CharBuffer] identifier[pwBuf] operator[=] identifier[UTF_8] operator[SEP] identifier[decode] operator[SEP] identifier[ByteBuffer] operator[SEP] identifier[wrap] operator[SEP] identifier[pwBytes] operator[SEP] operator[SEP] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[pw] operator[=] Keyword[new] Keyword[char] operator[SEP] identifier[pwBuf] operator[SEP] identifier[remaining] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pwBuf] operator[SEP] identifier[get] operator[SEP] identifier[pw] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[fill] operator[SEP] identifier[pwBytes] , operator[SEP] Keyword[byte] operator[SEP] literal[Integer] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[fill] operator[SEP] identifier[pwBuf] operator[SEP] identifier[array] operator[SEP] operator[SEP] , operator[SEP] Keyword[char] operator[SEP] literal[Integer] operator[SEP] operator[SEP] Keyword[return] identifier[pw] operator[SEP]
}
}
|
static
private String resolve(String structure, String representation) throws IOException {
String host = "cactus.nci.nih.gov";
String path = "/chemical/structure/" + structure + "/" + representation;
RequestConfig config = RequestConfig.custom()
.setConnectTimeout(10*1000)
.setSocketTimeout(2*1000).build();
CloseableHttpClient client = HttpClients.custom()
.setDefaultRequestConfig(config).build();
try {
URI uri = new URI("http", host, path, null);
HttpGet request = new HttpGet(uri);
HttpResponse response = client.execute(request);
StatusLine status = response.getStatusLine();
switch(status.getStatusCode()){
case HttpStatus.SC_OK:
break;
case HttpStatus.SC_NOT_FOUND:
throw new FileNotFoundException(structure);
default:
throw new IOException(status.getReasonPhrase());
}
ByteArrayOutputStream os = new ByteArrayOutputStream(10 * 1024);
try {
HttpEntity responseBody = response.getEntity();
try {
responseBody.writeTo(os);
} finally {
os.flush();
}
String encoding = EntityUtils.getContentCharSet(responseBody);
if(encoding == null){
encoding = "UTF-8";
}
return os.toString(encoding);
} finally {
os.close();
}
} catch(URISyntaxException use){
throw new IOException(use);
} finally {
client.close();
}
} | class class_name[name] begin[{]
method[resolve, return_type[type[String]], modifier[private static], parameter[structure, representation]] begin[{]
local_variable[type[String], host]
local_variable[type[String], path]
local_variable[type[RequestConfig], config]
local_variable[type[CloseableHttpClient], client]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="http"), MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URI, sub_type=None)), name=uri)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=uri, 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=HttpGet, sub_type=None)), name=request)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HttpGet, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None), name=response)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HttpResponse, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getStatusLine, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), name=status)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StatusLine, sub_type=None)), SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=SC_OK, postfix_operators=[], prefix_operators=[], qualifier=HttpStatus, selectors=[])], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=SC_NOT_FOUND, postfix_operators=[], prefix_operators=[], qualifier=HttpStatus, selectors=[])], statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=structure, 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=FileNotFoundException, sub_type=None)), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getReasonPhrase, postfix_operators=[], prefix_operators=[], qualifier=status, selectors=[], type_arguments=None)], 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)])], expression=MethodInvocation(arguments=[], member=getStatusCode, postfix_operators=[], prefix_operators=[], qualifier=status, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operator=*)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayOutputStream, sub_type=None)), name=os)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayOutputStream, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEntity, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), name=responseBody)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HttpEntity, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=os, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeTo, postfix_operators=[], prefix_operators=[], qualifier=responseBody, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=os, selectors=[], type_arguments=None), label=None)], label=None, resources=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=responseBody, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getContentCharSet, postfix_operators=[], prefix_operators=[], qualifier=EntityUtils, selectors=[], type_arguments=None), name=encoding)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=encoding, 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=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=os, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=os, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=use, 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=use, types=['URISyntaxException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[static] Keyword[private] identifier[String] identifier[resolve] operator[SEP] identifier[String] identifier[structure] , identifier[String] identifier[representation] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[host] operator[=] literal[String] operator[SEP] identifier[String] identifier[path] operator[=] literal[String] operator[+] identifier[structure] operator[+] literal[String] operator[+] identifier[representation] operator[SEP] identifier[RequestConfig] identifier[config] operator[=] identifier[RequestConfig] operator[SEP] identifier[custom] operator[SEP] operator[SEP] operator[SEP] identifier[setConnectTimeout] operator[SEP] Other[10] operator[*] Other[1000] operator[SEP] operator[SEP] identifier[setSocketTimeout] operator[SEP] Other[2] operator[*] Other[1000] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[CloseableHttpClient] identifier[client] operator[=] identifier[HttpClients] operator[SEP] identifier[custom] operator[SEP] operator[SEP] operator[SEP] identifier[setDefaultRequestConfig] operator[SEP] identifier[config] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[URI] identifier[uri] operator[=] Keyword[new] identifier[URI] operator[SEP] literal[String] , identifier[host] , identifier[path] , Other[null] operator[SEP] operator[SEP] identifier[HttpGet] identifier[request] operator[=] Keyword[new] identifier[HttpGet] operator[SEP] identifier[uri] operator[SEP] operator[SEP] identifier[HttpResponse] identifier[response] operator[=] identifier[client] operator[SEP] identifier[execute] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[StatusLine] identifier[status] operator[=] identifier[response] operator[SEP] identifier[getStatusLine] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[status] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] identifier[HttpStatus] operator[SEP] identifier[SC_OK] operator[:] Keyword[break] operator[SEP] Keyword[case] identifier[HttpStatus] operator[SEP] identifier[SC_NOT_FOUND] operator[:] Keyword[throw] Keyword[new] identifier[FileNotFoundException] operator[SEP] identifier[structure] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[status] operator[SEP] identifier[getReasonPhrase] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[ByteArrayOutputStream] identifier[os] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] Other[10] operator[*] Other[1024] operator[SEP] operator[SEP] Keyword[try] {
identifier[HttpEntity] identifier[responseBody] operator[=] identifier[response] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[responseBody] operator[SEP] identifier[writeTo] operator[SEP] identifier[os] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[os] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[encoding] operator[=] identifier[EntityUtils] operator[SEP] identifier[getContentCharSet] operator[SEP] identifier[responseBody] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[encoding] operator[==] Other[null] operator[SEP] {
identifier[encoding] operator[=] literal[String] operator[SEP]
}
Keyword[return] identifier[os] operator[SEP] identifier[toString] operator[SEP] identifier[encoding] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[os] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[use] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[use] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[client] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Override
public Stream<GroupMetadata> findLazy(GroupFilter groupCriteria) {
checkNotNull(groupCriteria, "Criteria must be not null");
return
groupCriteria.applyFindLazy(criteria -> {
if (isAlwaysTruePredicate(criteria.getPredicate()) &&
isAlwaysTruePredicate(criteria.getDataCenterFilter().getPredicate()) &&
criteria.getIds().size() > 0) {
return
criteria.getIds().stream()
.map(nullable(curId -> client.getGroup(curId, true)))
.filter(notNull());
} else {
Stream<DataCenterMetadata> dataCenters =
dataCenterService
.findLazy(criteria.getDataCenterFilter());
return
dataCenters
.map(d -> client.getGroup(d.getGroup().getId(), true))
.flatMap(g -> g.getAllGroups().stream())
.filter(criteria.getPredicate())
.filter((criteria.getIds().size() > 0) ?
combine(GroupMetadata::getId, in(criteria.getIds())) : alwaysTrue()
);
}
});
} | class class_name[name] begin[{]
method[findLazy, return_type[type[Stream]], modifier[public], parameter[groupCriteria]] begin[{]
call[.checkNotNull, parameter[member[.groupCriteria], literal["Criteria must be not null"]]]
return[call[groupCriteria.applyFindLazy, parameter[LambdaExpression(body=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPredicate, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None)], member=isAlwaysTruePredicate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDataCenterFilter, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[MethodInvocation(arguments=[], member=getPredicate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=isAlwaysTruePredicate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getIds, postfix_operators=[], prefix_operators=[], qualifier=criteria, 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=0), operator=>), operator=&&), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDataCenterFilter, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None)], member=findLazy, postfix_operators=[], prefix_operators=[], qualifier=dataCenterService, selectors=[], type_arguments=None), name=dataCenters)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DataCenterMetadata, sub_type=None))], dimensions=[], name=Stream, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getGroup, postfix_operators=[], prefix_operators=[], qualifier=d, selectors=[MethodInvocation(arguments=[], member=getId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getGroup, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None), parameters=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=map, postfix_operators=[], prefix_operators=[], qualifier=dataCenters, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[], member=getAllGroups, postfix_operators=[], prefix_operators=[], qualifier=g, selectors=[MethodInvocation(arguments=[], member=stream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=flatMap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPredicate, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None)], member=filter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getIds, postfix_operators=[], prefix_operators=[], qualifier=criteria, 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=0), operator=>), if_false=MethodInvocation(arguments=[], member=alwaysTrue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=GroupMetadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=getId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIds, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None)], member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=combine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))], member=filter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getIds, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[MethodInvocation(arguments=[], member=stream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=curId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getGroup, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None), parameters=[MemberReference(member=curId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=nullable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=map, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=notNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=filter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))], parameters=[MemberReference(member=criteria, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Stream] operator[<] identifier[GroupMetadata] operator[>] identifier[findLazy] operator[SEP] identifier[GroupFilter] identifier[groupCriteria] operator[SEP] {
identifier[checkNotNull] operator[SEP] identifier[groupCriteria] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[groupCriteria] operator[SEP] identifier[applyFindLazy] operator[SEP] identifier[criteria] operator[->] {
Keyword[if] operator[SEP] identifier[isAlwaysTruePredicate] operator[SEP] identifier[criteria] operator[SEP] identifier[getPredicate] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[isAlwaysTruePredicate] operator[SEP] identifier[criteria] operator[SEP] identifier[getDataCenterFilter] operator[SEP] operator[SEP] operator[SEP] identifier[getPredicate] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[criteria] operator[SEP] identifier[getIds] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[return] identifier[criteria] operator[SEP] identifier[getIds] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[nullable] operator[SEP] identifier[curId] operator[->] identifier[client] operator[SEP] identifier[getGroup] operator[SEP] identifier[curId] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[notNull] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Stream] operator[<] identifier[DataCenterMetadata] operator[>] identifier[dataCenters] operator[=] identifier[dataCenterService] operator[SEP] identifier[findLazy] operator[SEP] identifier[criteria] operator[SEP] identifier[getDataCenterFilter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[dataCenters] operator[SEP] identifier[map] operator[SEP] identifier[d] operator[->] identifier[client] operator[SEP] identifier[getGroup] operator[SEP] identifier[d] operator[SEP] identifier[getGroup] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] identifier[g] operator[->] identifier[g] operator[SEP] identifier[getAllGroups] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[criteria] operator[SEP] identifier[getPredicate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[criteria] operator[SEP] identifier[getIds] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[?] identifier[combine] operator[SEP] identifier[GroupMetadata] operator[::] identifier[getId] , identifier[in] operator[SEP] identifier[criteria] operator[SEP] identifier[getIds] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[alwaysTrue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
private long doWrap(ByteBuffer[] userBuffers, int off, int len) throws IOException {
if(anyAreSet(state, FLAG_CLOSED)) {
throw new ClosedChannelException();
}
if(outstandingTasks > 0) {
return 0;
}
if(anyAreSet(state, FLAG_WRITE_REQUIRES_READ)) {
doUnwrap(null, 0, 0);
if(allAreClear(state, FLAG_READ_REQUIRES_WRITE)) { //unless a wrap is immediatly required we just return
return 0;
}
}
if(wrappedData != null) {
int res = sink.write(wrappedData.getBuffer());
if(res == 0 || wrappedData.getBuffer().hasRemaining()) {
return 0;
}
wrappedData.getBuffer().clear();
} else {
wrappedData = bufferPool.allocate();
}
try {
SSLEngineResult result = null;
while (result == null || (result.getHandshakeStatus() == SSLEngineResult.HandshakeStatus.NEED_WRAP && result.getStatus() != SSLEngineResult.Status.BUFFER_OVERFLOW)) {
if (userBuffers == null) {
result = engine.wrap(EMPTY_BUFFER, wrappedData.getBuffer());
} else {
result = engine.wrap(userBuffers, off, len, wrappedData.getBuffer());
}
}
wrappedData.getBuffer().flip();
if (result.getStatus() == SSLEngineResult.Status.BUFFER_UNDERFLOW) {
throw new IOException("underflow"); //todo: can this happen?
} else if (result.getStatus() == SSLEngineResult.Status.BUFFER_OVERFLOW) {
if (!wrappedData.getBuffer().hasRemaining()) { //if an earlier wrap suceeded we ignore this
throw new IOException("overflow"); //todo: handle properly
}
}
//attempt to write it out, if we fail we just return
//we ignore the handshake status, as wrap will get called again
if (wrappedData.getBuffer().hasRemaining()) {
sink.write(wrappedData.getBuffer());
}
//if it was not a complete write we just return
if (wrappedData.getBuffer().hasRemaining()) {
return result.bytesConsumed();
}
if (!handleHandshakeResult(result)) {
return 0;
}
if (result.getStatus() == SSLEngineResult.Status.CLOSED && userBuffers != null) {
notifyWriteClosed();
throw new ClosedChannelException();
}
return result.bytesConsumed();
} catch (RuntimeException|IOException|Error e) {
try {
close();
} catch (Throwable ex) {
UndertowLogger.REQUEST_LOGGER.debug("Exception closing SSLConduit after exception in doWrap()", ex);
}
throw e;
} finally {
//this can be cleared if the channel is fully closed
if(wrappedData != null) {
if (!wrappedData.getBuffer().hasRemaining()) {
wrappedData.close();
wrappedData = null;
}
}
}
} | class class_name[name] begin[{]
method[doWrap, return_type[type[long]], modifier[private], parameter[userBuffers, off, len]] begin[{]
if[call[.anyAreSet, parameter[member[.state], member[.FLAG_CLOSED]]]] 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=ClosedChannelException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.outstandingTasks], >, literal[0]]] begin[{]
return[literal[0]]
else begin[{]
None
end[}]
if[call[.anyAreSet, parameter[member[.state], member[.FLAG_WRITE_REQUIRES_READ]]]] begin[{]
call[.doUnwrap, parameter[literal[null], literal[0], literal[0]]]
if[call[.allAreClear, parameter[member[.state], member[.FLAG_READ_REQUIRES_WRITE]]]] begin[{]
return[literal[0]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[member[.wrappedData], !=, literal[null]]] begin[{]
local_variable[type[int], res]
if[binary_operation[binary_operation[member[.res], ==, literal[0]], ||, call[wrappedData.getBuffer, parameter[]]]] begin[{]
return[literal[0]]
else begin[{]
None
end[}]
call[wrappedData.getBuffer, parameter[]]
else begin[{]
assign[member[.wrappedData], call[bufferPool.allocate, parameter[]]]
end[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SSLEngineResult, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=userBuffers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=userBuffers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=off, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getBuffer, postfix_operators=[], prefix_operators=[], qualifier=wrappedData, selectors=[], type_arguments=None)], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=engine, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=EMPTY_BUFFER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getBuffer, postfix_operators=[], prefix_operators=[], qualifier=wrappedData, selectors=[], type_arguments=None)], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=engine, selectors=[], type_arguments=None)), label=None)]))]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getHandshakeStatus, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operandr=MemberReference(member=NEED_WRAP, postfix_operators=[], prefix_operators=[], qualifier=SSLEngineResult.HandshakeStatus, selectors=[]), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operandr=MemberReference(member=BUFFER_OVERFLOW, postfix_operators=[], prefix_operators=[], qualifier=SSLEngineResult.Status, selectors=[]), operator=!=), operator=&&), operator=||), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getBuffer, postfix_operators=[], prefix_operators=[], qualifier=wrappedData, selectors=[MethodInvocation(arguments=[], member=flip, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operandr=MemberReference(member=BUFFER_UNDERFLOW, postfix_operators=[], prefix_operators=[], qualifier=SSLEngineResult.Status, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operandr=MemberReference(member=BUFFER_OVERFLOW, postfix_operators=[], prefix_operators=[], qualifier=SSLEngineResult.Status, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getBuffer, postfix_operators=[], prefix_operators=['!'], qualifier=wrappedData, selectors=[MethodInvocation(arguments=[], member=hasRemaining, 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=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="overflow")], 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)]))])), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="underflow")], 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)])), IfStatement(condition=MethodInvocation(arguments=[], member=getBuffer, postfix_operators=[], prefix_operators=[], qualifier=wrappedData, selectors=[MethodInvocation(arguments=[], member=hasRemaining, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBuffer, postfix_operators=[], prefix_operators=[], qualifier=wrappedData, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=sink, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=getBuffer, postfix_operators=[], prefix_operators=[], qualifier=wrappedData, selectors=[MethodInvocation(arguments=[], member=hasRemaining, 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=[ReturnStatement(expression=MethodInvocation(arguments=[], member=bytesConsumed, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleHandshakeResult, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operandr=MemberReference(member=CLOSED, postfix_operators=[], prefix_operators=[], qualifier=SSLEngineResult.Status, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=userBuffers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=notifyWriteClosed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), 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=ClosedChannelException, sub_type=None)), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[], member=bytesConsumed, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception closing SSLConduit after exception in doWrap()"), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=UndertowLogger.REQUEST_LOGGER, 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), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RuntimeException', 'IOException', 'Error']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=wrappedData, 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=[IfStatement(condition=MethodInvocation(arguments=[], member=getBuffer, postfix_operators=[], prefix_operators=['!'], qualifier=wrappedData, selectors=[MethodInvocation(arguments=[], member=hasRemaining, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=wrappedData, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=wrappedData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]))]))], label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[long] identifier[doWrap] operator[SEP] identifier[ByteBuffer] operator[SEP] operator[SEP] identifier[userBuffers] , Keyword[int] identifier[off] , Keyword[int] identifier[len] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[anyAreSet] operator[SEP] identifier[state] , identifier[FLAG_CLOSED] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ClosedChannelException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[outstandingTasks] operator[>] Other[0] operator[SEP] {
Keyword[return] Other[0] operator[SEP]
}
Keyword[if] operator[SEP] identifier[anyAreSet] operator[SEP] identifier[state] , identifier[FLAG_WRITE_REQUIRES_READ] operator[SEP] operator[SEP] {
identifier[doUnwrap] operator[SEP] Other[null] , Other[0] , Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[allAreClear] operator[SEP] identifier[state] , identifier[FLAG_READ_REQUIRES_WRITE] operator[SEP] operator[SEP] {
Keyword[return] Other[0] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[wrappedData] operator[!=] Other[null] operator[SEP] {
Keyword[int] identifier[res] operator[=] identifier[sink] operator[SEP] identifier[write] operator[SEP] identifier[wrappedData] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[res] operator[==] Other[0] operator[||] identifier[wrappedData] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[hasRemaining] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[0] operator[SEP]
}
identifier[wrappedData] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[wrappedData] operator[=] identifier[bufferPool] operator[SEP] identifier[allocate] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[SSLEngineResult] identifier[result] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] identifier[result] operator[==] Other[null] operator[||] operator[SEP] identifier[result] operator[SEP] identifier[getHandshakeStatus] operator[SEP] operator[SEP] operator[==] identifier[SSLEngineResult] operator[SEP] identifier[HandshakeStatus] operator[SEP] identifier[NEED_WRAP] operator[&&] identifier[result] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[!=] identifier[SSLEngineResult] operator[SEP] identifier[Status] operator[SEP] identifier[BUFFER_OVERFLOW] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[userBuffers] operator[==] Other[null] operator[SEP] {
identifier[result] operator[=] identifier[engine] operator[SEP] identifier[wrap] operator[SEP] identifier[EMPTY_BUFFER] , identifier[wrappedData] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[result] operator[=] identifier[engine] operator[SEP] identifier[wrap] operator[SEP] identifier[userBuffers] , identifier[off] , identifier[len] , identifier[wrappedData] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[wrappedData] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[flip] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[==] identifier[SSLEngineResult] operator[SEP] identifier[Status] operator[SEP] identifier[BUFFER_UNDERFLOW] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[==] identifier[SSLEngineResult] operator[SEP] identifier[Status] operator[SEP] identifier[BUFFER_OVERFLOW] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[wrappedData] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[hasRemaining] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[wrappedData] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[hasRemaining] operator[SEP] operator[SEP] operator[SEP] {
identifier[sink] operator[SEP] identifier[write] operator[SEP] identifier[wrappedData] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[wrappedData] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[hasRemaining] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[result] operator[SEP] identifier[bytesConsumed] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[handleHandshakeResult] operator[SEP] identifier[result] operator[SEP] operator[SEP] {
Keyword[return] Other[0] operator[SEP]
}
Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[==] identifier[SSLEngineResult] operator[SEP] identifier[Status] operator[SEP] identifier[CLOSED] operator[&&] identifier[userBuffers] operator[!=] Other[null] operator[SEP] {
identifier[notifyWriteClosed] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ClosedChannelException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP] identifier[bytesConsumed] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RuntimeException] operator[|] identifier[IOException] operator[|] identifier[Error] identifier[e] operator[SEP] {
Keyword[try] {
identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[ex] operator[SEP] {
identifier[UndertowLogger] operator[SEP] identifier[REQUEST_LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[e] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[wrappedData] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[wrappedData] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[hasRemaining] operator[SEP] operator[SEP] operator[SEP] {
identifier[wrappedData] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[wrappedData] operator[=] Other[null] operator[SEP]
}
}
}
}
|
public static final StyleMap assignDOM(Document doc, String encoding,
URL base, String media, boolean useInheritance, final MatchCondition matchCond) {
return assignDOM(doc, encoding, base, new MediaSpec(media), useInheritance, matchCond);
} | class class_name[name] begin[{]
method[assignDOM, return_type[type[StyleMap]], modifier[final public static], parameter[doc, encoding, base, media, useInheritance, matchCond]] begin[{]
return[call[.assignDOM, parameter[member[.doc], member[.encoding], member[.base], ClassCreator(arguments=[MemberReference(member=media, 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=MediaSpec, sub_type=None)), member[.useInheritance], member[.matchCond]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] identifier[StyleMap] identifier[assignDOM] operator[SEP] identifier[Document] identifier[doc] , identifier[String] identifier[encoding] , identifier[URL] identifier[base] , identifier[String] identifier[media] , Keyword[boolean] identifier[useInheritance] , Keyword[final] identifier[MatchCondition] identifier[matchCond] operator[SEP] {
Keyword[return] identifier[assignDOM] operator[SEP] identifier[doc] , identifier[encoding] , identifier[base] , Keyword[new] identifier[MediaSpec] operator[SEP] identifier[media] operator[SEP] , identifier[useInheritance] , identifier[matchCond] operator[SEP] operator[SEP]
}
|
public MapBuilder addMap(String fieldName, boolean include, Supplier<Map<String, ?>> supplier) {
if (include) {
Map<String, ?> value = supplier.get();
if (value != null && !value.isEmpty()) {
map.put(getFieldName(fieldName), value);
}
}
return this;
} | class class_name[name] begin[{]
method[addMap, return_type[type[MapBuilder]], modifier[public], parameter[fieldName, include, supplier]] begin[{]
if[member[.include]] begin[{]
local_variable[type[Map], value]
if[binary_operation[binary_operation[member[.value], !=, literal[null]], &&, call[value.isEmpty, parameter[]]]] begin[{]
call[map.put, parameter[call[.getFieldName, parameter[member[.fieldName]]], member[.value]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[MapBuilder] identifier[addMap] operator[SEP] identifier[String] identifier[fieldName] , Keyword[boolean] identifier[include] , identifier[Supplier] operator[<] identifier[Map] operator[<] identifier[String] , operator[?] operator[>] operator[>] identifier[supplier] operator[SEP] {
Keyword[if] operator[SEP] identifier[include] operator[SEP] {
identifier[Map] operator[<] identifier[String] , operator[?] operator[>] identifier[value] operator[=] identifier[supplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[&&] operator[!] identifier[value] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[getFieldName] operator[SEP] identifier[fieldName] operator[SEP] , identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public static byte[] add(byte[] b1, int off1, int len1, byte[] b2, int off2, int len2) {
byte[] b = new byte[len1 + len2];
System.arraycopy(b1, off1, b, 0, len1);
System.arraycopy(b2, off2, b, len1, len2);
return b;
} | class class_name[name] begin[{]
method[add, return_type[type[byte]], modifier[public static], parameter[b1, off1, len1, b2, off2, len2]] begin[{]
local_variable[type[byte], b]
call[System.arraycopy, parameter[member[.b1], member[.off1], member[.b], literal[0], member[.len1]]]
call[System.arraycopy, parameter[member[.b2], member[.off2], member[.b], member[.len1], member[.len2]]]
return[member[.b]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[b1] , Keyword[int] identifier[off1] , Keyword[int] identifier[len1] , Keyword[byte] operator[SEP] operator[SEP] identifier[b2] , Keyword[int] identifier[off2] , Keyword[int] identifier[len2] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[b] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[len1] operator[+] identifier[len2] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[b1] , identifier[off1] , identifier[b] , Other[0] , identifier[len1] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[b2] , identifier[off2] , identifier[b] , identifier[len1] , identifier[len2] operator[SEP] operator[SEP] Keyword[return] identifier[b] operator[SEP]
}
|
@Override
public UpdateGatewaySoftwareNowResult updateGatewaySoftwareNow(UpdateGatewaySoftwareNowRequest request) {
request = beforeClientExecution(request);
return executeUpdateGatewaySoftwareNow(request);
} | class class_name[name] begin[{]
method[updateGatewaySoftwareNow, return_type[type[UpdateGatewaySoftwareNowResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeUpdateGatewaySoftwareNow, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[UpdateGatewaySoftwareNowResult] identifier[updateGatewaySoftwareNow] operator[SEP] identifier[UpdateGatewaySoftwareNowRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeUpdateGatewaySoftwareNow] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public void marshall(ListDevEndpointsRequest listDevEndpointsRequest, ProtocolMarshaller protocolMarshaller) {
if (listDevEndpointsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listDevEndpointsRequest.getNextToken(), NEXTTOKEN_BINDING);
protocolMarshaller.marshall(listDevEndpointsRequest.getMaxResults(), MAXRESULTS_BINDING);
protocolMarshaller.marshall(listDevEndpointsRequest.getTags(), TAGS_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[listDevEndpointsRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.listDevEndpointsRequest], ==, 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=getNextToken, postfix_operators=[], prefix_operators=[], qualifier=listDevEndpointsRequest, selectors=[], type_arguments=None), MemberReference(member=NEXTTOKEN_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=getMaxResults, postfix_operators=[], prefix_operators=[], qualifier=listDevEndpointsRequest, selectors=[], type_arguments=None), MemberReference(member=MAXRESULTS_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=getTags, postfix_operators=[], prefix_operators=[], qualifier=listDevEndpointsRequest, selectors=[], type_arguments=None), MemberReference(member=TAGS_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[ListDevEndpointsRequest] identifier[listDevEndpointsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[listDevEndpointsRequest] 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[listDevEndpointsRequest] operator[SEP] identifier[getNextToken] operator[SEP] operator[SEP] , identifier[NEXTTOKEN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listDevEndpointsRequest] operator[SEP] identifier[getMaxResults] operator[SEP] operator[SEP] , identifier[MAXRESULTS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listDevEndpointsRequest] operator[SEP] identifier[getTags] operator[SEP] operator[SEP] , identifier[TAGS_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]
}
}
|
private void notifyUserProfileInitialized(String deviceID) {
deviceID = (deviceID != null) ? deviceID : getCleverTapID();
if (deviceID == null) return;
final SyncListener sl;
try {
sl = getSyncListener();
if (sl != null) {
sl.profileDidInitialize(deviceID);
}
} catch (Throwable t) {
// Ignore
}
} | class class_name[name] begin[{]
method[notifyUserProfileInitialized, return_type[void], modifier[private], parameter[deviceID]] begin[{]
assign[member[.deviceID], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=deviceID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MethodInvocation(arguments=[], member=getCleverTapID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=MemberReference(member=deviceID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
if[binary_operation[member[.deviceID], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[SyncListener], sl]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getSyncListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sl, 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=deviceID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=profileDidInitialize, postfix_operators=[], prefix_operators=[], qualifier=sl, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[notifyUserProfileInitialized] operator[SEP] identifier[String] identifier[deviceID] operator[SEP] {
identifier[deviceID] operator[=] operator[SEP] identifier[deviceID] operator[!=] Other[null] operator[SEP] operator[?] identifier[deviceID] operator[:] identifier[getCleverTapID] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[deviceID] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] Keyword[final] identifier[SyncListener] identifier[sl] operator[SEP] Keyword[try] {
identifier[sl] operator[=] identifier[getSyncListener] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sl] operator[!=] Other[null] operator[SEP] {
identifier[sl] operator[SEP] identifier[profileDidInitialize] operator[SEP] identifier[deviceID] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
}
}
|
@Override
public DaoResult updateOrCreate(T bo) {
if (bo == null) {
return new DaoResult(DaoOperationStatus.NOT_FOUND);
}
try (Connection conn = getConnection(upsertInTransaction)) {
return updateOrCreate(conn, bo);
} catch (SQLException e) {
throw new DaoException(e);
}
} | class class_name[name] begin[{]
method[updateOrCreate, return_type[type[DaoResult]], modifier[public], parameter[bo]] begin[{]
if[binary_operation[member[.bo], ==, literal[null]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=NOT_FOUND, postfix_operators=[], prefix_operators=[], qualifier=DaoOperationStatus, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DaoResult, sub_type=None))]
else begin[{]
None
end[}]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updateOrCreate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DaoException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=conn, type=ReferenceType(arguments=None, dimensions=[], name=Connection, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=upsertInTransaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))])
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[DaoResult] identifier[updateOrCreate] operator[SEP] identifier[T] identifier[bo] operator[SEP] {
Keyword[if] operator[SEP] identifier[bo] operator[==] Other[null] operator[SEP] {
Keyword[return] Keyword[new] identifier[DaoResult] operator[SEP] identifier[DaoOperationStatus] operator[SEP] identifier[NOT_FOUND] operator[SEP] operator[SEP]
}
Keyword[try] operator[SEP] identifier[Connection] identifier[conn] operator[=] identifier[getConnection] operator[SEP] identifier[upsertInTransaction] operator[SEP] operator[SEP] {
Keyword[return] identifier[updateOrCreate] operator[SEP] identifier[conn] , identifier[bo] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DaoException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
public MediaPicture toPicture(MediaPicture output,
final BufferedImage input, long timestamp) {
// validate the image
validateImage(input);
if (output == null) {
output = MediaPicture.make(mPictureWidth,
mPictureHeight, getPictureType());
}
// get the image byte buffer buffer
DataBuffer imageBuffer = input.getRaster().getDataBuffer();
byte[] imageBytes = null;
int[] imageInts = null;
// handle byte buffer case
if (imageBuffer instanceof DataBufferByte) {
imageBytes = ((DataBufferByte) imageBuffer).getData();
}
// handle integer buffer case
else if (imageBuffer instanceof DataBufferInt) {
imageInts = ((DataBufferInt) imageBuffer).getData();
}
// if it's some other type, throw
else {
throw new IllegalArgumentException(
"Unsupported BufferedImage data buffer type: "
+ imageBuffer.getDataType());
}
// create the video picture and get it's underlying buffer
final AtomicReference<JNIReference> ref = new AtomicReference<JNIReference>(
null);
final MediaPicture picture = willResample() ? mResampleMediaPicture : output;
try {
Buffer buffer = picture.getData(0);
int size = picture.getDataPlaneSize(0);
ByteBuffer pictureByteBuffer = buffer.getByteBuffer(0,
size, ref);
buffer.delete();
buffer = null;
if (imageInts != null) {
pictureByteBuffer.order(ByteOrder.BIG_ENDIAN);
IntBuffer pictureIntBuffer = pictureByteBuffer.asIntBuffer();
pictureIntBuffer.put(imageInts);
} else {
pictureByteBuffer.put(imageBytes);
}
pictureByteBuffer = null;
picture.setTimeStamp(timestamp);
picture.setComplete(true);
// resample as needed
if (willResample()) {
resample(output, picture, mToPictureResampler);
}
return output;
} finally {
if (ref.get() != null)
ref.get().delete();
}
} | class class_name[name] begin[{]
method[toPicture, return_type[type[MediaPicture]], modifier[public], parameter[output, input, timestamp]] begin[{]
call[.validateImage, parameter[member[.input]]]
if[binary_operation[member[.output], ==, literal[null]]] begin[{]
assign[member[.output], call[MediaPicture.make, parameter[member[.mPictureWidth], member[.mPictureHeight], call[.getPictureType, parameter[]]]]]
else begin[{]
None
end[}]
local_variable[type[DataBuffer], imageBuffer]
local_variable[type[byte], imageBytes]
local_variable[type[int], imageInts]
if[binary_operation[member[.imageBuffer], instanceof, type[DataBufferByte]]] begin[{]
assign[member[.imageBytes], Cast(expression=MemberReference(member=imageBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DataBufferByte, sub_type=None))]
else begin[{]
if[binary_operation[member[.imageBuffer], instanceof, type[DataBufferInt]]] begin[{]
assign[member[.imageInts], Cast(expression=MemberReference(member=imageBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DataBufferInt, sub_type=None))]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported BufferedImage data buffer type: "), operandr=MethodInvocation(arguments=[], member=getDataType, postfix_operators=[], prefix_operators=[], qualifier=imageBuffer, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
end[}]
end[}]
local_variable[type[AtomicReference], ref]
local_variable[type[MediaPicture], picture]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getData, postfix_operators=[], prefix_operators=[], qualifier=picture, selectors=[], type_arguments=None), name=buffer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Buffer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getDataPlaneSize, postfix_operators=[], prefix_operators=[], qualifier=picture, selectors=[], type_arguments=None), name=size)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByteBuffer, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), name=pictureByteBuffer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteBuffer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=delete, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=imageInts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=imageBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=pictureByteBuffer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=BIG_ENDIAN, postfix_operators=[], prefix_operators=[], qualifier=ByteOrder, selectors=[])], member=order, postfix_operators=[], prefix_operators=[], qualifier=pictureByteBuffer, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=asIntBuffer, postfix_operators=[], prefix_operators=[], qualifier=pictureByteBuffer, selectors=[], type_arguments=None), name=pictureIntBuffer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntBuffer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=imageInts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=pictureIntBuffer, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pictureByteBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=timestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTimeStamp, postfix_operators=[], prefix_operators=[], qualifier=picture, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setComplete, postfix_operators=[], prefix_operators=[], qualifier=picture, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=willResample, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=picture, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mToPictureResampler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resample, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=ref, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=ref, selectors=[MethodInvocation(arguments=[], member=delete, 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[Override] Keyword[public] identifier[MediaPicture] identifier[toPicture] operator[SEP] identifier[MediaPicture] identifier[output] , Keyword[final] identifier[BufferedImage] identifier[input] , Keyword[long] identifier[timestamp] operator[SEP] {
identifier[validateImage] operator[SEP] identifier[input] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[output] operator[==] Other[null] operator[SEP] {
identifier[output] operator[=] identifier[MediaPicture] operator[SEP] identifier[make] operator[SEP] identifier[mPictureWidth] , identifier[mPictureHeight] , identifier[getPictureType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[DataBuffer] identifier[imageBuffer] operator[=] identifier[input] operator[SEP] identifier[getRaster] operator[SEP] operator[SEP] operator[SEP] identifier[getDataBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[imageBytes] operator[=] Other[null] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[imageInts] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[imageBuffer] Keyword[instanceof] identifier[DataBufferByte] operator[SEP] {
identifier[imageBytes] operator[=] operator[SEP] operator[SEP] identifier[DataBufferByte] operator[SEP] identifier[imageBuffer] operator[SEP] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[imageBuffer] Keyword[instanceof] identifier[DataBufferInt] operator[SEP] {
identifier[imageInts] operator[=] operator[SEP] operator[SEP] identifier[DataBufferInt] operator[SEP] identifier[imageBuffer] operator[SEP] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[imageBuffer] operator[SEP] identifier[getDataType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] identifier[AtomicReference] operator[<] identifier[JNIReference] operator[>] identifier[ref] operator[=] Keyword[new] identifier[AtomicReference] operator[<] identifier[JNIReference] operator[>] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[final] identifier[MediaPicture] identifier[picture] operator[=] identifier[willResample] operator[SEP] operator[SEP] operator[?] identifier[mResampleMediaPicture] operator[:] identifier[output] operator[SEP] Keyword[try] {
identifier[Buffer] identifier[buffer] operator[=] identifier[picture] operator[SEP] identifier[getData] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[picture] operator[SEP] identifier[getDataPlaneSize] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[ByteBuffer] identifier[pictureByteBuffer] operator[=] identifier[buffer] operator[SEP] identifier[getByteBuffer] operator[SEP] Other[0] , identifier[size] , identifier[ref] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[imageInts] operator[!=] Other[null] operator[SEP] {
identifier[pictureByteBuffer] operator[SEP] identifier[order] operator[SEP] identifier[ByteOrder] operator[SEP] identifier[BIG_ENDIAN] operator[SEP] operator[SEP] identifier[IntBuffer] identifier[pictureIntBuffer] operator[=] identifier[pictureByteBuffer] operator[SEP] identifier[asIntBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[pictureIntBuffer] operator[SEP] identifier[put] operator[SEP] identifier[imageInts] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[pictureByteBuffer] operator[SEP] identifier[put] operator[SEP] identifier[imageBytes] operator[SEP] operator[SEP]
}
identifier[pictureByteBuffer] operator[=] Other[null] operator[SEP] identifier[picture] operator[SEP] identifier[setTimeStamp] operator[SEP] identifier[timestamp] operator[SEP] operator[SEP] identifier[picture] operator[SEP] identifier[setComplete] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[willResample] operator[SEP] operator[SEP] operator[SEP] {
identifier[resample] operator[SEP] identifier[output] , identifier[picture] , identifier[mToPictureResampler] operator[SEP] operator[SEP]
}
Keyword[return] identifier[output] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[ref] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[ref] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Override
public String asString(Object object)
{
// at this point object is guaranteed to be enumeration
Enum<?> e = (Enum<?>)object;
if(object instanceof OrdinalEnum) {
return Integer.toString(e.ordinal());
}
return e.name();
} | class class_name[name] begin[{]
method[asString, return_type[type[String]], modifier[public], parameter[object]] begin[{]
local_variable[type[Enum], e]
if[binary_operation[member[.object], instanceof, type[OrdinalEnum]]] begin[{]
return[call[Integer.toString, parameter[call[e.ordinal, parameter[]]]]]
else begin[{]
None
end[}]
return[call[e.name, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[asString] operator[SEP] identifier[Object] identifier[object] operator[SEP] {
identifier[Enum] operator[<] operator[?] operator[>] identifier[e] operator[=] operator[SEP] identifier[Enum] operator[<] operator[?] operator[>] operator[SEP] identifier[object] operator[SEP] Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[OrdinalEnum] operator[SEP] {
Keyword[return] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[e] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[e] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP]
}
|
public com.google.api.ads.adwords.axis.v201809.rm.AccountUserListStatus getAccountUserListStatus() {
return accountUserListStatus;
} | class class_name[name] begin[{]
method[getAccountUserListStatus, return_type[type[com]], modifier[public], parameter[]] begin[{]
return[member[.accountUserListStatus]]
end[}]
END[}] | Keyword[public] 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[rm] operator[SEP] identifier[AccountUserListStatus] identifier[getAccountUserListStatus] operator[SEP] operator[SEP] {
Keyword[return] identifier[accountUserListStatus] operator[SEP]
}
|
public String xsdToString(final XmlSchema xsd, final String xsltFileName)
throws XsdGenerationException {
if (_log.isDebugEnabled()) {
StringWriter writer = new StringWriter();
xsd.write(writer);
_log.debug("6. Writing XML Schema: {}", writer.toString());
}
String errorMessage = "Customizing XML Schema failed.";
try {
TransformerFactory tFactory = TransformerFactory.newInstance();
try {
tFactory.setAttribute("indent-number", "4");
} catch (IllegalArgumentException e) {
_log.debug("Unable to set indent-number on transfomer factory",
e);
}
StringWriter writer = new StringWriter();
Source source = new DOMSource(xsd.getAllSchemas()[0]);
Result result = new StreamResult(writer);
Transformer transformer;
if (xsltFileName == null || xsltFileName.trim().length() == 0) {
transformer = tFactory.newTransformer();
} else {
Source xsltSource = new StreamSource(new File(xsltFileName));
transformer = tFactory.newTransformer(xsltSource);
}
transformer.setOutputProperty(OutputKeys.ENCODING, getConfig()
.getXsdEncoding());
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer
.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
transformer.setOutputProperty(OutputKeys.STANDALONE, "no");
transformer.transform(source, result);
writer.flush();
return writer.toString();
} catch (TransformerConfigurationException e) {
_log.error(errorMessage, e);
throw new XsdGenerationException(e);
} catch (TransformerFactoryConfigurationError e) {
_log.error(errorMessage, e);
throw new XsdGenerationException(e);
} catch (TransformerException e) {
_log.error(errorMessage, e);
throw new XsdGenerationException(e);
}
} | class class_name[name] begin[{]
method[xsdToString, return_type[type[String]], modifier[public], parameter[xsd, xsltFileName]] begin[{]
if[call[_log.isDebugEnabled, parameter[]]] begin[{]
local_variable[type[StringWriter], writer]
call[xsd.write, parameter[member[.writer]]]
call[_log.debug, parameter[literal["6. Writing XML Schema: {}"], call[writer.toString, parameter[]]]]
else begin[{]
None
end[}]
local_variable[type[String], errorMessage]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=TransformerFactory, selectors=[], type_arguments=None), name=tFactory)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TransformerFactory, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="indent-number"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="4")], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=tFactory, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to set indent-number on transfomer factory"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringWriter, sub_type=None)), name=writer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringWriter, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getAllSchemas, postfix_operators=[], prefix_operators=[], qualifier=xsd, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DOMSource, sub_type=None)), name=source)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Source, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=writer, 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=StreamResult, sub_type=None)), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Result, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=transformer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Transformer, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=xsltFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=xsltFileName, selectors=[MethodInvocation(arguments=[], member=length, 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=0), operator===), operator=||), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=xsltFileName, 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))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StreamSource, sub_type=None)), name=xsltSource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Source, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=transformer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=xsltSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newTransformer, postfix_operators=[], prefix_operators=[], qualifier=tFactory, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=transformer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=newTransformer, postfix_operators=[], prefix_operators=[], qualifier=tFactory, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ENCODING, postfix_operators=[], prefix_operators=[], qualifier=OutputKeys, selectors=[]), MethodInvocation(arguments=[], member=getConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getXsdEncoding, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setOutputProperty, postfix_operators=[], prefix_operators=[], qualifier=transformer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INDENT, postfix_operators=[], prefix_operators=[], qualifier=OutputKeys, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="yes")], member=setOutputProperty, postfix_operators=[], prefix_operators=[], qualifier=transformer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=OMIT_XML_DECLARATION, postfix_operators=[], prefix_operators=[], qualifier=OutputKeys, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no")], member=setOutputProperty, postfix_operators=[], prefix_operators=[], qualifier=transformer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=STANDALONE, postfix_operators=[], prefix_operators=[], qualifier=OutputKeys, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no")], member=setOutputProperty, postfix_operators=[], prefix_operators=[], qualifier=transformer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transform, postfix_operators=[], prefix_operators=[], qualifier=transformer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=errorMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XsdGenerationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['TransformerConfigurationException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=errorMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XsdGenerationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['TransformerFactoryConfigurationError'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=errorMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XsdGenerationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['TransformerException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[String] identifier[xsdToString] operator[SEP] Keyword[final] identifier[XmlSchema] identifier[xsd] , Keyword[final] identifier[String] identifier[xsltFileName] operator[SEP] Keyword[throws] identifier[XsdGenerationException] {
Keyword[if] operator[SEP] identifier[_log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[StringWriter] identifier[writer] operator[=] Keyword[new] identifier[StringWriter] operator[SEP] operator[SEP] operator[SEP] identifier[xsd] operator[SEP] identifier[write] operator[SEP] identifier[writer] operator[SEP] operator[SEP] identifier[_log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[writer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[errorMessage] operator[=] literal[String] operator[SEP] Keyword[try] {
identifier[TransformerFactory] identifier[tFactory] operator[=] identifier[TransformerFactory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[tFactory] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[e] operator[SEP] {
identifier[_log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
identifier[StringWriter] identifier[writer] operator[=] Keyword[new] identifier[StringWriter] operator[SEP] operator[SEP] operator[SEP] identifier[Source] identifier[source] operator[=] Keyword[new] identifier[DOMSource] operator[SEP] identifier[xsd] operator[SEP] identifier[getAllSchemas] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[Result] identifier[result] operator[=] Keyword[new] identifier[StreamResult] operator[SEP] identifier[writer] operator[SEP] operator[SEP] identifier[Transformer] identifier[transformer] operator[SEP] Keyword[if] operator[SEP] identifier[xsltFileName] operator[==] Other[null] operator[||] identifier[xsltFileName] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[transformer] operator[=] identifier[tFactory] operator[SEP] identifier[newTransformer] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Source] identifier[xsltSource] operator[=] Keyword[new] identifier[StreamSource] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[xsltFileName] operator[SEP] operator[SEP] operator[SEP] identifier[transformer] operator[=] identifier[tFactory] operator[SEP] identifier[newTransformer] operator[SEP] identifier[xsltSource] operator[SEP] operator[SEP]
}
identifier[transformer] operator[SEP] identifier[setOutputProperty] operator[SEP] identifier[OutputKeys] operator[SEP] identifier[ENCODING] , identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getXsdEncoding] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[transformer] operator[SEP] identifier[setOutputProperty] operator[SEP] identifier[OutputKeys] operator[SEP] identifier[INDENT] , literal[String] operator[SEP] operator[SEP] identifier[transformer] operator[SEP] identifier[setOutputProperty] operator[SEP] identifier[OutputKeys] operator[SEP] identifier[OMIT_XML_DECLARATION] , literal[String] operator[SEP] operator[SEP] identifier[transformer] operator[SEP] identifier[setOutputProperty] operator[SEP] identifier[OutputKeys] operator[SEP] identifier[STANDALONE] , literal[String] operator[SEP] operator[SEP] identifier[transformer] operator[SEP] identifier[transform] operator[SEP] identifier[source] , identifier[result] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[writer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[TransformerConfigurationException] identifier[e] operator[SEP] {
identifier[_log] operator[SEP] identifier[error] operator[SEP] identifier[errorMessage] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[XsdGenerationException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[TransformerFactoryConfigurationError] identifier[e] operator[SEP] {
identifier[_log] operator[SEP] identifier[error] operator[SEP] identifier[errorMessage] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[XsdGenerationException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[TransformerException] identifier[e] operator[SEP] {
identifier[_log] operator[SEP] identifier[error] operator[SEP] identifier[errorMessage] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[XsdGenerationException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
static List<String> flaggedKeyValues(final String flagName, @Nullable Map<?, ?> keyValueMapping) {
List<String> result = Lists.newArrayList();
if (keyValueMapping != null && keyValueMapping.size() > 0) {
for (Map.Entry<?, ?> entry : keyValueMapping.entrySet()) {
result.addAll(string(flagName, entry.getKey() + "=" + entry.getValue()));
}
return result;
}
return Collections.emptyList();
} | class class_name[name] begin[{]
method[flaggedKeyValues, return_type[type[List]], modifier[static], parameter[flagName, keyValueMapping]] begin[{]
local_variable[type[List], result]
if[binary_operation[binary_operation[member[.keyValueMapping], !=, literal[null]], &&, binary_operation[call[keyValueMapping.size, parameter[]], >, literal[0]]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=flagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="="), operator=+), operandr=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operator=+)], member=string, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=keyValueMapping, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None), TypeArgument(pattern_type=?, type=None)], dimensions=None, name=Entry, sub_type=None)))), label=None)
return[member[.result]]
else begin[{]
None
end[}]
return[call[Collections.emptyList, parameter[]]]
end[}]
END[}] | Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[flaggedKeyValues] operator[SEP] Keyword[final] identifier[String] identifier[flagName] , annotation[@] identifier[Nullable] identifier[Map] operator[<] operator[?] , operator[?] operator[>] identifier[keyValueMapping] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[result] operator[=] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keyValueMapping] operator[!=] Other[null] operator[&&] identifier[keyValueMapping] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] operator[?] , operator[?] operator[>] identifier[entry] operator[:] identifier[keyValueMapping] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[string] operator[SEP] identifier[flagName] , identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP]
}
|
public void sendOnAirCommand(Set<Integer> deviceNumbersOnAir) throws IOException {
ensureRunning();
byte[] payload = new byte[CHANNELS_ON_AIR_PAYLOAD.length];
System.arraycopy(CHANNELS_ON_AIR_PAYLOAD, 0, payload, 0, CHANNELS_ON_AIR_PAYLOAD.length);
payload[2] = getDeviceNumber();
for (int i = 1; i <= 4; i++) {
if (deviceNumbersOnAir.contains(i)) {
payload[i + 4] = 1;
}
}
assembleAndSendPacket(Util.PacketType.CHANNELS_ON_AIR, payload, getBroadcastAddress(), BeatFinder.BEAT_PORT);
} | class class_name[name] begin[{]
method[sendOnAirCommand, return_type[void], modifier[public], parameter[deviceNumbersOnAir]] begin[{]
call[.ensureRunning, parameter[]]
local_variable[type[byte], payload]
call[System.arraycopy, parameter[member[.CHANNELS_ON_AIR_PAYLOAD], literal[0], member[.payload], literal[0], member[CHANNELS_ON_AIR_PAYLOAD.length]]]
assign[member[.payload], call[.getDeviceNumber, parameter[]]]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=deviceNumbersOnAir, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=payload, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=+))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), 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=4), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[.assembleAndSendPacket, parameter[member[Util.PacketType.CHANNELS_ON_AIR], member[.payload], call[.getBroadcastAddress, parameter[]], member[BeatFinder.BEAT_PORT]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[sendOnAirCommand] operator[SEP] identifier[Set] operator[<] identifier[Integer] operator[>] identifier[deviceNumbersOnAir] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[ensureRunning] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[payload] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[CHANNELS_ON_AIR_PAYLOAD] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[CHANNELS_ON_AIR_PAYLOAD] , Other[0] , identifier[payload] , Other[0] , identifier[CHANNELS_ON_AIR_PAYLOAD] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[payload] operator[SEP] Other[2] operator[SEP] operator[=] identifier[getDeviceNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<=] Other[4] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[deviceNumbersOnAir] operator[SEP] identifier[contains] operator[SEP] identifier[i] operator[SEP] operator[SEP] {
identifier[payload] operator[SEP] identifier[i] operator[+] Other[4] operator[SEP] operator[=] Other[1] operator[SEP]
}
}
identifier[assembleAndSendPacket] operator[SEP] identifier[Util] operator[SEP] identifier[PacketType] operator[SEP] identifier[CHANNELS_ON_AIR] , identifier[payload] , identifier[getBroadcastAddress] operator[SEP] operator[SEP] , identifier[BeatFinder] operator[SEP] identifier[BEAT_PORT] operator[SEP] operator[SEP]
}
|
public void initEndpoints() {
switch (this.getVersion()) {
case 1:
// get number of instances for all command classes on this node.
for (ZWaveCommandClass commandClass : this.getNode().getCommandClasses()) {
if (commandClass.getCommandClass() == CommandClass.NO_OPERATION)
continue;
this.getController().sendData(this.getMultiInstanceGetMessage(commandClass.getCommandClass()));
}
break;
case 2:
this.getController().sendData(this.getMultiChannelEndpointGetMessage());
break;
default:
logger.warn(String.format("Unknown version %d for command class %s (0x%02x)",
this.getVersion(), this.getCommandClass().getLabel(), this.getCommandClass().getKey()));
}
} | class class_name[name] begin[{]
method[initEndpoints, return_type[void], modifier[public], parameter[]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getCommandClass, postfix_operators=[], prefix_operators=[], qualifier=commandClass, selectors=[], type_arguments=None), operandr=MemberReference(member=NO_OPERATION, postfix_operators=[], prefix_operators=[], qualifier=CommandClass, selectors=[]), operator===), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getController, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCommandClass, postfix_operators=[], prefix_operators=[], qualifier=commandClass, selectors=[], type_arguments=None)], member=getMultiInstanceGetMessage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=sendData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getNode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getCommandClasses, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=commandClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ZWaveCommandClass, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getController, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getMultiChannelEndpointGetMessage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=sendData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown version %d for command class %s (0x%02x)"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getVersion, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getCommandClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getLabel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getCommandClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])], expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getVersion, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[initEndpoints] operator[SEP] operator[SEP] {
Keyword[switch] operator[SEP] Keyword[this] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] Other[1] operator[:] Keyword[for] operator[SEP] identifier[ZWaveCommandClass] identifier[commandClass] operator[:] Keyword[this] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] identifier[getCommandClasses] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[commandClass] operator[SEP] identifier[getCommandClass] operator[SEP] operator[SEP] operator[==] identifier[CommandClass] operator[SEP] identifier[NO_OPERATION] operator[SEP] Keyword[continue] operator[SEP] Keyword[this] operator[SEP] identifier[getController] operator[SEP] operator[SEP] operator[SEP] identifier[sendData] operator[SEP] Keyword[this] operator[SEP] identifier[getMultiInstanceGetMessage] operator[SEP] identifier[commandClass] operator[SEP] identifier[getCommandClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] Keyword[this] operator[SEP] identifier[getController] operator[SEP] operator[SEP] operator[SEP] identifier[sendData] operator[SEP] Keyword[this] operator[SEP] identifier[getMultiChannelEndpointGetMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[logger] operator[SEP] identifier[warn] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[getCommandClass] operator[SEP] operator[SEP] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[getCommandClass] operator[SEP] operator[SEP] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void downloadFile(int fileId, java.io.File target, FileSize size)
throws IOException {
WebResource builder = getResourceFactory()
.getFileResource("/" + fileId);
if (size != null) {
builder = builder.path("/" + size.name().toLowerCase());
}
byte[] data = builder.get(byte[].class);
FileUtils.writeByteArrayToFile(target, data);
} | class class_name[name] begin[{]
method[downloadFile, return_type[void], modifier[public], parameter[fileId, target, size]] begin[{]
local_variable[type[WebResource], builder]
if[binary_operation[member[.size], !=, literal[null]]] begin[{]
assign[member[.builder], call[builder.path, parameter[binary_operation[literal["/"], +, call[size.name, parameter[]]]]]]
else begin[{]
None
end[}]
local_variable[type[byte], data]
call[FileUtils.writeByteArrayToFile, parameter[member[.target], member[.data]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[downloadFile] operator[SEP] Keyword[int] identifier[fileId] , identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[File] identifier[target] , identifier[FileSize] identifier[size] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[WebResource] identifier[builder] operator[=] identifier[getResourceFactory] operator[SEP] operator[SEP] operator[SEP] identifier[getFileResource] operator[SEP] literal[String] operator[+] identifier[fileId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[!=] Other[null] operator[SEP] {
identifier[builder] operator[=] identifier[builder] operator[SEP] identifier[path] operator[SEP] literal[String] operator[+] identifier[size] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[builder] operator[SEP] identifier[get] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[FileUtils] operator[SEP] identifier[writeByteArrayToFile] operator[SEP] identifier[target] , identifier[data] operator[SEP] operator[SEP]
}
|
public static CommerceTierPriceEntry findByC_ERC(long companyId,
String externalReferenceCode)
throws com.liferay.commerce.price.list.exception.NoSuchTierPriceEntryException {
return getPersistence().findByC_ERC(companyId, externalReferenceCode);
} | class class_name[name] begin[{]
method[findByC_ERC, return_type[type[CommerceTierPriceEntry]], modifier[public static], parameter[companyId, externalReferenceCode]] begin[{]
return[call[.getPersistence, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[CommerceTierPriceEntry] identifier[findByC_ERC] operator[SEP] Keyword[long] identifier[companyId] , identifier[String] identifier[externalReferenceCode] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[price] operator[SEP] identifier[list] operator[SEP] identifier[exception] operator[SEP] identifier[NoSuchTierPriceEntryException] {
Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByC_ERC] operator[SEP] identifier[companyId] , identifier[externalReferenceCode] operator[SEP] operator[SEP]
}
|
@Override
public boolean disallowRewrites() {
boolean rc = getLink().disallowRewrites();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Rewrites disabled: " + rc);
}
return rc;
} | class class_name[name] begin[{]
method[disallowRewrites, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
local_variable[type[boolean], rc]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[literal["Rewrites disabled: "], +, member[.rc]]]]
else begin[{]
None
end[}]
return[member[.rc]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[disallowRewrites] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[rc] operator[=] identifier[getLink] operator[SEP] operator[SEP] operator[SEP] identifier[disallowRewrites] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[rc] operator[SEP] operator[SEP]
}
Keyword[return] identifier[rc] operator[SEP]
}
|
protected boolean redirectMatches(String requestedRedirect, String redirectUri) {
UriComponents requestedRedirectUri = UriComponentsBuilder.fromUriString(requestedRedirect).build();
UriComponents registeredRedirectUri = UriComponentsBuilder.fromUriString(redirectUri).build();
boolean schemeMatch = isEqual(registeredRedirectUri.getScheme(), requestedRedirectUri.getScheme());
boolean userInfoMatch = isEqual(registeredRedirectUri.getUserInfo(), requestedRedirectUri.getUserInfo());
boolean hostMatch = hostMatches(registeredRedirectUri.getHost(), requestedRedirectUri.getHost());
boolean portMatch = matchPorts ? registeredRedirectUri.getPort() == requestedRedirectUri.getPort() : true;
boolean pathMatch = isEqual(registeredRedirectUri.getPath(),
StringUtils.cleanPath(requestedRedirectUri.getPath()));
boolean queryParamMatch = matchQueryParams(registeredRedirectUri.getQueryParams(),
requestedRedirectUri.getQueryParams());
return schemeMatch && userInfoMatch && hostMatch && portMatch && pathMatch && queryParamMatch;
} | class class_name[name] begin[{]
method[redirectMatches, return_type[type[boolean]], modifier[protected], parameter[requestedRedirect, redirectUri]] begin[{]
local_variable[type[UriComponents], requestedRedirectUri]
local_variable[type[UriComponents], registeredRedirectUri]
local_variable[type[boolean], schemeMatch]
local_variable[type[boolean], userInfoMatch]
local_variable[type[boolean], hostMatch]
local_variable[type[boolean], portMatch]
local_variable[type[boolean], pathMatch]
local_variable[type[boolean], queryParamMatch]
return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.schemeMatch], &&, member[.userInfoMatch]], &&, member[.hostMatch]], &&, member[.portMatch]], &&, member[.pathMatch]], &&, member[.queryParamMatch]]]
end[}]
END[}] | Keyword[protected] Keyword[boolean] identifier[redirectMatches] operator[SEP] identifier[String] identifier[requestedRedirect] , identifier[String] identifier[redirectUri] operator[SEP] {
identifier[UriComponents] identifier[requestedRedirectUri] operator[=] identifier[UriComponentsBuilder] operator[SEP] identifier[fromUriString] operator[SEP] identifier[requestedRedirect] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[UriComponents] identifier[registeredRedirectUri] operator[=] identifier[UriComponentsBuilder] operator[SEP] identifier[fromUriString] operator[SEP] identifier[redirectUri] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[schemeMatch] operator[=] identifier[isEqual] operator[SEP] identifier[registeredRedirectUri] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] , identifier[requestedRedirectUri] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[userInfoMatch] operator[=] identifier[isEqual] operator[SEP] identifier[registeredRedirectUri] operator[SEP] identifier[getUserInfo] operator[SEP] operator[SEP] , identifier[requestedRedirectUri] operator[SEP] identifier[getUserInfo] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[hostMatch] operator[=] identifier[hostMatches] operator[SEP] identifier[registeredRedirectUri] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] , identifier[requestedRedirectUri] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[portMatch] operator[=] identifier[matchPorts] operator[?] identifier[registeredRedirectUri] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[==] identifier[requestedRedirectUri] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[:] literal[boolean] operator[SEP] Keyword[boolean] identifier[pathMatch] operator[=] identifier[isEqual] operator[SEP] identifier[registeredRedirectUri] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[StringUtils] operator[SEP] identifier[cleanPath] operator[SEP] identifier[requestedRedirectUri] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[queryParamMatch] operator[=] identifier[matchQueryParams] operator[SEP] identifier[registeredRedirectUri] operator[SEP] identifier[getQueryParams] operator[SEP] operator[SEP] , identifier[requestedRedirectUri] operator[SEP] identifier[getQueryParams] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[schemeMatch] operator[&&] identifier[userInfoMatch] operator[&&] identifier[hostMatch] operator[&&] identifier[portMatch] operator[&&] identifier[pathMatch] operator[&&] identifier[queryParamMatch] operator[SEP]
}
|
private boolean backtrack()
{
// if B = bottom_of_stack
if (bp == 0)
{
// then fail_and_exit_program
return true;
}
else
{
// B0 <- STACK[B + STACK[B} + 7]
b0 = data.get(bp + data.get(bp) + 7);
// P <- STACK[B + STACK[B] + 4]
ip = data.get(bp + data.get(bp) + 4);
return false;
}
} | class class_name[name] begin[{]
method[backtrack, return_type[type[boolean]], modifier[private], parameter[]] begin[{]
if[binary_operation[member[.bp], ==, literal[0]]] begin[{]
return[literal[true]]
else begin[{]
assign[member[.b0], call[data.get, parameter[binary_operation[binary_operation[member[.bp], +, call[data.get, parameter[member[.bp]]]], +, literal[7]]]]]
assign[member[.ip], call[data.get, parameter[binary_operation[binary_operation[member[.bp], +, call[data.get, parameter[member[.bp]]]], +, literal[4]]]]]
return[literal[false]]
end[}]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[backtrack] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[bp] operator[==] Other[0] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[b0] operator[=] identifier[data] operator[SEP] identifier[get] operator[SEP] identifier[bp] operator[+] identifier[data] operator[SEP] identifier[get] operator[SEP] identifier[bp] operator[SEP] operator[+] Other[7] operator[SEP] operator[SEP] identifier[ip] operator[=] identifier[data] operator[SEP] identifier[get] operator[SEP] identifier[bp] operator[+] identifier[data] operator[SEP] identifier[get] operator[SEP] identifier[bp] operator[SEP] operator[+] Other[4] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
}
|
private void processFilePath(File file) {
try {
if (file.getCanonicalPath().toLowerCase().endsWith(".jar")
|| file.getCanonicalPath().toLowerCase().endsWith(".zip")) {
ZipFile zip = new ZipFile(file);
Enumeration<? extends ZipEntry> entries = zip.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
if (entry.getName().endsWith("class")) {
InputStream zin = zip.getInputStream(entry);
tryClass(entry.getName().replace(File.separatorChar, '.').substring(0, entry.getName().length() - 6));
zin.close();
}
}
}
} catch (IOException e) {
throw new RuntimeException(e);
}
} | class class_name[name] begin[{]
method[processFilePath, return_type[void], modifier[private], parameter[file]] begin[{]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getCanonicalPath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".jar")], member=endsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getCanonicalPath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".zip")], member=endsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ZipFile, sub_type=None)), name=zip)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ZipFile, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=entries, postfix_operators=[], prefix_operators=[], qualifier=zip, selectors=[], type_arguments=None), name=entries)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=ZipEntry, sub_type=None))], dimensions=[], name=Enumeration, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=entries, selectors=[], type_arguments=None), name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ZipEntry, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="class")], member=endsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=zip, selectors=[], type_arguments=None), name=zin)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[MemberReference(member=separatorChar, postfix_operators=[], prefix_operators=[], qualifier=File, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.')], member=replace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[], member=length, 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=6), operator=-)], member=substring, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=tryClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=zin, selectors=[], type_arguments=None), label=None)]))]), condition=MethodInvocation(arguments=[], member=hasMoreElements, postfix_operators=[], prefix_operators=[], qualifier=entries, 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=RuntimeException, 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[void] identifier[processFilePath] operator[SEP] identifier[File] identifier[file] operator[SEP] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[file] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[ZipFile] identifier[zip] operator[=] Keyword[new] identifier[ZipFile] operator[SEP] identifier[file] operator[SEP] operator[SEP] identifier[Enumeration] operator[<] operator[?] Keyword[extends] identifier[ZipEntry] operator[>] identifier[entries] operator[=] identifier[zip] operator[SEP] identifier[entries] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[entries] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] {
identifier[ZipEntry] identifier[entry] operator[=] identifier[entries] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[InputStream] identifier[zin] operator[=] identifier[zip] operator[SEP] identifier[getInputStream] operator[SEP] identifier[entry] operator[SEP] operator[SEP] identifier[tryClass] operator[SEP] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] identifier[File] operator[SEP] identifier[separatorChar] , literal[String] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[6] operator[SEP] operator[SEP] operator[SEP] identifier[zin] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
private void removeNode(TreeNode treeNode) {
removeNodeFromIndex(treeNode.getQueryNode());
TreeNode parentNode = getParentTreeNode(treeNode);
if (parentNode != null) {
accessChildrenRelation(parentNode).removeChild(treeNode);
}
parentIndex.remove(treeNode);
/**
* Its children have no parent anymore
*/
for (TreeNode childTreeNode : childrenIndex.get(treeNode).getChildren()) {
parentIndex.remove(childTreeNode);
}
childrenIndex.remove(treeNode);
} | class class_name[name] begin[{]
method[removeNode, return_type[void], modifier[private], parameter[treeNode]] begin[{]
call[.removeNodeFromIndex, parameter[call[treeNode.getQueryNode, parameter[]]]]
local_variable[type[TreeNode], parentNode]
if[binary_operation[member[.parentNode], !=, literal[null]]] begin[{]
call[.accessChildrenRelation, parameter[member[.parentNode]]]
else begin[{]
None
end[}]
call[parentIndex.remove, parameter[member[.treeNode]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=childTreeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=parentIndex, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=treeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=childrenIndex, selectors=[MethodInvocation(arguments=[], member=getChildren, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=childTreeNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TreeNode, sub_type=None))), label=None)
call[childrenIndex.remove, parameter[member[.treeNode]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[removeNode] operator[SEP] identifier[TreeNode] identifier[treeNode] operator[SEP] {
identifier[removeNodeFromIndex] operator[SEP] identifier[treeNode] operator[SEP] identifier[getQueryNode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[TreeNode] identifier[parentNode] operator[=] identifier[getParentTreeNode] operator[SEP] identifier[treeNode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parentNode] operator[!=] Other[null] operator[SEP] {
identifier[accessChildrenRelation] operator[SEP] identifier[parentNode] operator[SEP] operator[SEP] identifier[removeChild] operator[SEP] identifier[treeNode] operator[SEP] operator[SEP]
}
identifier[parentIndex] operator[SEP] identifier[remove] operator[SEP] identifier[treeNode] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[TreeNode] identifier[childTreeNode] operator[:] identifier[childrenIndex] operator[SEP] identifier[get] operator[SEP] identifier[treeNode] operator[SEP] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] {
identifier[parentIndex] operator[SEP] identifier[remove] operator[SEP] identifier[childTreeNode] operator[SEP] operator[SEP]
}
identifier[childrenIndex] operator[SEP] identifier[remove] operator[SEP] identifier[treeNode] operator[SEP] operator[SEP]
}
|
static void encode(DerOutputStream out, AlgorithmId algid, BitArray key)
throws IOException {
DerOutputStream tmp = new DerOutputStream();
algid.encode(tmp);
tmp.putUnalignedBitString(key);
out.write(DerValue.tag_Sequence, tmp);
} | class class_name[name] begin[{]
method[encode, return_type[void], modifier[static], parameter[out, algid, key]] begin[{]
local_variable[type[DerOutputStream], tmp]
call[algid.encode, parameter[member[.tmp]]]
call[tmp.putUnalignedBitString, parameter[member[.key]]]
call[out.write, parameter[member[DerValue.tag_Sequence], member[.tmp]]]
end[}]
END[}] | Keyword[static] Keyword[void] identifier[encode] operator[SEP] identifier[DerOutputStream] identifier[out] , identifier[AlgorithmId] identifier[algid] , identifier[BitArray] identifier[key] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[DerOutputStream] identifier[tmp] operator[=] Keyword[new] identifier[DerOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[algid] operator[SEP] identifier[encode] operator[SEP] identifier[tmp] operator[SEP] operator[SEP] identifier[tmp] operator[SEP] identifier[putUnalignedBitString] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[DerValue] operator[SEP] identifier[tag_Sequence] , identifier[tmp] operator[SEP] operator[SEP]
}
|
@PrefMetadata(type = CmsHiddenBuiltinPreference.class)
public String getExplorerFileEntryOptions() {
if (m_settings.getExplorerFileEntryOptions() == null) {
return "";
} else {
return "" + m_settings.getExplorerFileEntryOptions();
}
} | class class_name[name] begin[{]
method[getExplorerFileEntryOptions, return_type[type[String]], modifier[public], parameter[]] begin[{]
if[binary_operation[call[m_settings.getExplorerFileEntryOptions, parameter[]], ==, literal[null]]] begin[{]
return[literal[""]]
else begin[{]
return[binary_operation[literal[""], +, call[m_settings.getExplorerFileEntryOptions, parameter[]]]]
end[}]
end[}]
END[}] | annotation[@] identifier[PrefMetadata] operator[SEP] identifier[type] operator[=] identifier[CmsHiddenBuiltinPreference] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[String] identifier[getExplorerFileEntryOptions] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_settings] operator[SEP] identifier[getExplorerFileEntryOptions] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
Keyword[else] {
Keyword[return] literal[String] operator[+] identifier[m_settings] operator[SEP] identifier[getExplorerFileEntryOptions] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public final static int convertToUTF8Bytes(int unicodeScalar, byte[] outputBytes, int offset, int maxLength)
{
int dst = offset;
int end = offset + maxLength;
switch (getUTF8ByteCount(unicodeScalar)) {
case 1:
if (dst >= end) throw new ArrayIndexOutOfBoundsException();
outputBytes[dst++] = (byte)(unicodeScalar & 0xff);
break;
case 2:
if (dst+1 >= end) throw new ArrayIndexOutOfBoundsException();
outputBytes[dst++] = getByte1Of2(unicodeScalar);
outputBytes[dst++] = getByte2Of2(unicodeScalar);
break;
case 3:
if (dst+2 >= end) throw new ArrayIndexOutOfBoundsException();
outputBytes[dst++] = getByte1Of3(unicodeScalar);
outputBytes[dst++] = getByte2Of3(unicodeScalar);
outputBytes[dst++] = getByte3Of3(unicodeScalar);
break;
case 4:
if (dst+3 >= end) throw new ArrayIndexOutOfBoundsException();
outputBytes[dst++] = getByte1Of4(unicodeScalar);
outputBytes[dst++] = getByte2Of4(unicodeScalar);
outputBytes[dst++] = getByte3Of4(unicodeScalar);
outputBytes[dst++] = getByte4Of4(unicodeScalar);
break;
}
return dst - offset;
} | class class_name[name] begin[{]
method[convertToUTF8Bytes, return_type[type[int]], modifier[final public static], parameter[unicodeScalar, outputBytes, offset, maxLength]] begin[{]
local_variable[type[int], dst]
local_variable[type[int], end]
SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayIndexOutOfBoundsException, sub_type=None)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=outputBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dst, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=MemberReference(member=unicodeScalar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), type=BasicType(dimensions=[], name=byte))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayIndexOutOfBoundsException, sub_type=None)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=outputBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dst, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=unicodeScalar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByte1Of2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=outputBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dst, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=unicodeScalar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByte2Of2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayIndexOutOfBoundsException, sub_type=None)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=outputBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dst, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=unicodeScalar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByte1Of3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=outputBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dst, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=unicodeScalar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByte2Of3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=outputBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dst, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=unicodeScalar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByte3Of3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=+), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayIndexOutOfBoundsException, sub_type=None)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=outputBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dst, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=unicodeScalar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByte1Of4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=outputBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dst, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=unicodeScalar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByte2Of4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=outputBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dst, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=unicodeScalar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByte3Of4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=outputBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=dst, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=unicodeScalar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByte4Of4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[MemberReference(member=unicodeScalar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUTF8ByteCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)
return[binary_operation[member[.dst], -, member[.offset]]]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[static] Keyword[int] identifier[convertToUTF8Bytes] operator[SEP] Keyword[int] identifier[unicodeScalar] , Keyword[byte] operator[SEP] operator[SEP] identifier[outputBytes] , Keyword[int] identifier[offset] , Keyword[int] identifier[maxLength] operator[SEP] {
Keyword[int] identifier[dst] operator[=] identifier[offset] operator[SEP] Keyword[int] identifier[end] operator[=] identifier[offset] operator[+] identifier[maxLength] operator[SEP] Keyword[switch] operator[SEP] identifier[getUTF8ByteCount] operator[SEP] identifier[unicodeScalar] operator[SEP] operator[SEP] {
Keyword[case] Other[1] operator[:] Keyword[if] operator[SEP] identifier[dst] operator[>=] identifier[end] operator[SEP] Keyword[throw] Keyword[new] identifier[ArrayIndexOutOfBoundsException] operator[SEP] operator[SEP] operator[SEP] identifier[outputBytes] operator[SEP] identifier[dst] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[unicodeScalar] operator[&] literal[Integer] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] Keyword[if] operator[SEP] identifier[dst] operator[+] Other[1] operator[>=] identifier[end] operator[SEP] Keyword[throw] Keyword[new] identifier[ArrayIndexOutOfBoundsException] operator[SEP] operator[SEP] operator[SEP] identifier[outputBytes] operator[SEP] identifier[dst] operator[++] operator[SEP] operator[=] identifier[getByte1Of2] operator[SEP] identifier[unicodeScalar] operator[SEP] operator[SEP] identifier[outputBytes] operator[SEP] identifier[dst] operator[++] operator[SEP] operator[=] identifier[getByte2Of2] operator[SEP] identifier[unicodeScalar] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[3] operator[:] Keyword[if] operator[SEP] identifier[dst] operator[+] Other[2] operator[>=] identifier[end] operator[SEP] Keyword[throw] Keyword[new] identifier[ArrayIndexOutOfBoundsException] operator[SEP] operator[SEP] operator[SEP] identifier[outputBytes] operator[SEP] identifier[dst] operator[++] operator[SEP] operator[=] identifier[getByte1Of3] operator[SEP] identifier[unicodeScalar] operator[SEP] operator[SEP] identifier[outputBytes] operator[SEP] identifier[dst] operator[++] operator[SEP] operator[=] identifier[getByte2Of3] operator[SEP] identifier[unicodeScalar] operator[SEP] operator[SEP] identifier[outputBytes] operator[SEP] identifier[dst] operator[++] operator[SEP] operator[=] identifier[getByte3Of3] operator[SEP] identifier[unicodeScalar] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[4] operator[:] Keyword[if] operator[SEP] identifier[dst] operator[+] Other[3] operator[>=] identifier[end] operator[SEP] Keyword[throw] Keyword[new] identifier[ArrayIndexOutOfBoundsException] operator[SEP] operator[SEP] operator[SEP] identifier[outputBytes] operator[SEP] identifier[dst] operator[++] operator[SEP] operator[=] identifier[getByte1Of4] operator[SEP] identifier[unicodeScalar] operator[SEP] operator[SEP] identifier[outputBytes] operator[SEP] identifier[dst] operator[++] operator[SEP] operator[=] identifier[getByte2Of4] operator[SEP] identifier[unicodeScalar] operator[SEP] operator[SEP] identifier[outputBytes] operator[SEP] identifier[dst] operator[++] operator[SEP] operator[=] identifier[getByte3Of4] operator[SEP] identifier[unicodeScalar] operator[SEP] operator[SEP] identifier[outputBytes] operator[SEP] identifier[dst] operator[++] operator[SEP] operator[=] identifier[getByte4Of4] operator[SEP] identifier[unicodeScalar] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[return] identifier[dst] operator[-] identifier[offset] operator[SEP]
}
|
private void commitPrepared(Xid xid) throws XAException {
try {
// Check preconditions. The connection mustn't be used for another
// other XA or local transaction, or the COMMIT PREPARED command
// would mess it up.
if (state != STATE_IDLE || conn.getTransaction().hasBufferedMutations()) {
throw new CloudSpannerXAException(CloudSpannerXAException.TWO_PHASE_IDLE,
Code.FAILED_PRECONDITION, XAException.XAER_RMERR);
}
String s = RecoveredXid.xidToString(xid);
localAutoCommitMode = conn.getAutoCommit();
conn.setAutoCommit(true);
try {
conn.commitPreparedTransaction(s);
} finally {
conn.setAutoCommit(localAutoCommitMode);
}
} catch (CloudSpannerSQLException ex) {
throw new CloudSpannerXAException(CloudSpannerXAException.ERROR_COMMIT_PREPARED, ex,
XAException.XAER_RMERR);
} catch (SQLException ex) {
throw new CloudSpannerXAException(CloudSpannerXAException.ERROR_COMMIT_PREPARED, ex,
Code.UNKNOWN, XAException.XAER_RMERR);
}
} | class class_name[name] begin[{]
method[commitPrepared, return_type[void], modifier[private], parameter[xid]] begin[{]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=STATE_IDLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operandr=MethodInvocation(arguments=[], member=getTransaction, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[MethodInvocation(arguments=[], member=hasBufferedMutations, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=TWO_PHASE_IDLE, postfix_operators=[], prefix_operators=[], qualifier=CloudSpannerXAException, selectors=[]), MemberReference(member=FAILED_PRECONDITION, postfix_operators=[], prefix_operators=[], qualifier=Code, selectors=[]), MemberReference(member=XAER_RMERR, postfix_operators=[], prefix_operators=[], qualifier=XAException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CloudSpannerXAException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=xid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=xidToString, postfix_operators=[], prefix_operators=[], qualifier=RecoveredXid, selectors=[], type_arguments=None), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=localAutoCommitMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getAutoCommit, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAutoCommit, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=commitPreparedTransaction, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=localAutoCommitMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAutoCommit, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ERROR_COMMIT_PREPARED, postfix_operators=[], prefix_operators=[], qualifier=CloudSpannerXAException, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=XAER_RMERR, postfix_operators=[], prefix_operators=[], qualifier=XAException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CloudSpannerXAException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['CloudSpannerSQLException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ERROR_COMMIT_PREPARED, postfix_operators=[], prefix_operators=[], qualifier=CloudSpannerXAException, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UNKNOWN, postfix_operators=[], prefix_operators=[], qualifier=Code, selectors=[]), MemberReference(member=XAER_RMERR, postfix_operators=[], prefix_operators=[], qualifier=XAException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CloudSpannerXAException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SQLException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[commitPrepared] operator[SEP] identifier[Xid] identifier[xid] operator[SEP] Keyword[throws] identifier[XAException] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[state] operator[!=] identifier[STATE_IDLE] operator[||] identifier[conn] operator[SEP] identifier[getTransaction] operator[SEP] operator[SEP] operator[SEP] identifier[hasBufferedMutations] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CloudSpannerXAException] operator[SEP] identifier[CloudSpannerXAException] operator[SEP] identifier[TWO_PHASE_IDLE] , identifier[Code] operator[SEP] identifier[FAILED_PRECONDITION] , identifier[XAException] operator[SEP] identifier[XAER_RMERR] operator[SEP] operator[SEP]
}
identifier[String] identifier[s] operator[=] identifier[RecoveredXid] operator[SEP] identifier[xidToString] operator[SEP] identifier[xid] operator[SEP] operator[SEP] identifier[localAutoCommitMode] operator[=] identifier[conn] operator[SEP] identifier[getAutoCommit] operator[SEP] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[setAutoCommit] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[try] {
identifier[conn] operator[SEP] identifier[commitPreparedTransaction] operator[SEP] identifier[s] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[conn] operator[SEP] identifier[setAutoCommit] operator[SEP] identifier[localAutoCommitMode] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[CloudSpannerSQLException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CloudSpannerXAException] operator[SEP] identifier[CloudSpannerXAException] operator[SEP] identifier[ERROR_COMMIT_PREPARED] , identifier[ex] , identifier[XAException] operator[SEP] identifier[XAER_RMERR] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SQLException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CloudSpannerXAException] operator[SEP] identifier[CloudSpannerXAException] operator[SEP] identifier[ERROR_COMMIT_PREPARED] , identifier[ex] , identifier[Code] operator[SEP] identifier[UNKNOWN] , identifier[XAException] operator[SEP] identifier[XAER_RMERR] operator[SEP] operator[SEP]
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.