code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
---|---|---|
public void read(byte[] bytes, long storageIndex) throws IOException {
LOGGER.debug("Starting to read with param: " + "\nstorageIndex = " + storageIndex
+ "\nbytes.length = " + bytes.length);
jCloudsStorageModule.read(bytes, storageIndex);
} | class class_name[name] begin[{]
method[read, return_type[void], modifier[public], parameter[bytes, storageIndex]] begin[{]
call[LOGGER.debug, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Starting to read with param: "], +, literal["\nstorageIndex = "]], +, member[.storageIndex]], +, literal["\nbytes.length = "]], +, member[bytes.length]]]]
call[jCloudsStorageModule.read, parameter[member[.bytes], member[.storageIndex]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[read] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] , Keyword[long] identifier[storageIndex] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] literal[String] operator[+] identifier[storageIndex] operator[+] literal[String] operator[+] identifier[bytes] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[jCloudsStorageModule] operator[SEP] identifier[read] operator[SEP] identifier[bytes] , identifier[storageIndex] operator[SEP] operator[SEP]
}
|
public void stop() {
synchronized (this.startStopMonitor) {
doStop();
// If we registered a JVM shutdown hook, we don't need it anymore now:
// We've already explicitly closed the context.
if (this.shutdownHook != null) {
try {
Runtime.getRuntime().removeShutdownHook(this.shutdownHook);
} catch (final IllegalStateException ex) {
// ignore - VM is already shutting down
}
}
}
} | class class_name[name] begin[{]
method[stop, return_type[void], modifier[public], parameter[]] begin[{]
SYNCHRONIZED[THIS[member[None.startStopMonitor]]] BEGIN[{]
call[.doStop, parameter[]]
if[binary_operation[THIS[member[None.shutdownHook]], !=, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getRuntime, postfix_operators=[], prefix_operators=[], qualifier=Runtime, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=shutdownHook, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=removeShutdownHook, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IllegalStateException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
END[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[stop] operator[SEP] operator[SEP] {
Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[startStopMonitor] operator[SEP] {
identifier[doStop] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[shutdownHook] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[Runtime] operator[SEP] identifier[getRuntime] operator[SEP] operator[SEP] operator[SEP] identifier[removeShutdownHook] operator[SEP] Keyword[this] operator[SEP] identifier[shutdownHook] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[IllegalStateException] identifier[ex] operator[SEP] {
}
}
}
}
|
@Nullable
public SerializedValue<TaskInformation> getSerializedTaskInformation() {
if (serializedTaskInformation instanceof NonOffloaded) {
NonOffloaded<TaskInformation> taskInformation =
(NonOffloaded<TaskInformation>) serializedTaskInformation;
return taskInformation.serializedValue;
} else {
throw new IllegalStateException(
"Trying to work with offloaded serialized job information.");
}
} | class class_name[name] begin[{]
method[getSerializedTaskInformation, return_type[type[SerializedValue]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.serializedTaskInformation], instanceof, type[NonOffloaded]]] begin[{]
local_variable[type[NonOffloaded], taskInformation]
return[member[taskInformation.serializedValue]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Trying to work with offloaded serialized job information.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
end[}]
end[}]
END[}] | annotation[@] identifier[Nullable] Keyword[public] identifier[SerializedValue] operator[<] identifier[TaskInformation] operator[>] identifier[getSerializedTaskInformation] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[serializedTaskInformation] Keyword[instanceof] identifier[NonOffloaded] operator[SEP] {
identifier[NonOffloaded] operator[<] identifier[TaskInformation] operator[>] identifier[taskInformation] operator[=] operator[SEP] identifier[NonOffloaded] operator[<] identifier[TaskInformation] operator[>] operator[SEP] identifier[serializedTaskInformation] operator[SEP] Keyword[return] identifier[taskInformation] operator[SEP] identifier[serializedValue] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
public TypedQuery<T> select(Filter filter, OrderBy orderBy) {
CriteriaQuery<T> query = cb.createQuery(getEntityClass());
Root<T> from = query.from(getEntityClass());
CriteriaMapper criteriaMapper = new CriteriaMapper(from, cb);
if (orderBy != null) {
query.orderBy(criteriaMapper.create(orderBy));
}
if (filter != null) {
query.where(criteriaMapper.create(filter));
}
return getEntityManager().createQuery(query);
} | class class_name[name] begin[{]
method[select, return_type[type[TypedQuery]], modifier[public], parameter[filter, orderBy]] begin[{]
local_variable[type[CriteriaQuery], query]
local_variable[type[Root], from]
local_variable[type[CriteriaMapper], criteriaMapper]
if[binary_operation[member[.orderBy], !=, literal[null]]] begin[{]
call[query.orderBy, parameter[call[criteriaMapper.create, parameter[member[.orderBy]]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.filter], !=, literal[null]]] begin[{]
call[query.where, parameter[call[criteriaMapper.create, parameter[member[.filter]]]]]
else begin[{]
None
end[}]
return[call[.getEntityManager, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[TypedQuery] operator[<] identifier[T] operator[>] identifier[select] operator[SEP] identifier[Filter] identifier[filter] , identifier[OrderBy] identifier[orderBy] operator[SEP] {
identifier[CriteriaQuery] operator[<] identifier[T] operator[>] identifier[query] operator[=] identifier[cb] operator[SEP] identifier[createQuery] operator[SEP] identifier[getEntityClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Root] operator[<] identifier[T] operator[>] identifier[from] operator[=] identifier[query] operator[SEP] identifier[from] operator[SEP] identifier[getEntityClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[CriteriaMapper] identifier[criteriaMapper] operator[=] Keyword[new] identifier[CriteriaMapper] operator[SEP] identifier[from] , identifier[cb] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[orderBy] operator[!=] Other[null] operator[SEP] {
identifier[query] operator[SEP] identifier[orderBy] operator[SEP] identifier[criteriaMapper] operator[SEP] identifier[create] operator[SEP] identifier[orderBy] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[filter] operator[!=] Other[null] operator[SEP] {
identifier[query] operator[SEP] identifier[where] operator[SEP] identifier[criteriaMapper] operator[SEP] identifier[create] operator[SEP] identifier[filter] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[getEntityManager] operator[SEP] operator[SEP] operator[SEP] identifier[createQuery] operator[SEP] identifier[query] operator[SEP] operator[SEP]
}
|
public int getParameters(char[] array, int currentIndex, StringBuffer velocityBlock, char endingChar,
VelocityParserContext context)
{
char beginChar = array[currentIndex];
int i = currentIndex + 1;
int depth = 1;
while (i < array.length) {
if (array[i] == endingChar) {
--depth;
if (depth == 0) {
++i;
break;
}
} else if (array[i] == beginChar) {
++depth;
} else if (array[i] == '"' || array[i] == '\'') {
i = getEscape(array, i, null, context);
continue;
}
++i;
}
if (velocityBlock != null) {
velocityBlock.append(array, currentIndex, i - currentIndex);
}
return i;
} | class class_name[name] begin[{]
method[getParameters, return_type[type[int]], modifier[public], parameter[array, currentIndex, velocityBlock, endingChar, context]] begin[{]
local_variable[type[char], beginChar]
local_variable[type[int], i]
local_variable[type[int], depth]
while[binary_operation[member[.i], <, member[array.length]]] begin[{]
if[binary_operation[member[.array], ==, member[.endingChar]]] begin[{]
member[.depth]
if[binary_operation[member[.depth], ==, literal[0]]] begin[{]
member[.i]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[member[.array], ==, member[.beginChar]]] begin[{]
member[.depth]
else begin[{]
if[binary_operation[binary_operation[member[.array], ==, literal['"']], ||, binary_operation[member[.array], ==, literal['\'']]]] begin[{]
assign[member[.i], call[.getEscape, parameter[member[.array], member[.i], literal[null], member[.context]]]]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
end[}]
end[}]
member[.i]
end[}]
if[binary_operation[member[.velocityBlock], !=, literal[null]]] begin[{]
call[velocityBlock.append, parameter[member[.array], member[.currentIndex], binary_operation[member[.i], -, member[.currentIndex]]]]
else begin[{]
None
end[}]
return[member[.i]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[getParameters] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[array] , Keyword[int] identifier[currentIndex] , identifier[StringBuffer] identifier[velocityBlock] , Keyword[char] identifier[endingChar] , identifier[VelocityParserContext] identifier[context] operator[SEP] {
Keyword[char] identifier[beginChar] operator[=] identifier[array] operator[SEP] identifier[currentIndex] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[currentIndex] operator[+] Other[1] operator[SEP] Keyword[int] identifier[depth] operator[=] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[<] identifier[array] operator[SEP] identifier[length] operator[SEP] {
Keyword[if] operator[SEP] identifier[array] operator[SEP] identifier[i] operator[SEP] operator[==] identifier[endingChar] operator[SEP] {
operator[--] identifier[depth] operator[SEP] Keyword[if] operator[SEP] identifier[depth] operator[==] Other[0] operator[SEP] {
operator[++] identifier[i] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[array] operator[SEP] identifier[i] operator[SEP] operator[==] identifier[beginChar] operator[SEP] {
operator[++] identifier[depth] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[array] operator[SEP] identifier[i] operator[SEP] operator[==] literal[String] operator[||] identifier[array] operator[SEP] identifier[i] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[i] operator[=] identifier[getEscape] operator[SEP] identifier[array] , identifier[i] , Other[null] , identifier[context] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
} operator[++] identifier[i] operator[SEP]
}
Keyword[if] operator[SEP] identifier[velocityBlock] operator[!=] Other[null] operator[SEP] {
identifier[velocityBlock] operator[SEP] identifier[append] operator[SEP] identifier[array] , identifier[currentIndex] , identifier[i] operator[-] identifier[currentIndex] operator[SEP] operator[SEP]
}
Keyword[return] identifier[i] operator[SEP]
}
|
public static DateIterator getDateIterator(ICalComponent component, TimeZone timezone) {
DateStart dtstart = component.getProperty(DateStart.class);
ICalDate start = ValuedProperty.getValue(dtstart);
/*
* If the start date is just a date and does not have a time component,
* then the default timezone must be used, because this is the timezone
* biweekly used to parse the date.
*/
if (start != null && !start.hasTime()) {
timezone = TimeZone.getDefault();
}
/////////////INCLUDE/////////////
List<RecurrenceIterator> include = new ArrayList<RecurrenceIterator>();
if (start != null) {
for (RecurrenceRule rrule : component.getProperties(RecurrenceRule.class)) {
Recurrence recurrence = ValuedProperty.getValue(rrule);
if (recurrence != null) {
include.add(createRecurrenceIterator(recurrence, start, timezone));
}
}
}
List<ICalDate> allDates = new ArrayList<ICalDate>();
for (RecurrenceDates rdate : component.getProperties(RecurrenceDates.class)) {
allDates.addAll(rdate.getDates());
}
if (!allDates.isEmpty()) {
include.add(new ICalDateRecurrenceIterator(allDates));
}
if (include.isEmpty()) {
if (start == null) {
return new EmptyDateIterator();
}
include.add(new ICalDateRecurrenceIterator(Arrays.asList(start)));
}
/////////////EXCLUDE/////////////
List<RecurrenceIterator> exclude = new ArrayList<RecurrenceIterator>();
if (start != null) {
for (ExceptionRule exrule : component.getProperties(ExceptionRule.class)) {
Recurrence recurrence = ValuedProperty.getValue(exrule);
if (recurrence != null) {
exclude.add(createRecurrenceIterator(recurrence, start, timezone));
}
}
}
allDates = new ArrayList<ICalDate>();
for (ExceptionDates exdate : component.getProperties(ExceptionDates.class)) {
allDates.addAll(exdate.getValues());
}
if (!allDates.isEmpty()) {
exclude.add(new ICalDateRecurrenceIterator(allDates));
}
/////////////JOIN/////////////
RecurrenceIterator includeJoined = join(include);
if (exclude.isEmpty()) {
return DateIteratorFactory.createDateIterator(includeJoined);
}
RecurrenceIterator excludeJoined = join(exclude);
RecurrenceIterator iterator = RecurrenceIteratorFactory.except(includeJoined, excludeJoined);
return DateIteratorFactory.createDateIterator(iterator);
} | class class_name[name] begin[{]
method[getDateIterator, return_type[type[DateIterator]], modifier[public static], parameter[component, timezone]] begin[{]
local_variable[type[DateStart], dtstart]
local_variable[type[ICalDate], start]
if[binary_operation[binary_operation[member[.start], !=, literal[null]], &&, call[start.hasTime, parameter[]]]] begin[{]
assign[member[.timezone], call[TimeZone.getDefault, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[List], include]
if[binary_operation[member[.start], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=rrule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=ValuedProperty, selectors=[], type_arguments=None), name=recurrence)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Recurrence, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=recurrence, 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=[MethodInvocation(arguments=[MemberReference(member=recurrence, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timezone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createRecurrenceIterator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=include, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RecurrenceRule, sub_type=None))], member=getProperties, postfix_operators=[], prefix_operators=[], qualifier=component, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rrule)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RecurrenceRule, sub_type=None))), label=None)
else begin[{]
None
end[}]
local_variable[type[List], allDates]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDates, postfix_operators=[], prefix_operators=[], qualifier=rdate, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=allDates, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RecurrenceDates, sub_type=None))], member=getProperties, postfix_operators=[], prefix_operators=[], qualifier=component, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rdate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RecurrenceDates, sub_type=None))), label=None)
if[call[allDates.isEmpty, parameter[]]] begin[{]
call[include.add, parameter[ClassCreator(arguments=[MemberReference(member=allDates, 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=ICalDateRecurrenceIterator, sub_type=None))]]
else begin[{]
None
end[}]
if[call[include.isEmpty, parameter[]]] begin[{]
if[binary_operation[member[.start], ==, literal[null]]] begin[{]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EmptyDateIterator, sub_type=None))]
else begin[{]
None
end[}]
call[include.add, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ICalDateRecurrenceIterator, sub_type=None))]]
else begin[{]
None
end[}]
local_variable[type[List], exclude]
if[binary_operation[member[.start], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=exrule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=ValuedProperty, selectors=[], type_arguments=None), name=recurrence)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Recurrence, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=recurrence, 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=[MethodInvocation(arguments=[MemberReference(member=recurrence, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timezone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createRecurrenceIterator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=exclude, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExceptionRule, sub_type=None))], member=getProperties, postfix_operators=[], prefix_operators=[], qualifier=component, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=exrule)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExceptionRule, sub_type=None))), label=None)
else begin[{]
None
end[}]
assign[member[.allDates], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ICalDate, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValues, postfix_operators=[], prefix_operators=[], qualifier=exdate, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=allDates, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExceptionDates, sub_type=None))], member=getProperties, postfix_operators=[], prefix_operators=[], qualifier=component, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=exdate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExceptionDates, sub_type=None))), label=None)
if[call[allDates.isEmpty, parameter[]]] begin[{]
call[exclude.add, parameter[ClassCreator(arguments=[MemberReference(member=allDates, 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=ICalDateRecurrenceIterator, sub_type=None))]]
else begin[{]
None
end[}]
local_variable[type[RecurrenceIterator], includeJoined]
if[call[exclude.isEmpty, parameter[]]] begin[{]
return[call[DateIteratorFactory.createDateIterator, parameter[member[.includeJoined]]]]
else begin[{]
None
end[}]
local_variable[type[RecurrenceIterator], excludeJoined]
local_variable[type[RecurrenceIterator], iterator]
return[call[DateIteratorFactory.createDateIterator, parameter[member[.iterator]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[DateIterator] identifier[getDateIterator] operator[SEP] identifier[ICalComponent] identifier[component] , identifier[TimeZone] identifier[timezone] operator[SEP] {
identifier[DateStart] identifier[dtstart] operator[=] identifier[component] operator[SEP] identifier[getProperty] operator[SEP] identifier[DateStart] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[ICalDate] identifier[start] operator[=] identifier[ValuedProperty] operator[SEP] identifier[getValue] operator[SEP] identifier[dtstart] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[start] operator[!=] Other[null] operator[&&] operator[!] identifier[start] operator[SEP] identifier[hasTime] operator[SEP] operator[SEP] operator[SEP] {
identifier[timezone] operator[=] identifier[TimeZone] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[RecurrenceIterator] operator[>] identifier[include] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[RecurrenceIterator] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[start] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[RecurrenceRule] identifier[rrule] operator[:] identifier[component] operator[SEP] identifier[getProperties] operator[SEP] identifier[RecurrenceRule] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[Recurrence] identifier[recurrence] operator[=] identifier[ValuedProperty] operator[SEP] identifier[getValue] operator[SEP] identifier[rrule] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[recurrence] operator[!=] Other[null] operator[SEP] {
identifier[include] operator[SEP] identifier[add] operator[SEP] identifier[createRecurrenceIterator] operator[SEP] identifier[recurrence] , identifier[start] , identifier[timezone] operator[SEP] operator[SEP] operator[SEP]
}
}
}
identifier[List] operator[<] identifier[ICalDate] operator[>] identifier[allDates] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ICalDate] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[RecurrenceDates] identifier[rdate] operator[:] identifier[component] operator[SEP] identifier[getProperties] operator[SEP] identifier[RecurrenceDates] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[allDates] operator[SEP] identifier[addAll] operator[SEP] identifier[rdate] operator[SEP] identifier[getDates] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[allDates] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[include] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ICalDateRecurrenceIterator] operator[SEP] identifier[allDates] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[include] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[start] operator[==] Other[null] operator[SEP] {
Keyword[return] Keyword[new] identifier[EmptyDateIterator] operator[SEP] operator[SEP] operator[SEP]
}
identifier[include] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ICalDateRecurrenceIterator] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[RecurrenceIterator] operator[>] identifier[exclude] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[RecurrenceIterator] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[start] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[ExceptionRule] identifier[exrule] operator[:] identifier[component] operator[SEP] identifier[getProperties] operator[SEP] identifier[ExceptionRule] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[Recurrence] identifier[recurrence] operator[=] identifier[ValuedProperty] operator[SEP] identifier[getValue] operator[SEP] identifier[exrule] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[recurrence] operator[!=] Other[null] operator[SEP] {
identifier[exclude] operator[SEP] identifier[add] operator[SEP] identifier[createRecurrenceIterator] operator[SEP] identifier[recurrence] , identifier[start] , identifier[timezone] operator[SEP] operator[SEP] operator[SEP]
}
}
}
identifier[allDates] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ICalDate] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ExceptionDates] identifier[exdate] operator[:] identifier[component] operator[SEP] identifier[getProperties] operator[SEP] identifier[ExceptionDates] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[allDates] operator[SEP] identifier[addAll] operator[SEP] identifier[exdate] operator[SEP] identifier[getValues] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[allDates] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[exclude] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ICalDateRecurrenceIterator] operator[SEP] identifier[allDates] operator[SEP] operator[SEP] operator[SEP]
}
identifier[RecurrenceIterator] identifier[includeJoined] operator[=] identifier[join] operator[SEP] identifier[include] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[exclude] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[DateIteratorFactory] operator[SEP] identifier[createDateIterator] operator[SEP] identifier[includeJoined] operator[SEP] operator[SEP]
}
identifier[RecurrenceIterator] identifier[excludeJoined] operator[=] identifier[join] operator[SEP] identifier[exclude] operator[SEP] operator[SEP] identifier[RecurrenceIterator] identifier[iterator] operator[=] identifier[RecurrenceIteratorFactory] operator[SEP] identifier[except] operator[SEP] identifier[includeJoined] , identifier[excludeJoined] operator[SEP] operator[SEP] Keyword[return] identifier[DateIteratorFactory] operator[SEP] identifier[createDateIterator] operator[SEP] identifier[iterator] operator[SEP] operator[SEP]
}
|
public void setDialogPublishSiblings(String mode) {
boolean publishSiblings = false;
if (mode.equalsIgnoreCase(PUBLISHMODE_SIBLINGS)) {
publishSiblings = true;
}
setDialogPublishSiblings(publishSiblings);
} | class class_name[name] begin[{]
method[setDialogPublishSiblings, return_type[void], modifier[public], parameter[mode]] begin[{]
local_variable[type[boolean], publishSiblings]
if[call[mode.equalsIgnoreCase, parameter[member[.PUBLISHMODE_SIBLINGS]]]] begin[{]
assign[member[.publishSiblings], literal[true]]
else begin[{]
None
end[}]
call[.setDialogPublishSiblings, parameter[member[.publishSiblings]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setDialogPublishSiblings] operator[SEP] identifier[String] identifier[mode] operator[SEP] {
Keyword[boolean] identifier[publishSiblings] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[mode] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[PUBLISHMODE_SIBLINGS] operator[SEP] operator[SEP] {
identifier[publishSiblings] operator[=] literal[boolean] operator[SEP]
}
identifier[setDialogPublishSiblings] operator[SEP] identifier[publishSiblings] operator[SEP] operator[SEP]
}
|
public final BindDeviceToGatewayResponse bindDeviceToGateway(
String parent, String gatewayId, String deviceId) {
BindDeviceToGatewayRequest request =
BindDeviceToGatewayRequest.newBuilder()
.setParent(parent)
.setGatewayId(gatewayId)
.setDeviceId(deviceId)
.build();
return bindDeviceToGateway(request);
} | class class_name[name] begin[{]
method[bindDeviceToGateway, return_type[type[BindDeviceToGatewayResponse]], modifier[final public], parameter[parent, gatewayId, deviceId]] begin[{]
local_variable[type[BindDeviceToGatewayRequest], request]
return[call[.bindDeviceToGateway, parameter[member[.request]]]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[BindDeviceToGatewayResponse] identifier[bindDeviceToGateway] operator[SEP] identifier[String] identifier[parent] , identifier[String] identifier[gatewayId] , identifier[String] identifier[deviceId] operator[SEP] {
identifier[BindDeviceToGatewayRequest] identifier[request] operator[=] identifier[BindDeviceToGatewayRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setParent] operator[SEP] identifier[parent] operator[SEP] operator[SEP] identifier[setGatewayId] operator[SEP] identifier[gatewayId] operator[SEP] operator[SEP] identifier[setDeviceId] operator[SEP] identifier[deviceId] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[bindDeviceToGateway] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static void writeAnalysisHTMLToFile(String outputPath, DataAnalysis dataAnalysis, JavaSparkContext sc) {
try {
String analysisAsHtml = HtmlAnalysis.createHtmlAnalysisString(dataAnalysis);
writeStringToFile(outputPath, analysisAsHtml, sc);
} catch (Exception e) {
throw new RuntimeException("Error generating or writing HTML analysis file (normalized data)", e);
}
} | class class_name[name] begin[{]
method[writeAnalysisHTMLToFile, return_type[void], modifier[public static], parameter[outputPath, dataAnalysis, sc]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dataAnalysis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createHtmlAnalysisString, postfix_operators=[], prefix_operators=[], qualifier=HtmlAnalysis, selectors=[], type_arguments=None), name=analysisAsHtml)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=outputPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=analysisAsHtml, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeStringToFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error generating or writing HTML analysis file (normalized data)"), 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=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[writeAnalysisHTMLToFile] operator[SEP] identifier[String] identifier[outputPath] , identifier[DataAnalysis] identifier[dataAnalysis] , identifier[JavaSparkContext] identifier[sc] operator[SEP] {
Keyword[try] {
identifier[String] identifier[analysisAsHtml] operator[=] identifier[HtmlAnalysis] operator[SEP] identifier[createHtmlAnalysisString] operator[SEP] identifier[dataAnalysis] operator[SEP] operator[SEP] identifier[writeStringToFile] operator[SEP] identifier[outputPath] , identifier[analysisAsHtml] , identifier[sc] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@SuppressWarnings("unchecked")
public <T> List<T> convertList(Class<T> eleType) {
if (null == list || list.isEmpty())
return (List<T>) list;
List<T> re = new ArrayList<T>(list.size());
Castors castors = Castors.me();
for (Object obj : list)
re.add(castors.castTo(obj, eleType));
return re;
} | class class_name[name] begin[{]
method[convertList, return_type[type[List]], modifier[public], parameter[eleType]] begin[{]
if[binary_operation[binary_operation[literal[null], ==, member[.list]], ||, call[list.isEmpty, parameter[]]]] begin[{]
return[Cast(expression=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=List, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[List], re]
local_variable[type[Castors], castors]
ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=eleType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=castTo, postfix_operators=[], prefix_operators=[], qualifier=castors, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=re, 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=obj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
return[member[.re]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[convertList] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[eleType] operator[SEP] {
Keyword[if] operator[SEP] Other[null] operator[==] identifier[list] operator[||] identifier[list] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[List] operator[<] identifier[T] operator[>] operator[SEP] identifier[list] operator[SEP] identifier[List] operator[<] identifier[T] operator[>] identifier[re] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[T] operator[>] operator[SEP] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Castors] identifier[castors] operator[=] identifier[Castors] operator[SEP] identifier[me] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[obj] operator[:] identifier[list] operator[SEP] identifier[re] operator[SEP] identifier[add] operator[SEP] identifier[castors] operator[SEP] identifier[castTo] operator[SEP] identifier[obj] , identifier[eleType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[re] operator[SEP]
}
|
protected final Optional<UserProfile> retrieveUserProfile(final C credentials, final WebContext context) {
final Optional<UserProfile> profile = this.profileCreator.create(credentials, context);
logger.debug("profile: {}", profile);
return profile;
} | class class_name[name] begin[{]
method[retrieveUserProfile, return_type[type[Optional]], modifier[final protected], parameter[credentials, context]] begin[{]
local_variable[type[Optional], profile]
call[logger.debug, parameter[literal["profile: {}"], member[.profile]]]
return[member[.profile]]
end[}]
END[}] | Keyword[protected] Keyword[final] identifier[Optional] operator[<] identifier[UserProfile] operator[>] identifier[retrieveUserProfile] operator[SEP] Keyword[final] identifier[C] identifier[credentials] , Keyword[final] identifier[WebContext] identifier[context] operator[SEP] {
Keyword[final] identifier[Optional] operator[<] identifier[UserProfile] operator[>] identifier[profile] operator[=] Keyword[this] operator[SEP] identifier[profileCreator] operator[SEP] identifier[create] operator[SEP] identifier[credentials] , identifier[context] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[profile] operator[SEP] operator[SEP] Keyword[return] identifier[profile] operator[SEP]
}
|
public static ValidatorConfiguration createExperimental() {
Map<Check, Level> checks = getStandardChecks();
checks.put(GdlArityCheck.INSTANCE, Level.ERROR);
checks.put(GdlNotInRuleHeadCheck.INSTANCE, Level.ERROR);
checks.put(UnrecognizedGdlArgumentCheck.INSTANCE, Level.WARNING);
// (gdl random)
checks.put(GdlRandomGoalCheck.INSTANCE, Level.ERROR);
return new ValidatorConfiguration(checks);
} | class class_name[name] begin[{]
method[createExperimental, return_type[type[ValidatorConfiguration]], modifier[public static], parameter[]] begin[{]
local_variable[type[Map], checks]
call[checks.put, parameter[member[GdlArityCheck.INSTANCE], member[Level.ERROR]]]
call[checks.put, parameter[member[GdlNotInRuleHeadCheck.INSTANCE], member[Level.ERROR]]]
call[checks.put, parameter[member[UnrecognizedGdlArgumentCheck.INSTANCE], member[Level.WARNING]]]
call[checks.put, parameter[member[GdlRandomGoalCheck.INSTANCE], member[Level.ERROR]]]
return[ClassCreator(arguments=[MemberReference(member=checks, 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=ValidatorConfiguration, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ValidatorConfiguration] identifier[createExperimental] operator[SEP] operator[SEP] {
identifier[Map] operator[<] identifier[Check] , identifier[Level] operator[>] identifier[checks] operator[=] identifier[getStandardChecks] operator[SEP] operator[SEP] operator[SEP] identifier[checks] operator[SEP] identifier[put] operator[SEP] identifier[GdlArityCheck] operator[SEP] identifier[INSTANCE] , identifier[Level] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[checks] operator[SEP] identifier[put] operator[SEP] identifier[GdlNotInRuleHeadCheck] operator[SEP] identifier[INSTANCE] , identifier[Level] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] identifier[checks] operator[SEP] identifier[put] operator[SEP] identifier[UnrecognizedGdlArgumentCheck] operator[SEP] identifier[INSTANCE] , identifier[Level] operator[SEP] identifier[WARNING] operator[SEP] operator[SEP] identifier[checks] operator[SEP] identifier[put] operator[SEP] identifier[GdlRandomGoalCheck] operator[SEP] identifier[INSTANCE] , identifier[Level] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ValidatorConfiguration] operator[SEP] identifier[checks] operator[SEP] operator[SEP]
}
|
public static File copyFile(InputStream is, boolean deleteOnExit) throws IOException {
File f = File.createTempFile("php", ".php");
if (deleteOnExit) {
f.deleteOnExit();
}
FileWriter fw = new FileWriter(f);
copyFile(new BufferedReader(new InputStreamReader(is)), new BufferedWriter(fw));
is.close();
fw.close();
return f;
} | class class_name[name] begin[{]
method[copyFile, return_type[type[File]], modifier[public static], parameter[is, deleteOnExit]] begin[{]
local_variable[type[File], f]
if[member[.deleteOnExit]] begin[{]
call[f.deleteOnExit, parameter[]]
else begin[{]
None
end[}]
local_variable[type[FileWriter], fw]
call[.copyFile, parameter[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=is, 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=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None)), ClassCreator(arguments=[MemberReference(member=fw, 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=BufferedWriter, sub_type=None))]]
call[is.close, parameter[]]
call[fw.close, parameter[]]
return[member[.f]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[File] identifier[copyFile] operator[SEP] identifier[InputStream] identifier[is] , Keyword[boolean] identifier[deleteOnExit] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[File] identifier[f] operator[=] identifier[File] operator[SEP] identifier[createTempFile] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[deleteOnExit] operator[SEP] {
identifier[f] operator[SEP] identifier[deleteOnExit] operator[SEP] operator[SEP] operator[SEP]
}
identifier[FileWriter] identifier[fw] operator[=] Keyword[new] identifier[FileWriter] operator[SEP] identifier[f] operator[SEP] operator[SEP] identifier[copyFile] operator[SEP] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[is] operator[SEP] operator[SEP] , Keyword[new] identifier[BufferedWriter] operator[SEP] identifier[fw] operator[SEP] operator[SEP] operator[SEP] identifier[is] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[fw] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[f] operator[SEP]
}
|
public static void printf(Object self, String format, Object arg) {
if (self instanceof PrintStream)
printf((PrintStream) self, format, arg);
else if (self instanceof Writer)
printf((Writer) self, format, arg);
else
printf(System.out, format, arg);
} | class class_name[name] begin[{]
method[printf, return_type[void], modifier[public static], parameter[self, format, arg]] begin[{]
if[binary_operation[member[.self], instanceof, type[PrintStream]]] begin[{]
call[.printf, parameter[Cast(expression=MemberReference(member=self, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PrintStream, sub_type=None)), member[.format], member[.arg]]]
else begin[{]
if[binary_operation[member[.self], instanceof, type[Writer]]] begin[{]
call[.printf, parameter[Cast(expression=MemberReference(member=self, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Writer, sub_type=None)), member[.format], member[.arg]]]
else begin[{]
call[.printf, parameter[member[System.out], member[.format], member[.arg]]]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[printf] operator[SEP] identifier[Object] identifier[self] , identifier[String] identifier[format] , identifier[Object] identifier[arg] operator[SEP] {
Keyword[if] operator[SEP] identifier[self] Keyword[instanceof] identifier[PrintStream] operator[SEP] identifier[printf] operator[SEP] operator[SEP] identifier[PrintStream] operator[SEP] identifier[self] , identifier[format] , identifier[arg] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[self] Keyword[instanceof] identifier[Writer] operator[SEP] identifier[printf] operator[SEP] operator[SEP] identifier[Writer] operator[SEP] identifier[self] , identifier[format] , identifier[arg] operator[SEP] operator[SEP] Keyword[else] identifier[printf] operator[SEP] identifier[System] operator[SEP] identifier[out] , identifier[format] , identifier[arg] operator[SEP] operator[SEP]
}
|
private static long getMaxTTL(Map<byte[], Long> ttlByFamily) {
long maxTTL = 0;
for (Long familyTTL : ttlByFamily.values()) {
maxTTL = Math.max(familyTTL <= 0 ? Long.MAX_VALUE : familyTTL, maxTTL);
}
return maxTTL == 0 ? Long.MAX_VALUE : maxTTL;
} | class class_name[name] begin[{]
method[getMaxTTL, return_type[type[long]], modifier[private static], parameter[ttlByFamily]] begin[{]
local_variable[type[long], maxTTL]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxTTL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=familyTTL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<=), if_false=MemberReference(member=familyTTL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[])), MemberReference(member=maxTTL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=ttlByFamily, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=familyTTL)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))), label=None)
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=maxTTL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=MemberReference(member=maxTTL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]))]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[long] identifier[getMaxTTL] operator[SEP] identifier[Map] operator[<] Keyword[byte] operator[SEP] operator[SEP] , identifier[Long] operator[>] identifier[ttlByFamily] operator[SEP] {
Keyword[long] identifier[maxTTL] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Long] identifier[familyTTL] operator[:] identifier[ttlByFamily] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
identifier[maxTTL] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[familyTTL] operator[<=] Other[0] operator[?] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[:] identifier[familyTTL] , identifier[maxTTL] operator[SEP] operator[SEP]
}
Keyword[return] identifier[maxTTL] operator[==] Other[0] operator[?] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[:] identifier[maxTTL] operator[SEP]
}
|
public static String nativeDirectorySeparator(final String path) {
if (path == null)
return StringUtil.empty;
return path.replace("/", directorySeparator).replace("\\", directorySeparator);
} | class class_name[name] begin[{]
method[nativeDirectorySeparator, return_type[type[String]], modifier[public static], parameter[path]] begin[{]
if[binary_operation[member[.path], ==, literal[null]]] begin[{]
return[member[StringUtil.empty]]
else begin[{]
None
end[}]
return[call[path.replace, parameter[literal["/"], member[.directorySeparator]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[nativeDirectorySeparator] operator[SEP] Keyword[final] identifier[String] identifier[path] operator[SEP] {
Keyword[if] operator[SEP] identifier[path] operator[==] Other[null] operator[SEP] Keyword[return] identifier[StringUtil] operator[SEP] identifier[empty] operator[SEP] Keyword[return] identifier[path] operator[SEP] identifier[replace] operator[SEP] literal[String] , identifier[directorySeparator] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , identifier[directorySeparator] operator[SEP] operator[SEP]
}
|
public void inactivateSubProcess(String spPid) {
synchronized (fileList) { // always lock fileList first to avoid deadlock
synchronized(activeFilesMap) { // Right into sync block because 99% case is that map contains pid
activeFilesMap.remove(spPid) ;
}
}
if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) {
debugLogger.logp(Level.FINE, thisClass, "inactivateSubProcess", "Inactivated pid: "+spPid) ;
}
} | class class_name[name] begin[{]
method[inactivateSubProcess, return_type[void], modifier[public], parameter[spPid]] begin[{]
SYNCHRONIZED[member[.fileList]] BEGIN[{]
SYNCHRONIZED[member[.activeFilesMap]] BEGIN[{]
call[activeFilesMap.remove, parameter[member[.spPid]]]
END[}]
END[}]
if[binary_operation[call[debugLogger.isLoggable, parameter[member[Level.FINE]]], &&, call[LogRepositoryBaseImpl.isDebugEnabled, parameter[]]]] begin[{]
call[debugLogger.logp, parameter[member[Level.FINE], member[.thisClass], literal["inactivateSubProcess"], binary_operation[literal["Inactivated pid: "], +, member[.spPid]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[inactivateSubProcess] operator[SEP] identifier[String] identifier[spPid] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[fileList] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[activeFilesMap] operator[SEP] {
identifier[activeFilesMap] operator[SEP] identifier[remove] operator[SEP] identifier[spPid] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[debugLogger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[&&] identifier[LogRepositoryBaseImpl] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[debugLogger] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[thisClass] , literal[String] , literal[String] operator[+] identifier[spPid] operator[SEP] operator[SEP]
}
}
|
public static String getFirstLabel(final LabelOrBuilder label) throws NotAvailableException {
for (Label.MapFieldEntry entry : label.getEntryList()) {
for (String value : entry.getValueList()) {
return value;
}
}
throw new NotAvailableException("Label");
} | class class_name[name] begin[{]
method[getFirstLabel, return_type[type[String]], modifier[public static], parameter[label]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getValueList, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getEntryList, postfix_operators=[], prefix_operators=[], qualifier=label, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Label, sub_type=ReferenceType(arguments=None, dimensions=None, name=MapFieldEntry, sub_type=None)))), label=None)
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Label")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NotAvailableException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getFirstLabel] operator[SEP] Keyword[final] identifier[LabelOrBuilder] identifier[label] operator[SEP] Keyword[throws] identifier[NotAvailableException] {
Keyword[for] operator[SEP] identifier[Label] operator[SEP] identifier[MapFieldEntry] identifier[entry] operator[:] identifier[label] operator[SEP] identifier[getEntryList] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[value] operator[:] identifier[entry] operator[SEP] identifier[getValueList] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[value] operator[SEP]
}
}
Keyword[throw] Keyword[new] identifier[NotAvailableException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
public static IJedisPool createJedisPool(String server, int timeout) {
int maxActive = 32;
return createJedisPool(server, timeout, maxActive, null);
} | class class_name[name] begin[{]
method[createJedisPool, return_type[type[IJedisPool]], modifier[public static], parameter[server, timeout]] begin[{]
local_variable[type[int], maxActive]
return[call[.createJedisPool, parameter[member[.server], member[.timeout], member[.maxActive], literal[null]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[IJedisPool] identifier[createJedisPool] operator[SEP] identifier[String] identifier[server] , Keyword[int] identifier[timeout] operator[SEP] {
Keyword[int] identifier[maxActive] operator[=] Other[32] operator[SEP] Keyword[return] identifier[createJedisPool] operator[SEP] identifier[server] , identifier[timeout] , identifier[maxActive] , Other[null] operator[SEP] operator[SEP]
}
|
public static <T> Mono<T> first(Iterable<? extends Mono<? extends T>> monos) {
return onAssembly(new MonoFirst<>(monos));
} | class class_name[name] begin[{]
method[first, return_type[type[Mono]], modifier[public static], parameter[monos]] begin[{]
return[call[.onAssembly, parameter[ClassCreator(arguments=[MemberReference(member=monos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=MonoFirst, sub_type=None))]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Mono] operator[<] identifier[T] operator[>] identifier[first] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[Mono] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] operator[>] identifier[monos] operator[SEP] {
Keyword[return] identifier[onAssembly] operator[SEP] Keyword[new] identifier[MonoFirst] operator[<] operator[>] operator[SEP] identifier[monos] operator[SEP] operator[SEP] operator[SEP]
}
|
void initialize() {
Preconditions.checkState(this.database.get() == null, "%s has already been initialized.", this.logId);
try {
clear(true);
this.database.set(openDatabase());
} catch (Exception ex) {
// Make sure we cleanup anything we may have created in case of failure.
try {
close();
} catch (Exception closeEx) {
ex.addSuppressed(closeEx);
}
throw ex;
}
log.info("{}: Initialized.", this.logId);
} | class class_name[name] begin[{]
method[initialize, return_type[void], modifier[default], parameter[]] begin[{]
call[Preconditions.checkState, parameter[binary_operation[THIS[member[None.database]call[None.get, parameter[]]], ==, literal[null]], literal["%s has already been initialized."], THIS[member[None.logId]]]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=clear, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=database, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=openDatabase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=set, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, 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=[MemberReference(member=closeEx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addSuppressed, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=closeEx, types=['Exception']))], finally_block=None, label=None, resources=None), ThrowStatement(expression=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None)
call[log.info, parameter[literal["{}: Initialized."], THIS[member[None.logId]]]]
end[}]
END[}] | Keyword[void] identifier[initialize] operator[SEP] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkState] operator[SEP] Keyword[this] operator[SEP] identifier[database] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[==] Other[null] , literal[String] , Keyword[this] operator[SEP] identifier[logId] operator[SEP] operator[SEP] Keyword[try] {
identifier[clear] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[database] operator[SEP] identifier[set] operator[SEP] identifier[openDatabase] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
Keyword[try] {
identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[closeEx] operator[SEP] {
identifier[ex] operator[SEP] identifier[addSuppressed] operator[SEP] identifier[closeEx] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[ex] operator[SEP]
}
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[logId] operator[SEP] operator[SEP]
}
|
protected SqlNode getAggregate(SqlSelect select) {
SqlNode node = select.getGroup();
if (node != null) {
return node;
}
node = select.getHaving();
if (node != null) {
return node;
}
return getAgg(select);
} | class class_name[name] begin[{]
method[getAggregate, return_type[type[SqlNode]], modifier[protected], parameter[select]] begin[{]
local_variable[type[SqlNode], node]
if[binary_operation[member[.node], !=, literal[null]]] begin[{]
return[member[.node]]
else begin[{]
None
end[}]
assign[member[.node], call[select.getHaving, parameter[]]]
if[binary_operation[member[.node], !=, literal[null]]] begin[{]
return[member[.node]]
else begin[{]
None
end[}]
return[call[.getAgg, parameter[member[.select]]]]
end[}]
END[}] | Keyword[protected] identifier[SqlNode] identifier[getAggregate] operator[SEP] identifier[SqlSelect] identifier[select] operator[SEP] {
identifier[SqlNode] identifier[node] operator[=] identifier[select] operator[SEP] identifier[getGroup] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[node] operator[SEP]
}
identifier[node] operator[=] identifier[select] operator[SEP] identifier[getHaving] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[node] operator[SEP]
}
Keyword[return] identifier[getAgg] operator[SEP] identifier[select] operator[SEP] operator[SEP]
}
|
@GwtIncompatible("ObjectOutputStream")
public void serialize(OutputStream objectOutputStream) throws IOException {
new java.io.ObjectOutputStream(objectOutputStream).writeObject(this);
} | class class_name[name] begin[{]
method[serialize, return_type[void], modifier[public], parameter[objectOutputStream]] begin[{]
ClassCreator(arguments=[MemberReference(member=objectOutputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=writeObject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=io, sub_type=ReferenceType(arguments=None, dimensions=None, name=ObjectOutputStream, sub_type=None))))
end[}]
END[}] | annotation[@] identifier[GwtIncompatible] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[serialize] operator[SEP] identifier[OutputStream] identifier[objectOutputStream] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[new] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[ObjectOutputStream] operator[SEP] identifier[objectOutputStream] operator[SEP] operator[SEP] identifier[writeObject] operator[SEP] Keyword[this] operator[SEP] operator[SEP]
}
|
@Override
public void close() {
val bk = this.bookKeeper.getAndSet(null);
if (bk != null) {
try {
bk.close();
} catch (Exception ex) {
log.error("Unable to close BookKeeper client.", ex);
}
}
} | class class_name[name] begin[{]
method[close, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[val], bk]
if[binary_operation[member[.bk], !=, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=bk, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to close BookKeeper client."), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] {
identifier[val] identifier[bk] operator[=] Keyword[this] operator[SEP] identifier[bookKeeper] operator[SEP] identifier[getAndSet] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bk] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[bk] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP]
}
}
}
|
public void marshall(GetImportJobsRequest getImportJobsRequest, ProtocolMarshaller protocolMarshaller) {
if (getImportJobsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(getImportJobsRequest.getApplicationId(), APPLICATIONID_BINDING);
protocolMarshaller.marshall(getImportJobsRequest.getPageSize(), PAGESIZE_BINDING);
protocolMarshaller.marshall(getImportJobsRequest.getToken(), TOKEN_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[getImportJobsRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.getImportJobsRequest], ==, 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=getApplicationId, postfix_operators=[], prefix_operators=[], qualifier=getImportJobsRequest, selectors=[], type_arguments=None), MemberReference(member=APPLICATIONID_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=getPageSize, postfix_operators=[], prefix_operators=[], qualifier=getImportJobsRequest, selectors=[], type_arguments=None), MemberReference(member=PAGESIZE_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=getToken, postfix_operators=[], prefix_operators=[], qualifier=getImportJobsRequest, selectors=[], type_arguments=None), MemberReference(member=TOKEN_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[GetImportJobsRequest] identifier[getImportJobsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[getImportJobsRequest] 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[getImportJobsRequest] operator[SEP] identifier[getApplicationId] operator[SEP] operator[SEP] , identifier[APPLICATIONID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[getImportJobsRequest] operator[SEP] identifier[getPageSize] operator[SEP] operator[SEP] , identifier[PAGESIZE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[getImportJobsRequest] operator[SEP] identifier[getToken] operator[SEP] operator[SEP] , identifier[TOKEN_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 marshall(AccessPoliciesStatus accessPoliciesStatus, ProtocolMarshaller protocolMarshaller) {
if (accessPoliciesStatus == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(accessPoliciesStatus.getOptions(), OPTIONS_BINDING);
protocolMarshaller.marshall(accessPoliciesStatus.getStatus(), STATUS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} | class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[accessPoliciesStatus, protocolMarshaller]] begin[{]
if[binary_operation[member[.accessPoliciesStatus], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOptions, postfix_operators=[], prefix_operators=[], qualifier=accessPoliciesStatus, selectors=[], type_arguments=None), MemberReference(member=OPTIONS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=accessPoliciesStatus, selectors=[], type_arguments=None), MemberReference(member=STATUS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[AccessPoliciesStatus] identifier[accessPoliciesStatus] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[accessPoliciesStatus] 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[accessPoliciesStatus] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] , identifier[OPTIONS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[accessPoliciesStatus] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[STATUS_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
protected DataType parseExactNumericType( DdlTokenStream tokens ) throws ParsingException {
DataType dataType = null;
String typeName = null;
if (tokens.matchesAnyOf("INTEGER", "INT", "SMALLINT")) {
dataType = new DataType();
typeName = consume(tokens, dataType, false);
dataType.setName(typeName);
} else if (tokens.matchesAnyOf("NUMERIC", "DECIMAL", "DEC")) {
dataType = new DataType();
typeName = consume(tokens, dataType, false);
dataType.setName(typeName);
int precision = 0;
int scale = 0;
if (tokens.matches(L_PAREN)) {
consume(tokens, dataType, false, L_PAREN);
precision = (int)parseLong(tokens, dataType);
if (canConsume(tokens, dataType, false, COMMA)) {
scale = (int)parseLong(tokens, dataType);
} else {
scale = getDefaultScale();
}
consume(tokens, dataType, false, R_PAREN);
} else {
precision = getDefaultPrecision();
scale = getDefaultScale();
}
dataType.setPrecision(precision);
dataType.setScale(scale);
}
return dataType;
} | class class_name[name] begin[{]
method[parseExactNumericType, return_type[type[DataType]], modifier[protected], parameter[tokens]] begin[{]
local_variable[type[DataType], dataType]
local_variable[type[String], typeName]
if[call[tokens.matchesAnyOf, parameter[literal["INTEGER"], literal["INT"], literal["SMALLINT"]]]] begin[{]
assign[member[.dataType], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DataType, sub_type=None))]
assign[member[.typeName], call[.consume, parameter[member[.tokens], member[.dataType], literal[false]]]]
call[dataType.setName, parameter[member[.typeName]]]
else begin[{]
if[call[tokens.matchesAnyOf, parameter[literal["NUMERIC"], literal["DECIMAL"], literal["DEC"]]]] begin[{]
assign[member[.dataType], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DataType, sub_type=None))]
assign[member[.typeName], call[.consume, parameter[member[.tokens], member[.dataType], literal[false]]]]
call[dataType.setName, parameter[member[.typeName]]]
local_variable[type[int], precision]
local_variable[type[int], scale]
if[call[tokens.matches, parameter[member[.L_PAREN]]]] begin[{]
call[.consume, parameter[member[.tokens], member[.dataType], literal[false], member[.L_PAREN]]]
assign[member[.precision], Cast(expression=MethodInvocation(arguments=[MemberReference(member=tokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))]
if[call[.canConsume, parameter[member[.tokens], member[.dataType], literal[false], member[.COMMA]]]] begin[{]
assign[member[.scale], Cast(expression=MethodInvocation(arguments=[MemberReference(member=tokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))]
else begin[{]
assign[member[.scale], call[.getDefaultScale, parameter[]]]
end[}]
call[.consume, parameter[member[.tokens], member[.dataType], literal[false], member[.R_PAREN]]]
else begin[{]
assign[member[.precision], call[.getDefaultPrecision, parameter[]]]
assign[member[.scale], call[.getDefaultScale, parameter[]]]
end[}]
call[dataType.setPrecision, parameter[member[.precision]]]
call[dataType.setScale, parameter[member[.scale]]]
else begin[{]
None
end[}]
end[}]
return[member[.dataType]]
end[}]
END[}] | Keyword[protected] identifier[DataType] identifier[parseExactNumericType] operator[SEP] identifier[DdlTokenStream] identifier[tokens] operator[SEP] Keyword[throws] identifier[ParsingException] {
identifier[DataType] identifier[dataType] operator[=] Other[null] operator[SEP] identifier[String] identifier[typeName] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[tokens] operator[SEP] identifier[matchesAnyOf] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] {
identifier[dataType] operator[=] Keyword[new] identifier[DataType] operator[SEP] operator[SEP] operator[SEP] identifier[typeName] operator[=] identifier[consume] operator[SEP] identifier[tokens] , identifier[dataType] , literal[boolean] operator[SEP] operator[SEP] identifier[dataType] operator[SEP] identifier[setName] operator[SEP] identifier[typeName] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[tokens] operator[SEP] identifier[matchesAnyOf] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] {
identifier[dataType] operator[=] Keyword[new] identifier[DataType] operator[SEP] operator[SEP] operator[SEP] identifier[typeName] operator[=] identifier[consume] operator[SEP] identifier[tokens] , identifier[dataType] , literal[boolean] operator[SEP] operator[SEP] identifier[dataType] operator[SEP] identifier[setName] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] Keyword[int] identifier[precision] operator[=] Other[0] operator[SEP] Keyword[int] identifier[scale] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[tokens] operator[SEP] identifier[matches] operator[SEP] identifier[L_PAREN] operator[SEP] operator[SEP] {
identifier[consume] operator[SEP] identifier[tokens] , identifier[dataType] , literal[boolean] , identifier[L_PAREN] operator[SEP] operator[SEP] identifier[precision] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[parseLong] operator[SEP] identifier[tokens] , identifier[dataType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[canConsume] operator[SEP] identifier[tokens] , identifier[dataType] , literal[boolean] , identifier[COMMA] operator[SEP] operator[SEP] {
identifier[scale] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[parseLong] operator[SEP] identifier[tokens] , identifier[dataType] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[scale] operator[=] identifier[getDefaultScale] operator[SEP] operator[SEP] operator[SEP]
}
identifier[consume] operator[SEP] identifier[tokens] , identifier[dataType] , literal[boolean] , identifier[R_PAREN] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[precision] operator[=] identifier[getDefaultPrecision] operator[SEP] operator[SEP] operator[SEP] identifier[scale] operator[=] identifier[getDefaultScale] operator[SEP] operator[SEP] operator[SEP]
}
identifier[dataType] operator[SEP] identifier[setPrecision] operator[SEP] identifier[precision] operator[SEP] operator[SEP] identifier[dataType] operator[SEP] identifier[setScale] operator[SEP] identifier[scale] operator[SEP] operator[SEP]
}
Keyword[return] identifier[dataType] operator[SEP]
}
|
@Override
public DaoResult create(T bo) {
if (bo == null) {
return null;
}
try (Connection conn = getConnection()) {
return create(conn, bo);
} catch (SQLException e) {
throw new DaoException(e);
}
} | class class_name[name] begin[{]
method[create, return_type[type[DaoResult]], modifier[public], parameter[bo]] begin[{]
if[binary_operation[member[.bo], ==, literal[null]]] begin[{]
return[literal[null]]
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=create, 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=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))])
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[DaoResult] identifier[create] operator[SEP] identifier[T] identifier[bo] operator[SEP] {
Keyword[if] operator[SEP] identifier[bo] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[try] operator[SEP] identifier[Connection] identifier[conn] operator[=] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[create] 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]
}
}
|
protected List<MethodNode> findMethodsWithGenerated(ClassNode receiver, String name) {
List<MethodNode> methods = receiver.getMethods(name);
if (methods.isEmpty() || receiver.isResolved()) return methods;
List<MethodNode> result = addGeneratedMethods(receiver, methods);
return result;
} | class class_name[name] begin[{]
method[findMethodsWithGenerated, return_type[type[List]], modifier[protected], parameter[receiver, name]] begin[{]
local_variable[type[List], methods]
if[binary_operation[call[methods.isEmpty, parameter[]], ||, call[receiver.isResolved, parameter[]]]] begin[{]
return[member[.methods]]
else begin[{]
None
end[}]
local_variable[type[List], result]
return[member[.result]]
end[}]
END[}] | Keyword[protected] identifier[List] operator[<] identifier[MethodNode] operator[>] identifier[findMethodsWithGenerated] operator[SEP] identifier[ClassNode] identifier[receiver] , identifier[String] identifier[name] operator[SEP] {
identifier[List] operator[<] identifier[MethodNode] operator[>] identifier[methods] operator[=] identifier[receiver] operator[SEP] identifier[getMethods] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[methods] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] identifier[receiver] operator[SEP] identifier[isResolved] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[methods] operator[SEP] identifier[List] operator[<] identifier[MethodNode] operator[>] identifier[result] operator[=] identifier[addGeneratedMethods] operator[SEP] identifier[receiver] , identifier[methods] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
private void transfer(Socket sourceSocket, Source source, Sink sink) {
try {
Buffer buffer = new Buffer();
for (long byteCount; (byteCount = source.read(buffer, 8192L)) != -1; ) {
sink.write(buffer, byteCount);
sink.flush();
}
} catch (IOException e) {
System.out.println("transfer failed from " + sourceSocket + ": " + e);
} finally {
closeQuietly(sink);
closeQuietly(source);
closeQuietly(sourceSocket);
openSockets.remove(sourceSocket);
}
} | class class_name[name] begin[{]
method[transfer, return_type[void], modifier[private], parameter[sourceSocket, source, sink]] begin[{]
TryStatement(block=[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=Buffer, sub_type=None)), name=buffer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Buffer, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=byteCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=sink, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=sink, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=byteCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8192L)], member=read, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=byteCount)], modifiers=set(), type=BasicType(dimensions=[], name=long)), update=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="transfer failed from "), operandr=MemberReference(member=sourceSocket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sourceSocket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sourceSocket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=openSockets, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[transfer] operator[SEP] identifier[Socket] identifier[sourceSocket] , identifier[Source] identifier[source] , identifier[Sink] identifier[sink] operator[SEP] {
Keyword[try] {
identifier[Buffer] identifier[buffer] operator[=] Keyword[new] identifier[Buffer] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[long] identifier[byteCount] operator[SEP] operator[SEP] identifier[byteCount] operator[=] identifier[source] operator[SEP] identifier[read] operator[SEP] identifier[buffer] , Other[8192L] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] operator[SEP] {
identifier[sink] operator[SEP] identifier[write] operator[SEP] identifier[buffer] , identifier[byteCount] operator[SEP] operator[SEP] identifier[sink] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[sourceSocket] operator[+] literal[String] operator[+] identifier[e] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[closeQuietly] operator[SEP] identifier[sink] operator[SEP] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[sourceSocket] operator[SEP] operator[SEP] identifier[openSockets] operator[SEP] identifier[remove] operator[SEP] identifier[sourceSocket] operator[SEP] operator[SEP]
}
}
|
@Nonnull
public static DoubleBinaryOperator dblBinaryOperatorFrom(Consumer<DoubleBinaryOperatorBuilder> buildingFunction) {
DoubleBinaryOperatorBuilder builder = new DoubleBinaryOperatorBuilder();
buildingFunction.accept(builder);
return builder.build();
} | class class_name[name] begin[{]
method[dblBinaryOperatorFrom, return_type[type[DoubleBinaryOperator]], modifier[public static], parameter[buildingFunction]] begin[{]
local_variable[type[DoubleBinaryOperatorBuilder], builder]
call[buildingFunction.accept, parameter[member[.builder]]]
return[call[builder.build, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[DoubleBinaryOperator] identifier[dblBinaryOperatorFrom] operator[SEP] identifier[Consumer] operator[<] identifier[DoubleBinaryOperatorBuilder] operator[>] identifier[buildingFunction] operator[SEP] {
identifier[DoubleBinaryOperatorBuilder] identifier[builder] operator[=] Keyword[new] identifier[DoubleBinaryOperatorBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[buildingFunction] operator[SEP] identifier[accept] operator[SEP] identifier[builder] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void handleChannelData(final String action, final JSONArray jsonArray) throws BitfinexClientException {
BitfinexTick tick = jsonToBitfinexTick(jsonArray);
tickConsumer.accept(symbol, tick);
} | class class_name[name] begin[{]
method[handleChannelData, return_type[void], modifier[public], parameter[action, jsonArray]] begin[{]
local_variable[type[BitfinexTick], tick]
call[tickConsumer.accept, parameter[member[.symbol], member[.tick]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handleChannelData] operator[SEP] Keyword[final] identifier[String] identifier[action] , Keyword[final] identifier[JSONArray] identifier[jsonArray] operator[SEP] Keyword[throws] identifier[BitfinexClientException] {
identifier[BitfinexTick] identifier[tick] operator[=] identifier[jsonToBitfinexTick] operator[SEP] identifier[jsonArray] operator[SEP] operator[SEP] identifier[tickConsumer] operator[SEP] identifier[accept] operator[SEP] identifier[symbol] , identifier[tick] operator[SEP] operator[SEP]
}
|
private BeanSpec beanSpecOf(Field field, Type genericType) {
return of(field, genericType, injector);
// int len = typeArgs.size();
// for (int i = 0; i < len; ++i) {
// if (genericType.equals(typeArgs.get(i))) {
// return of(field, typeImpls.get(i), injector());
// }
// }
// return of(field, injector);
} | class class_name[name] begin[{]
method[beanSpecOf, return_type[type[BeanSpec]], modifier[private], parameter[field, genericType]] begin[{]
return[call[.of, parameter[member[.field], member[.genericType], member[.injector]]]]
end[}]
END[}] | Keyword[private] identifier[BeanSpec] identifier[beanSpecOf] operator[SEP] identifier[Field] identifier[field] , identifier[Type] identifier[genericType] operator[SEP] {
Keyword[return] identifier[of] operator[SEP] identifier[field] , identifier[genericType] , identifier[injector] operator[SEP] operator[SEP]
}
|
private int readAndWriteText(Writer w)
throws IOException, XMLStreamException
{
mTokenState = TOKEN_FULL_SINGLE; // we'll read it all
/* We should be able to mostly just use the input buffer at this
* point; exceptions being two-char linefeeds (when converting
* to single ones) and entities (which likewise can expand or
* shrink), both of which require flushing and/or single byte
* output.
*/
int start = mInputPtr;
int count = 0;
main_loop:
while (true) {
char c;
// Reached the end of buffer? Need to flush, then
if (mInputPtr >= mInputEnd) {
int len = mInputPtr - start;
if (len > 0) {
w.write(mInputBuffer, start, len);
count += len;
}
c = getNextChar(SUFFIX_IN_TEXT);
start = mInputPtr-1; // needs to be prior to char we got
} else {
c = mInputBuffer[mInputPtr++];
}
// Most common case is we don't have a special char, thus:
if (c < CHAR_FIRST_PURE_TEXT) {
if (c < CHAR_SPACE) {
if (c == '\n') {
markLF();
} else if (c == '\r') {
char d;
if (mInputPtr >= mInputEnd) {
/* If we can't peek easily, let's flush past stuff
* and load more... (have to flush, since new read
* will overwrite inbut buffers)
*/
int len = mInputPtr - start;
if (len > 0) {
w.write(mInputBuffer, start, len);
count += len;
}
d = getNextChar(SUFFIX_IN_TEXT);
start = mInputPtr; // to mark 'no past content'
} else {
d = mInputBuffer[mInputPtr++];
}
if (d == '\n') {
if (mNormalizeLFs) {
/* Let's flush content prior to 2-char LF, and
* start the new segment on the second char...
* this way, no mods are needed for the buffer,
* AND it'll also work on split 2-char lf!
*/
int len = mInputPtr - 2 - start;
if (len > 0) {
w.write(mInputBuffer, start, len);
count += len;
}
start = mInputPtr-1; // so '\n' is the first char
} else {
; // otherwise it's good as is
}
} else { // not 2-char... need to replace?
--mInputPtr;
if (mNormalizeLFs) {
mInputBuffer[mInputPtr-1] = '\n';
}
}
markLF();
} else if (c != '\t') {
throwInvalidSpace(c);
}
} else if (c == '<') { // end is nigh!
break main_loop;
} else if (c == '&') {
/* Have to flush all stuff, since entities pretty much
* force it; input buffer won't be contiguous
*/
int len = mInputPtr - 1 - start; // -1 to remove ampersand
if (len > 0) {
w.write(mInputBuffer, start, len);
count += len;
}
int ch;
if (mCfgReplaceEntities) { // can we expand all entities?
if ((mInputEnd - mInputPtr) < 3
|| (ch = resolveSimpleEntity(true)) == 0) {
ch = fullyResolveEntity(true);
}
} else {
ch = resolveCharOnlyEntity(true);
if (ch == 0) { // some other entity...
/* can't expand, so, let's just bail out... but
* let's also ensure no text is added twice, as
* all prev text was just flushed, but resolve
* may have moved input buffer around.
*/
start = mInputPtr;
break main_loop;
}
}
if (ch != 0) {
if (ch <= 0xFFFF) {
c = (char) ch;
} else {
ch -= 0x10000;
w.write((char) ((ch >> 10) + 0xD800));
c = (char) ((ch & 0x3FF) + 0xDC00);
}
w.write(c);
++count;
}
start = mInputPtr;
} else if (c == '>') { // did we get ']]>'?
/* 21-Apr-2005, TSa: But we can NOT check the output buffer
* (see comments in readTextSecondary() for details)
*/
if (mInputPtr >= 2) { // can we do it here?
if (mInputBuffer[mInputPtr-2] == ']'
&& mInputBuffer[mInputPtr-1] == ']') {
// Anything to flush?
int len = mInputPtr - start;
if (len > 0) {
w.write(mInputBuffer, start, len);
}
throwParseError(ErrorConsts.ERR_BRACKET_IN_TEXT);
}
} else {
; // !!! TBI: how to check past boundary?
}
} else if (c == CHAR_NULL) {
throwNullChar();
}
}
} // while (true)
/* Need to push back '<' or '&', whichever caused us to
* get out...
*/
--mInputPtr;
// Anything left to flush?
int len = mInputPtr - start;
if (len > 0) {
w.write(mInputBuffer, start, len);
count += len;
}
return count;
} | class class_name[name] begin[{]
method[readAndWriteText, return_type[type[int]], modifier[private], parameter[w]] begin[{]
assign[member[.mTokenState], member[.TOKEN_FULL_SINGLE]]
local_variable[type[int], start]
local_variable[type[int], count]
while[literal[true]] begin[{]
local_variable[type[char], c]
if[binary_operation[member[.mInputPtr], >=, member[.mInputEnd]]] begin[{]
local_variable[type[int], len]
if[binary_operation[member[.len], >, literal[0]]] begin[{]
call[w.write, parameter[member[.mInputBuffer], member[.start], member[.len]]]
assign[member[.count], member[.len]]
else begin[{]
None
end[}]
assign[member[.c], call[.getNextChar, parameter[member[.SUFFIX_IN_TEXT]]]]
assign[member[.start], binary_operation[member[.mInputPtr], -, literal[1]]]
else begin[{]
assign[member[.c], member[.mInputBuffer]]
end[}]
if[binary_operation[member[.c], <, member[.CHAR_FIRST_PURE_TEXT]]] begin[{]
if[binary_operation[member[.c], <, member[.CHAR_SPACE]]] begin[{]
if[binary_operation[member[.c], ==, literal['\n']]] begin[{]
call[.markLF, parameter[]]
else begin[{]
if[binary_operation[member[.c], ==, literal['\r']]] begin[{]
local_variable[type[char], d]
if[binary_operation[member[.mInputPtr], >=, member[.mInputEnd]]] begin[{]
local_variable[type[int], len]
if[binary_operation[member[.len], >, literal[0]]] begin[{]
call[w.write, parameter[member[.mInputBuffer], member[.start], member[.len]]]
assign[member[.count], member[.len]]
else begin[{]
None
end[}]
assign[member[.d], call[.getNextChar, parameter[member[.SUFFIX_IN_TEXT]]]]
assign[member[.start], member[.mInputPtr]]
else begin[{]
assign[member[.d], member[.mInputBuffer]]
end[}]
if[binary_operation[member[.d], ==, literal['\n']]] begin[{]
if[member[.mNormalizeLFs]] begin[{]
local_variable[type[int], len]
if[binary_operation[member[.len], >, literal[0]]] begin[{]
call[w.write, parameter[member[.mInputBuffer], member[.start], member[.len]]]
assign[member[.count], member[.len]]
else begin[{]
None
end[}]
assign[member[.start], binary_operation[member[.mInputPtr], -, literal[1]]]
else begin[{]
Statement(label=None)
end[}]
else begin[{]
member[.mInputPtr]
if[member[.mNormalizeLFs]] begin[{]
assign[member[.mInputBuffer], literal['\n']]
else begin[{]
None
end[}]
end[}]
call[.markLF, parameter[]]
else begin[{]
if[binary_operation[member[.c], !=, literal['\t']]] begin[{]
call[.throwInvalidSpace, parameter[member[.c]]]
else begin[{]
None
end[}]
end[}]
end[}]
else begin[{]
if[binary_operation[member[.c], ==, literal['<']]] begin[{]
BreakStatement(goto=main_loop, label=None)
else begin[{]
if[binary_operation[member[.c], ==, literal['&']]] begin[{]
local_variable[type[int], len]
if[binary_operation[member[.len], >, literal[0]]] begin[{]
call[w.write, parameter[member[.mInputBuffer], member[.start], member[.len]]]
assign[member[.count], member[.len]]
else begin[{]
None
end[}]
local_variable[type[int], ch]
if[member[.mCfgReplaceEntities]] begin[{]
if[binary_operation[binary_operation[binary_operation[member[.mInputEnd], -, member[.mInputPtr]], <, literal[3]], ||, binary_operation[assign[member[.ch], call[.resolveSimpleEntity, parameter[literal[true]]]], ==, literal[0]]]] begin[{]
assign[member[.ch], call[.fullyResolveEntity, parameter[literal[true]]]]
else begin[{]
None
end[}]
else begin[{]
assign[member[.ch], call[.resolveCharOnlyEntity, parameter[literal[true]]]]
if[binary_operation[member[.ch], ==, literal[0]]] begin[{]
assign[member[.start], member[.mInputPtr]]
BreakStatement(goto=main_loop, label=None)
else begin[{]
None
end[}]
end[}]
if[binary_operation[member[.ch], !=, literal[0]]] begin[{]
if[binary_operation[member[.ch], <=, literal[0xFFFF]]] begin[{]
assign[member[.c], Cast(expression=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))]
else begin[{]
assign[member[.ch], literal[0x10000]]
call[w.write, parameter[Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xD800), operator=+), type=BasicType(dimensions=[], name=char))]]
assign[member[.c], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x3FF), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xDC00), operator=+), type=BasicType(dimensions=[], name=char))]
end[}]
call[w.write, parameter[member[.c]]]
member[.count]
else begin[{]
None
end[}]
assign[member[.start], member[.mInputPtr]]
else begin[{]
if[binary_operation[member[.c], ==, literal['>']]] begin[{]
if[binary_operation[member[.mInputPtr], >=, literal[2]]] begin[{]
if[binary_operation[binary_operation[member[.mInputBuffer], ==, literal[']']], &&, binary_operation[member[.mInputBuffer], ==, literal[']']]]] begin[{]
local_variable[type[int], len]
if[binary_operation[member[.len], >, literal[0]]] begin[{]
call[w.write, parameter[member[.mInputBuffer], member[.start], member[.len]]]
else begin[{]
None
end[}]
call[.throwParseError, parameter[member[ErrorConsts.ERR_BRACKET_IN_TEXT]]]
else begin[{]
None
end[}]
else begin[{]
Statement(label=None)
end[}]
else begin[{]
if[binary_operation[member[.c], ==, member[.CHAR_NULL]]] begin[{]
call[.throwNullChar, parameter[]]
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
end[}]
else begin[{]
None
end[}]
end[}]
member[.mInputPtr]
local_variable[type[int], len]
if[binary_operation[member[.len], >, literal[0]]] begin[{]
call[w.write, parameter[member[.mInputBuffer], member[.start], member[.len]]]
assign[member[.count], member[.len]]
else begin[{]
None
end[}]
return[member[.count]]
end[}]
END[}] | Keyword[private] Keyword[int] identifier[readAndWriteText] operator[SEP] identifier[Writer] identifier[w] operator[SEP] Keyword[throws] identifier[IOException] , identifier[XMLStreamException] {
identifier[mTokenState] operator[=] identifier[TOKEN_FULL_SINGLE] operator[SEP] Keyword[int] identifier[start] operator[=] identifier[mInputPtr] operator[SEP] Keyword[int] identifier[count] operator[=] Other[0] operator[SEP] identifier[main_loop] operator[:] Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
Keyword[char] identifier[c] operator[SEP] Keyword[if] operator[SEP] identifier[mInputPtr] operator[>=] identifier[mInputEnd] operator[SEP] {
Keyword[int] identifier[len] operator[=] identifier[mInputPtr] operator[-] identifier[start] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[>] Other[0] operator[SEP] {
identifier[w] operator[SEP] identifier[write] operator[SEP] identifier[mInputBuffer] , identifier[start] , identifier[len] operator[SEP] operator[SEP] identifier[count] operator[+=] identifier[len] operator[SEP]
}
identifier[c] operator[=] identifier[getNextChar] operator[SEP] identifier[SUFFIX_IN_TEXT] operator[SEP] operator[SEP] identifier[start] operator[=] identifier[mInputPtr] operator[-] Other[1] operator[SEP]
}
Keyword[else] {
identifier[c] operator[=] identifier[mInputBuffer] operator[SEP] identifier[mInputPtr] operator[++] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[c] operator[<] identifier[CHAR_FIRST_PURE_TEXT] operator[SEP] {
Keyword[if] operator[SEP] identifier[c] operator[<] identifier[CHAR_SPACE] operator[SEP] {
Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
identifier[markLF] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
Keyword[char] identifier[d] operator[SEP] Keyword[if] operator[SEP] identifier[mInputPtr] operator[>=] identifier[mInputEnd] operator[SEP] {
Keyword[int] identifier[len] operator[=] identifier[mInputPtr] operator[-] identifier[start] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[>] Other[0] operator[SEP] {
identifier[w] operator[SEP] identifier[write] operator[SEP] identifier[mInputBuffer] , identifier[start] , identifier[len] operator[SEP] operator[SEP] identifier[count] operator[+=] identifier[len] operator[SEP]
}
identifier[d] operator[=] identifier[getNextChar] operator[SEP] identifier[SUFFIX_IN_TEXT] operator[SEP] operator[SEP] identifier[start] operator[=] identifier[mInputPtr] operator[SEP]
}
Keyword[else] {
identifier[d] operator[=] identifier[mInputBuffer] operator[SEP] identifier[mInputPtr] operator[++] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[d] operator[==] literal[String] operator[SEP] {
Keyword[if] operator[SEP] identifier[mNormalizeLFs] operator[SEP] {
Keyword[int] identifier[len] operator[=] identifier[mInputPtr] operator[-] Other[2] operator[-] identifier[start] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[>] Other[0] operator[SEP] {
identifier[w] operator[SEP] identifier[write] operator[SEP] identifier[mInputBuffer] , identifier[start] , identifier[len] operator[SEP] operator[SEP] identifier[count] operator[+=] identifier[len] operator[SEP]
}
identifier[start] operator[=] identifier[mInputPtr] operator[-] Other[1] operator[SEP]
}
Keyword[else] {
operator[SEP]
}
}
Keyword[else] {
operator[--] identifier[mInputPtr] operator[SEP] Keyword[if] operator[SEP] identifier[mNormalizeLFs] operator[SEP] {
identifier[mInputBuffer] operator[SEP] identifier[mInputPtr] operator[-] Other[1] operator[SEP] operator[=] literal[String] operator[SEP]
}
}
identifier[markLF] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[!=] literal[String] operator[SEP] {
identifier[throwInvalidSpace] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
Keyword[break] identifier[main_loop] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
Keyword[int] identifier[len] operator[=] identifier[mInputPtr] operator[-] Other[1] operator[-] identifier[start] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[>] Other[0] operator[SEP] {
identifier[w] operator[SEP] identifier[write] operator[SEP] identifier[mInputBuffer] , identifier[start] , identifier[len] operator[SEP] operator[SEP] identifier[count] operator[+=] identifier[len] operator[SEP]
}
Keyword[int] identifier[ch] operator[SEP] Keyword[if] operator[SEP] identifier[mCfgReplaceEntities] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[mInputEnd] operator[-] identifier[mInputPtr] operator[SEP] operator[<] Other[3] operator[||] operator[SEP] identifier[ch] operator[=] identifier[resolveSimpleEntity] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[ch] operator[=] identifier[fullyResolveEntity] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[ch] operator[=] identifier[resolveCharOnlyEntity] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[==] Other[0] operator[SEP] {
identifier[start] operator[=] identifier[mInputPtr] operator[SEP] Keyword[break] identifier[main_loop] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[ch] operator[!=] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[ch] operator[<=] literal[Integer] operator[SEP] {
identifier[c] operator[=] operator[SEP] Keyword[char] operator[SEP] identifier[ch] operator[SEP]
}
Keyword[else] {
identifier[ch] operator[-=] literal[Integer] operator[SEP] identifier[w] operator[SEP] identifier[write] operator[SEP] operator[SEP] Keyword[char] operator[SEP] operator[SEP] operator[SEP] identifier[ch] operator[>] operator[>] Other[10] operator[SEP] operator[+] literal[Integer] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] operator[SEP] identifier[ch] operator[&] literal[Integer] operator[SEP] operator[+] literal[Integer] operator[SEP] operator[SEP]
}
identifier[w] operator[SEP] identifier[write] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[++] identifier[count] operator[SEP]
}
identifier[start] operator[=] identifier[mInputPtr] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
Keyword[if] operator[SEP] identifier[mInputPtr] operator[>=] Other[2] operator[SEP] {
Keyword[if] operator[SEP] identifier[mInputBuffer] operator[SEP] identifier[mInputPtr] operator[-] Other[2] operator[SEP] operator[==] literal[String] operator[&&] identifier[mInputBuffer] operator[SEP] identifier[mInputPtr] operator[-] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] {
Keyword[int] identifier[len] operator[=] identifier[mInputPtr] operator[-] identifier[start] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[>] Other[0] operator[SEP] {
identifier[w] operator[SEP] identifier[write] operator[SEP] identifier[mInputBuffer] , identifier[start] , identifier[len] operator[SEP] operator[SEP]
}
identifier[throwParseError] operator[SEP] identifier[ErrorConsts] operator[SEP] identifier[ERR_BRACKET_IN_TEXT] operator[SEP] operator[SEP]
}
}
Keyword[else] {
operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] identifier[CHAR_NULL] operator[SEP] {
identifier[throwNullChar] operator[SEP] operator[SEP] operator[SEP]
}
}
} operator[--] identifier[mInputPtr] operator[SEP] Keyword[int] identifier[len] operator[=] identifier[mInputPtr] operator[-] identifier[start] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[>] Other[0] operator[SEP] {
identifier[w] operator[SEP] identifier[write] operator[SEP] identifier[mInputBuffer] , identifier[start] , identifier[len] operator[SEP] operator[SEP] identifier[count] operator[+=] identifier[len] operator[SEP]
}
Keyword[return] identifier[count] operator[SEP]
}
|
public void attachWriter(final HttpSession newWriter) {
// The attachWriter processing must be done in this WsebSession's IO thread so we can do
// getProcessor().flush(). We may need to do "thread hopping" for this since attachWriter gets called by
// WsebDownstreamHandler.reconnectSession during sessionOpened on the downstream, which may be running
// in another I/O thread.
if (Thread.currentThread() == getIoThread()) {
attachWriter0(newWriter);
}
else {
final Thread ioThread = getIoThread();
final Executor ioExecutor = getIoExecutor();
newWriter.setIoAlignment(NO_THREAD, NO_EXECUTOR);
ioExecutor.execute(new Runnable() {
@Override
public void run() {
newWriter.setIoAlignment(ioThread, ioExecutor);
attachWriter0(newWriter);
}
});
}
} | class class_name[name] begin[{]
method[attachWriter, return_type[void], modifier[public], parameter[newWriter]] begin[{]
if[binary_operation[call[Thread.currentThread, parameter[]], ==, call[.getIoThread, parameter[]]]] begin[{]
call[.attachWriter0, parameter[member[.newWriter]]]
else begin[{]
local_variable[type[Thread], ioThread]
local_variable[type[Executor], ioExecutor]
call[newWriter.setIoAlignment, parameter[member[.NO_THREAD], member[.NO_EXECUTOR]]]
call[ioExecutor.execute, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ioThread, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ioExecutor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setIoAlignment, postfix_operators=[], prefix_operators=[], qualifier=newWriter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=newWriter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=attachWriter0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[attachWriter] operator[SEP] Keyword[final] identifier[HttpSession] identifier[newWriter] operator[SEP] {
Keyword[if] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[==] identifier[getIoThread] operator[SEP] operator[SEP] operator[SEP] {
identifier[attachWriter0] operator[SEP] identifier[newWriter] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[final] identifier[Thread] identifier[ioThread] operator[=] identifier[getIoThread] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Executor] identifier[ioExecutor] operator[=] identifier[getIoExecutor] operator[SEP] operator[SEP] operator[SEP] identifier[newWriter] operator[SEP] identifier[setIoAlignment] operator[SEP] identifier[NO_THREAD] , identifier[NO_EXECUTOR] operator[SEP] operator[SEP] identifier[ioExecutor] operator[SEP] identifier[execute] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[newWriter] operator[SEP] identifier[setIoAlignment] operator[SEP] identifier[ioThread] , identifier[ioExecutor] operator[SEP] operator[SEP] identifier[attachWriter0] operator[SEP] identifier[newWriter] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
}
|
protected NewRenderBuilder render(String template, Map<String, Object> values) {
view(values);
return internalRender(template);
} | class class_name[name] begin[{]
method[render, return_type[type[NewRenderBuilder]], modifier[protected], parameter[template, values]] begin[{]
call[.view, parameter[member[.values]]]
return[call[.internalRender, parameter[member[.template]]]]
end[}]
END[}] | Keyword[protected] identifier[NewRenderBuilder] identifier[render] operator[SEP] identifier[String] identifier[template] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[values] operator[SEP] {
identifier[view] operator[SEP] identifier[values] operator[SEP] operator[SEP] Keyword[return] identifier[internalRender] operator[SEP] identifier[template] operator[SEP] operator[SEP]
}
|
public void serverShutDown() throws ResourceException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(this, tc, "serverShutDown");
}
connectionPoolShutDown = true;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(this, tc, "Shutting down pool manager connections in free pool ");
Tr.debug(this, tc, this.toString());
}
// Remove parked connection if it exists
if ((gConfigProps.isSmartHandleSupport() == false)) {
freePool[0].removeParkedConnection();
}
// Reset fatalErrorNotificationTime and remove all free connections
for (int j = 0; j < gConfigProps.getMaxFreePoolHashSize(); ++j) {
synchronized (freePool[j].freeConnectionLockObject) {
/*
* If a connection gets away, by setting fatalErrorNotificationTime will
* guaranty when the connection is returned to the free pool, it will be
*/
freePool[j].incrementFatalErrorValue(j);
/*
* Destroy as many connections as we can in the free pool
*/
if (freePool[j].mcWrapperList.size() > 0) {
try { // added a try\catch block
freePool[j].cleanupAndDestroyAllFreeConnections();
} catch (Exception ex) {
if (tc.isDebugEnabled())
Tr.debug(this, tc, "Exception during destroy of freepool connection: ", new Object[] { freePool[j], ex });
}
}
} // end free lock
} //end for j
/*
* we can not process inuse connection by default during server shutdown. This
* was a change in behavior from 6.0.2 and earlier. By trying to destroy
* connection that could be
* used by an application on a different thread, we can encounter unnecessary
* delays or exceptions that will create pmrs.
*
* If this code is needed by some customers, they will be able to enable destroying inuse
* connection by using a system value enableInuseConnectionDestroy = true. This is not
* recommenced, since this should not be needed. All applications and services should be
* stopped before we get this code. If a connection is still inuse by the time we
* enter this server shutdown code, its very likely the connection is in error and will
* need to manually be recovered or the service was not stopped first. It should always be
* understood that manual recovery of XA resource may be needed if connection failure
* occurs or a process is stopped unexpectedly
*
* This may not make sence, but please do not add any inuse connection code unless it can be
* enabled. In future release, we may what to add this system value to a gui connection pool
* property. This is the way we should have added this. :-)
*
* One other note, if a connection starts to move from the freepool to the inuse pool while
* we are destroying managed connections, some interesting things may occur. :-) :-). It is
* like we are going to cause the problem fixed.
*/
if (enableInuseConnectionDestroy) {
/*
* Adding the allow connection request = false in an attempt to stop new connection
* requests from occurring. The error will be misleading, but we will have the
* stack of the application or service attempting to use a new connections during
* server shutdown. It should be ok to reuse this var since this should not happen
* very much.
*/
allowConnectionRequests = false;
// Managed connections currently in use should be destroyed in order to give the
// resource adapter a chance to end the transaction branch. Check for in-use connections
// in both the sharable and unsharable pools.
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, "Destroying sharable, in-use connections");
for (int i = 0; i < maxSharedBuckets; ++i) {
synchronized (sharedPool[i].sharedLockObject) {
if (sharedPool[i].getMCWrapperListSize() > 0) {
MCWrapper[] mcw = sharedPool[i].getMCWrapperList();
for (int j = 0; j < sharedPool[i].getMCWrapperListSize(); ++j) {
try {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(this, tc, "Destroying inuse managed connection " + mcw[j]);
}
ManagedConnection mc = mcw[j].getManagedConnectionWithoutStateCheck();
if (mc != null)
mc.destroy();
} catch (ResourceException resX) {
// No FFDC needed; we expect some resource adapters will throw errors here.
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, "error during destroy of sharable, in-use connection: ", new Object[] { mcw[j], resX });
}
} // end loop through the list of connections in the bucket
}
} // end synchronize on shared pool bucket
} // end loop through shared pool buckets
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, "Destroying unsharable, in-use connections");
MCWrapper[] mcw = getUnSharedPoolConnections();
for (int j = 0; j < mcw.length; ++j) {
try {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(this, tc, "Destroying inuse managed connection " + mcw[j]);
}
ManagedConnection mc = mcw[j].getManagedConnectionWithoutStateCheck();
if (mc != null)
mc.destroy();
} catch (ResourceException resX) {
// No FFDC needed; we expect some resource adapters will throw errors here.
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, "error during destroy of unsharable in-use connection: ", new Object[] { mcw[j], resX });
}
} // end loop through unsharable, in-use connections
}
// Ensure that the reap thread has terminated for this pool manager
// If we don't force closure here, dynamic config changes may cause
// duplicate reaper threads for the same resource
synchronized (amLockObject) {
if (am != null && !am.isDone()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, "Alarm for pool manager has not completed yet. Cancelling now.");
am.cancel(false);
if (am.isDone())
alarmThreadCounter.decrementAndGet();
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(this, tc, "serverShutDown");
}
} | class class_name[name] begin[{]
method[serverShutDown, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[Tr.entry, parameter[THIS[], member[.tc], literal["serverShutDown"]]]
else begin[{]
None
end[}]
assign[member[.connectionPoolShutDown], literal[true]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[THIS[], member[.tc], literal["Shutting down pool manager connections in free pool "]]]
call[Tr.debug, parameter[THIS[], member[.tc], THIS[call[None.toString, parameter[]]]]]
else begin[{]
None
end[}]
if[binary_operation[call[gConfigProps.isSmartHandleSupport, parameter[]], ==, literal[false]]] begin[{]
member[.freePool]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[SynchronizedStatement(block=[StatementExpression(expression=MemberReference(member=freePool, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=incrementFatalErrorValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=freePool, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=mcWrapperList, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MemberReference(member=freePool, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=cleanupAndDestroyAllFreeConnections, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), 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="Exception during destroy of freepool connection: "), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=freePool, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None)]))], label=None, lock=MemberReference(member=freePool, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=freeConnectionLockObject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getMaxFreePoolHashSize, postfix_operators=[], prefix_operators=[], qualifier=gConfigProps, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
if[member[.enableInuseConnectionDestroy]] begin[{]
assign[member[.allowConnectionRequests], literal[false]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[THIS[], member[.tc], literal["Destroying sharable, in-use connections"]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[SynchronizedStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sharedPool, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getMCWrapperListSize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=sharedPool, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getMCWrapperList, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=mcw)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=MCWrapper, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destroying inuse managed connection "), operandr=MemberReference(member=mcw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=mcw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getManagedConnectionWithoutStateCheck, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=mc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ManagedConnection, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=mc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=destroy, postfix_operators=[], prefix_operators=[], qualifier=mc, selectors=[], type_arguments=None), label=None))], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[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="error during destroy of sharable, in-use connection: "), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=mcw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=resX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=resX, types=['ResourceException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=sharedPool, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getMCWrapperListSize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)]))], label=None, lock=MemberReference(member=sharedPool, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=sharedLockObject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxSharedBuckets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[THIS[], member[.tc], literal["Destroying unsharable, in-use connections"]]]
else begin[{]
None
end[}]
local_variable[type[MCWrapper], mcw]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destroying inuse managed connection "), operandr=MemberReference(member=mcw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=mcw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getManagedConnectionWithoutStateCheck, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=mc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ManagedConnection, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=mc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=destroy, postfix_operators=[], prefix_operators=[], qualifier=mc, selectors=[], type_arguments=None), label=None))], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[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="error during destroy of unsharable in-use connection: "), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=mcw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=resX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=resX, types=['ResourceException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=mcw, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
else begin[{]
None
end[}]
SYNCHRONIZED[member[.amLockObject]] BEGIN[{]
if[binary_operation[binary_operation[member[.am], !=, literal[null]], &&, call[am.isDone, parameter[]]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[THIS[], member[.tc], literal["Alarm for pool manager has not completed yet. Cancelling now."]]]
else begin[{]
None
end[}]
call[am.cancel, parameter[literal[false]]]
if[call[am.isDone, parameter[]]] begin[{]
call[alarmThreadCounter.decrementAndGet, parameter[]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
END[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[Tr.exit, parameter[THIS[], member[.tc], literal["serverShutDown"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[serverShutDown] operator[SEP] operator[SEP] Keyword[throws] identifier[ResourceException] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
identifier[connectionPoolShutDown] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , Keyword[this] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[gConfigProps] operator[SEP] identifier[isSmartHandleSupport] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] operator[SEP] {
identifier[freePool] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[removeParkedConnection] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[gConfigProps] operator[SEP] identifier[getMaxFreePoolHashSize] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[j] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[freePool] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[freeConnectionLockObject] operator[SEP] {
identifier[freePool] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[incrementFatalErrorValue] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[freePool] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[mcWrapperList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[try] {
identifier[freePool] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[cleanupAndDestroyAllFreeConnections] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[freePool] operator[SEP] identifier[j] operator[SEP] , identifier[ex]
} operator[SEP] operator[SEP]
}
}
}
}
Keyword[if] operator[SEP] identifier[enableInuseConnectionDestroy] operator[SEP] {
identifier[allowConnectionRequests] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[maxSharedBuckets] operator[SEP] operator[++] identifier[i] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[sharedPool] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[sharedLockObject] operator[SEP] {
Keyword[if] operator[SEP] identifier[sharedPool] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getMCWrapperListSize] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[MCWrapper] operator[SEP] operator[SEP] identifier[mcw] operator[=] identifier[sharedPool] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getMCWrapperList] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[sharedPool] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getMCWrapperListSize] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[j] operator[SEP] {
Keyword[try] {
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] Keyword[this] , identifier[tc] , literal[String] operator[+] identifier[mcw] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP]
}
identifier[ManagedConnection] identifier[mc] operator[=] identifier[mcw] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[getManagedConnectionWithoutStateCheck] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mc] operator[!=] Other[null] operator[SEP] identifier[mc] operator[SEP] identifier[destroy] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ResourceException] identifier[resX] 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] Keyword[this] , identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[mcw] operator[SEP] identifier[j] operator[SEP] , identifier[resX]
} 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] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[MCWrapper] operator[SEP] operator[SEP] identifier[mcw] operator[=] identifier[getUnSharedPoolConnections] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[mcw] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[j] operator[SEP] {
Keyword[try] {
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] Keyword[this] , identifier[tc] , literal[String] operator[+] identifier[mcw] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP]
}
identifier[ManagedConnection] identifier[mc] operator[=] identifier[mcw] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[getManagedConnectionWithoutStateCheck] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mc] operator[!=] Other[null] operator[SEP] identifier[mc] operator[SEP] identifier[destroy] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ResourceException] identifier[resX] 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] Keyword[this] , identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[mcw] operator[SEP] identifier[j] operator[SEP] , identifier[resX]
} operator[SEP] operator[SEP]
}
}
}
Keyword[synchronized] operator[SEP] identifier[amLockObject] operator[SEP] {
Keyword[if] operator[SEP] identifier[am] operator[!=] Other[null] operator[&&] operator[!] identifier[am] operator[SEP] identifier[isDone] 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] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[am] operator[SEP] identifier[cancel] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[am] operator[SEP] identifier[isDone] operator[SEP] operator[SEP] operator[SEP] identifier[alarmThreadCounter] operator[SEP] identifier[decrementAndGet] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
}
|
void xLock(Object obj, long txNum) {
Object anchor = getAnchor(obj);
txWaitMap.put(txNum, anchor);
synchronized (anchor) {
Lockers lks = prepareLockers(obj);
if (hasXLock(lks, txNum))
return;
try {
long timestamp = System.currentTimeMillis();
while (!xLockable(lks, txNum) && !waitingTooLong(timestamp)) {
avoidDeadlock(lks, txNum, X_LOCK);
lks.requestSet.add(txNum);
anchor.wait(MAX_TIME);
lks.requestSet.remove(txNum);
}
if (!xLockable(lks, txNum))
throw new LockAbortException();
lks.xLocker = txNum;
getObjectSet(txNum).add(obj);
} catch (InterruptedException e) {
throw new LockAbortException();
}
}
txWaitMap.remove(txNum);
} | class class_name[name] begin[{]
method[xLock, return_type[void], modifier[default], parameter[obj, txNum]] begin[{]
local_variable[type[Object], anchor]
call[txWaitMap.put, parameter[member[.txNum], member[.anchor]]]
SYNCHRONIZED[member[.anchor]] BEGIN[{]
local_variable[type[Lockers], lks]
if[call[.hasXLock, parameter[member[.lks], member[.txNum]]]] begin[{]
return[None]
else begin[{]
None
end[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), name=timestamp)], modifiers=set(), type=BasicType(dimensions=[], name=long)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=lks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=txNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=X_LOCK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=avoidDeadlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=txNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=lks.requestSet, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MAX_TIME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wait, postfix_operators=[], prefix_operators=[], qualifier=anchor, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=txNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=lks.requestSet, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=lks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=txNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=xLockable, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=timestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=waitingTooLong, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), operator=&&), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=lks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=txNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=xLockable, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), 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=LockAbortException, sub_type=None)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=xLocker, postfix_operators=[], prefix_operators=[], qualifier=lks, selectors=[]), type==, value=MemberReference(member=txNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=txNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getObjectSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LockAbortException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None)
END[}]
call[txWaitMap.remove, parameter[member[.txNum]]]
end[}]
END[}] | Keyword[void] identifier[xLock] operator[SEP] identifier[Object] identifier[obj] , Keyword[long] identifier[txNum] operator[SEP] {
identifier[Object] identifier[anchor] operator[=] identifier[getAnchor] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[txWaitMap] operator[SEP] identifier[put] operator[SEP] identifier[txNum] , identifier[anchor] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[anchor] operator[SEP] {
identifier[Lockers] identifier[lks] operator[=] identifier[prepareLockers] operator[SEP] identifier[obj] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasXLock] operator[SEP] identifier[lks] , identifier[txNum] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[try] {
Keyword[long] identifier[timestamp] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[xLockable] operator[SEP] identifier[lks] , identifier[txNum] operator[SEP] operator[&&] operator[!] identifier[waitingTooLong] operator[SEP] identifier[timestamp] operator[SEP] operator[SEP] {
identifier[avoidDeadlock] operator[SEP] identifier[lks] , identifier[txNum] , identifier[X_LOCK] operator[SEP] operator[SEP] identifier[lks] operator[SEP] identifier[requestSet] operator[SEP] identifier[add] operator[SEP] identifier[txNum] operator[SEP] operator[SEP] identifier[anchor] operator[SEP] identifier[wait] operator[SEP] identifier[MAX_TIME] operator[SEP] operator[SEP] identifier[lks] operator[SEP] identifier[requestSet] operator[SEP] identifier[remove] operator[SEP] identifier[txNum] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[xLockable] operator[SEP] identifier[lks] , identifier[txNum] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[LockAbortException] operator[SEP] operator[SEP] operator[SEP] identifier[lks] operator[SEP] identifier[xLocker] operator[=] identifier[txNum] operator[SEP] identifier[getObjectSet] operator[SEP] identifier[txNum] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[obj] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[LockAbortException] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[txWaitMap] operator[SEP] identifier[remove] operator[SEP] identifier[txNum] operator[SEP] operator[SEP]
}
|
public static Method getMostSpecificMethod(Method method, Class<?> targetClass) {
if (method != null && isOverridable(method, targetClass) && targetClass != null
&& targetClass != method.getDeclaringClass()) {
try {
try {
return targetClass.getMethod(method.getName(), method.getParameterTypes());
} catch (NoSuchMethodException ex) {
return method;
}
} catch (SecurityException ex) {
}
}
return method;
} | class class_name[name] begin[{]
method[getMostSpecificMethod, return_type[type[Method]], modifier[public static], parameter[method, targetClass]] begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.method], !=, literal[null]], &&, call[.isOverridable, parameter[member[.method], member[.targetClass]]]], &&, binary_operation[member[.targetClass], !=, literal[null]]], &&, binary_operation[member[.targetClass], !=, call[method.getDeclaringClass, parameter[]]]]] begin[{]
TryStatement(block=[TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None)], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=targetClass, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NoSuchMethodException']))], finally_block=None, label=None, resources=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SecurityException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[member[.method]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Method] identifier[getMostSpecificMethod] operator[SEP] identifier[Method] identifier[method] , identifier[Class] operator[<] operator[?] operator[>] identifier[targetClass] operator[SEP] {
Keyword[if] operator[SEP] identifier[method] operator[!=] Other[null] operator[&&] identifier[isOverridable] operator[SEP] identifier[method] , identifier[targetClass] operator[SEP] operator[&&] identifier[targetClass] operator[!=] Other[null] operator[&&] identifier[targetClass] operator[!=] identifier[method] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[try] {
Keyword[return] identifier[targetClass] operator[SEP] identifier[getMethod] operator[SEP] identifier[method] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[method] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[ex] operator[SEP] {
Keyword[return] identifier[method] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[SecurityException] identifier[ex] operator[SEP] {
}
}
Keyword[return] identifier[method] operator[SEP]
}
|
public RoleInner beginCreateOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role) {
return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, role).toBlocking().single().body();
} | class class_name[name] begin[{]
method[beginCreateOrUpdate, return_type[type[RoleInner]], modifier[public], parameter[deviceName, name, resourceGroupName, role]] begin[{]
return[call[.beginCreateOrUpdateWithServiceResponseAsync, parameter[member[.deviceName], member[.name], member[.resourceGroupName], member[.role]]]]
end[}]
END[}] | Keyword[public] identifier[RoleInner] identifier[beginCreateOrUpdate] operator[SEP] identifier[String] identifier[deviceName] , identifier[String] identifier[name] , identifier[String] identifier[resourceGroupName] , identifier[RoleInner] identifier[role] operator[SEP] {
Keyword[return] identifier[beginCreateOrUpdateWithServiceResponseAsync] operator[SEP] identifier[deviceName] , identifier[name] , identifier[resourceGroupName] , identifier[role] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
|
@XmlElementDecl(namespace = "http://schema.intuit.com/finance/v3", name = "VendorType", substitutionHeadNamespace = "http://schema.intuit.com/finance/v3", substitutionHeadName = "IntuitObject")
public JAXBElement<VendorType> createVendorType(VendorType value) {
return new JAXBElement<VendorType>(_VendorType_QNAME, VendorType.class, null, value);
} | class class_name[name] begin[{]
method[createVendorType, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=_VendorType_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VendorType, 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=VendorType, 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] , identifier[substitutionHeadNamespace] operator[=] literal[String] , identifier[substitutionHeadName] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[VendorType] operator[>] identifier[createVendorType] operator[SEP] identifier[VendorType] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[VendorType] operator[>] operator[SEP] identifier[_VendorType_QNAME] , identifier[VendorType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP]
}
|
@Override
public ResetCacheParameterGroupResult resetCacheParameterGroup(ResetCacheParameterGroupRequest request) {
request = beforeClientExecution(request);
return executeResetCacheParameterGroup(request);
} | class class_name[name] begin[{]
method[resetCacheParameterGroup, return_type[type[ResetCacheParameterGroupResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeResetCacheParameterGroup, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ResetCacheParameterGroupResult] identifier[resetCacheParameterGroup] operator[SEP] identifier[ResetCacheParameterGroupRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeResetCacheParameterGroup] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
private static ZoneId ofWithPrefix(String zoneId, int prefixLength, boolean checkAvailable) {
String prefix = zoneId.substring(0, prefixLength);
if (zoneId.length() == prefixLength) {
return ofOffset(prefix, ZoneOffset.UTC);
}
if (zoneId.charAt(prefixLength) != '+' && zoneId.charAt(prefixLength) != '-') {
return ZoneRegion.ofId(zoneId, checkAvailable); // drop through to ZoneRulesProvider
}
try {
ZoneOffset offset = ZoneOffset.of(zoneId.substring(prefixLength));
if (offset == ZoneOffset.UTC) {
return ofOffset(prefix, offset);
}
return ofOffset(prefix, offset);
} catch (DateTimeException ex) {
throw new DateTimeException("Invalid ID for offset-based ZoneId: " + zoneId, ex);
}
} | class class_name[name] begin[{]
method[ofWithPrefix, return_type[type[ZoneId]], modifier[private static], parameter[zoneId, prefixLength, checkAvailable]] begin[{]
local_variable[type[String], prefix]
if[binary_operation[call[zoneId.length, parameter[]], ==, member[.prefixLength]]] begin[{]
return[call[.ofOffset, parameter[member[.prefix], member[ZoneOffset.UTC]]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[zoneId.charAt, parameter[member[.prefixLength]]], !=, literal['+']], &&, binary_operation[call[zoneId.charAt, parameter[member[.prefixLength]]], !=, literal['-']]]] begin[{]
return[call[ZoneRegion.ofId, parameter[member[.zoneId], member[.checkAvailable]]]]
else begin[{]
None
end[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=prefixLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=zoneId, selectors=[], type_arguments=None)], member=of, postfix_operators=[], prefix_operators=[], qualifier=ZoneOffset, selectors=[], type_arguments=None), name=offset)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ZoneOffset, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=UTC, postfix_operators=[], prefix_operators=[], qualifier=ZoneOffset, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ofOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ofOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid ID for offset-based ZoneId: "), operandr=MemberReference(member=zoneId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateTimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['DateTimeException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[static] identifier[ZoneId] identifier[ofWithPrefix] operator[SEP] identifier[String] identifier[zoneId] , Keyword[int] identifier[prefixLength] , Keyword[boolean] identifier[checkAvailable] operator[SEP] {
identifier[String] identifier[prefix] operator[=] identifier[zoneId] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[prefixLength] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[zoneId] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] identifier[prefixLength] operator[SEP] {
Keyword[return] identifier[ofOffset] operator[SEP] identifier[prefix] , identifier[ZoneOffset] operator[SEP] identifier[UTC] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[zoneId] operator[SEP] identifier[charAt] operator[SEP] identifier[prefixLength] operator[SEP] operator[!=] literal[String] operator[&&] identifier[zoneId] operator[SEP] identifier[charAt] operator[SEP] identifier[prefixLength] operator[SEP] operator[!=] literal[String] operator[SEP] {
Keyword[return] identifier[ZoneRegion] operator[SEP] identifier[ofId] operator[SEP] identifier[zoneId] , identifier[checkAvailable] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[ZoneOffset] identifier[offset] operator[=] identifier[ZoneOffset] operator[SEP] identifier[of] operator[SEP] identifier[zoneId] operator[SEP] identifier[substring] operator[SEP] identifier[prefixLength] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[offset] operator[==] identifier[ZoneOffset] operator[SEP] identifier[UTC] operator[SEP] {
Keyword[return] identifier[ofOffset] operator[SEP] identifier[prefix] , identifier[offset] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ofOffset] operator[SEP] identifier[prefix] , identifier[offset] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[DateTimeException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DateTimeException] operator[SEP] literal[String] operator[+] identifier[zoneId] , identifier[ex] operator[SEP] operator[SEP]
}
}
|
@Override
public RejectTransitGatewayVpcAttachmentResult rejectTransitGatewayVpcAttachment(RejectTransitGatewayVpcAttachmentRequest request) {
request = beforeClientExecution(request);
return executeRejectTransitGatewayVpcAttachment(request);
} | class class_name[name] begin[{]
method[rejectTransitGatewayVpcAttachment, return_type[type[RejectTransitGatewayVpcAttachmentResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeRejectTransitGatewayVpcAttachment, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[RejectTransitGatewayVpcAttachmentResult] identifier[rejectTransitGatewayVpcAttachment] operator[SEP] identifier[RejectTransitGatewayVpcAttachmentRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeRejectTransitGatewayVpcAttachment] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
static boolean isNameChar(final int codePoint) {
return
isNameStartChar(codePoint) ||
(codePoint == '-') ||
(codePoint == '.') ||
(codePoint >= '0' && codePoint <= '9') ||
(codePoint == 0xB7) ||
(codePoint >= 0x0300 && codePoint <= 0x036F) ||
(codePoint >= 0x203F && codePoint <= 0x2040);
} | class class_name[name] begin[{]
method[isNameChar, return_type[type[boolean]], modifier[static], parameter[codePoint]] begin[{]
return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[call[.isNameStartChar, parameter[member[.codePoint]]], ||, binary_operation[member[.codePoint], ==, literal['-']]], ||, binary_operation[member[.codePoint], ==, literal['.']]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal['0']], &&, binary_operation[member[.codePoint], <=, literal['9']]]], ||, binary_operation[member[.codePoint], ==, literal[0xB7]]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal[0x0300]], &&, binary_operation[member[.codePoint], <=, literal[0x036F]]]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal[0x203F]], &&, binary_operation[member[.codePoint], <=, literal[0x2040]]]]]
end[}]
END[}] | Keyword[static] Keyword[boolean] identifier[isNameChar] operator[SEP] Keyword[final] Keyword[int] identifier[codePoint] operator[SEP] {
Keyword[return] identifier[isNameStartChar] operator[SEP] identifier[codePoint] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[String] operator[&&] identifier[codePoint] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[==] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[SEP]
}
|
public boolean addAll(Collection collection) {
for (Iterator iterator = collection.iterator(); iterator.hasNext(); ) {
this.add(iterator.next());
}
return true;
} | class class_name[name] begin[{]
method[addAll, return_type[type[boolean]], modifier[public], parameter[collection]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None)], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=collection, selectors=[], type_arguments=None), name=iterator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[addAll] operator[SEP] identifier[Collection] identifier[collection] operator[SEP] {
Keyword[for] operator[SEP] identifier[Iterator] identifier[iterator] operator[=] identifier[collection] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[add] operator[SEP] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public <T extends ICalProperty> List<T> removeProperties(Class<T> clazz) {
List<ICalProperty> removed = properties.removeAll(clazz);
return castList(removed, clazz);
} | class class_name[name] begin[{]
method[removeProperties, return_type[type[List]], modifier[public], parameter[clazz]] begin[{]
local_variable[type[List], removed]
return[call[.castList, parameter[member[.removed], member[.clazz]]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[ICalProperty] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[removeProperties] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[SEP] {
identifier[List] operator[<] identifier[ICalProperty] operator[>] identifier[removed] operator[=] identifier[properties] operator[SEP] identifier[removeAll] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] Keyword[return] identifier[castList] operator[SEP] identifier[removed] , identifier[clazz] operator[SEP] operator[SEP]
}
|
public void dispose(){
classAnalysisMap.clear();
classAnalysisEngineMap.clear();
analysisLocals.clear();
databaseFactoryMap.clear();
databaseMap.clear();
methodAnalysisEngineMap.clear();
} | class class_name[name] begin[{]
method[dispose, return_type[void], modifier[public], parameter[]] begin[{]
call[classAnalysisMap.clear, parameter[]]
call[classAnalysisEngineMap.clear, parameter[]]
call[analysisLocals.clear, parameter[]]
call[databaseFactoryMap.clear, parameter[]]
call[databaseMap.clear, parameter[]]
call[methodAnalysisEngineMap.clear, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[dispose] operator[SEP] operator[SEP] {
identifier[classAnalysisMap] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[classAnalysisEngineMap] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[analysisLocals] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[databaseFactoryMap] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[databaseMap] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[methodAnalysisEngineMap] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP]
}
|
public static dnssrvrec get(nitro_service service, dnssrvrec obj) throws Exception{
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(obj));
dnssrvrec response = (dnssrvrec) obj.get_resource(service,option);
return response;
} | class class_name[name] begin[{]
method[get, return_type[type[dnssrvrec]], modifier[public static], parameter[service, obj]] begin[{]
local_variable[type[options], option]
call[option.set_args, parameter[call[nitro_util.object_to_string_withoutquotes, parameter[member[.obj]]]]]
local_variable[type[dnssrvrec], response]
return[member[.response]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[dnssrvrec] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[dnssrvrec] identifier[obj] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[options] identifier[option] operator[=] Keyword[new] identifier[options] operator[SEP] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[set_args] operator[SEP] identifier[nitro_util] operator[SEP] identifier[object_to_string_withoutquotes] operator[SEP] identifier[obj] operator[SEP] operator[SEP] operator[SEP] identifier[dnssrvrec] identifier[response] operator[=] operator[SEP] identifier[dnssrvrec] operator[SEP] identifier[obj] operator[SEP] identifier[get_resource] operator[SEP] identifier[service] , identifier[option] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP]
}
|
public static final ConfigurationsCatalog newInstance() {
ConfigurationsCatalog ret = new ConfigurationsCatalog();
for (ConfigurationsProvider provider : ServiceLoader.load(ConfigurationsProvider.class)) {
provider.setCreatedWithSPI();
ret.addFactory(provider);
}
Iterator<UserConfigurationsProvider> iter = ServiceLoader.load(UserConfigurationsProvider.class).iterator();
if (iter.hasNext()) {
UserConfigurationsProvider provider = iter.next();
provider.setCreatedWithSPI();
ret.setUserConfigurations(provider);
}
return ret;
} | class class_name[name] begin[{]
method[newInstance, return_type[type[ConfigurationsCatalog]], modifier[final public static], parameter[]] begin[{]
local_variable[type[ConfigurationsCatalog], ret]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=setCreatedWithSPI, postfix_operators=[], prefix_operators=[], qualifier=provider, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=provider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addFactory, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigurationsProvider, sub_type=None))], member=load, postfix_operators=[], prefix_operators=[], qualifier=ServiceLoader, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=provider)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConfigurationsProvider, sub_type=None))), label=None)
local_variable[type[Iterator], iter]
if[call[iter.hasNext, parameter[]]] begin[{]
local_variable[type[UserConfigurationsProvider], provider]
call[provider.setCreatedWithSPI, parameter[]]
call[ret.setUserConfigurations, parameter[member[.provider]]]
else begin[{]
None
end[}]
return[member[.ret]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] identifier[ConfigurationsCatalog] identifier[newInstance] operator[SEP] operator[SEP] {
identifier[ConfigurationsCatalog] identifier[ret] operator[=] Keyword[new] identifier[ConfigurationsCatalog] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ConfigurationsProvider] identifier[provider] operator[:] identifier[ServiceLoader] operator[SEP] identifier[load] operator[SEP] identifier[ConfigurationsProvider] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[provider] operator[SEP] identifier[setCreatedWithSPI] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[addFactory] operator[SEP] identifier[provider] operator[SEP] operator[SEP]
}
identifier[Iterator] operator[<] identifier[UserConfigurationsProvider] operator[>] identifier[iter] operator[=] identifier[ServiceLoader] operator[SEP] identifier[load] operator[SEP] identifier[UserConfigurationsProvider] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[UserConfigurationsProvider] identifier[provider] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[provider] operator[SEP] identifier[setCreatedWithSPI] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[setUserConfigurations] operator[SEP] identifier[provider] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ret] operator[SEP]
}
|
public static boolean containsAny(final String value, final String[] needles, final boolean caseSensitive) {
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
return Arrays.stream(needles).anyMatch(needle -> contains(value, needle, caseSensitive));
} | class class_name[name] begin[{]
method[containsAny, return_type[type[boolean]], modifier[public static], parameter[value, needles, caseSensitive]] begin[{]
call[.validate, parameter[member[.value], member[.NULL_STRING_PREDICATE], member[.NULL_STRING_MSG_SUPPLIER]]]
return[call[Arrays.stream, parameter[member[.needles]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[containsAny] operator[SEP] Keyword[final] identifier[String] identifier[value] , Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[needles] , Keyword[final] Keyword[boolean] identifier[caseSensitive] operator[SEP] {
identifier[validate] operator[SEP] identifier[value] , identifier[NULL_STRING_PREDICATE] , identifier[NULL_STRING_MSG_SUPPLIER] operator[SEP] operator[SEP] Keyword[return] identifier[Arrays] operator[SEP] identifier[stream] operator[SEP] identifier[needles] operator[SEP] operator[SEP] identifier[anyMatch] operator[SEP] identifier[needle] operator[->] identifier[contains] operator[SEP] identifier[value] , identifier[needle] , identifier[caseSensitive] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public DeleteServiceSpecificCredentialResult deleteServiceSpecificCredential(DeleteServiceSpecificCredentialRequest request) {
request = beforeClientExecution(request);
return executeDeleteServiceSpecificCredential(request);
} | class class_name[name] begin[{]
method[deleteServiceSpecificCredential, return_type[type[DeleteServiceSpecificCredentialResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeDeleteServiceSpecificCredential, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[DeleteServiceSpecificCredentialResult] identifier[deleteServiceSpecificCredential] operator[SEP] identifier[DeleteServiceSpecificCredentialRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDeleteServiceSpecificCredential] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public CompletableFuture<OperationResult> executeQuery(
long index,
long sequence,
long timestamp,
RaftSession session,
PrimitiveOperation operation) {
CompletableFuture<OperationResult> future = new CompletableFuture<>();
executeQuery(index, sequence, timestamp, session, operation, future);
return future;
} | class class_name[name] begin[{]
method[executeQuery, return_type[type[CompletableFuture]], modifier[public], parameter[index, sequence, timestamp, session, operation]] begin[{]
local_variable[type[CompletableFuture], future]
call[.executeQuery, parameter[member[.index], member[.sequence], member[.timestamp], member[.session], member[.operation], member[.future]]]
return[member[.future]]
end[}]
END[}] | Keyword[public] identifier[CompletableFuture] operator[<] identifier[OperationResult] operator[>] identifier[executeQuery] operator[SEP] Keyword[long] identifier[index] , Keyword[long] identifier[sequence] , Keyword[long] identifier[timestamp] , identifier[RaftSession] identifier[session] , identifier[PrimitiveOperation] identifier[operation] operator[SEP] {
identifier[CompletableFuture] operator[<] identifier[OperationResult] operator[>] identifier[future] operator[=] Keyword[new] identifier[CompletableFuture] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[executeQuery] operator[SEP] identifier[index] , identifier[sequence] , identifier[timestamp] , identifier[session] , identifier[operation] , identifier[future] operator[SEP] operator[SEP] Keyword[return] identifier[future] operator[SEP]
}
|
public static void put(Writer writer, byte value) throws IOException {
writer.write(String.valueOf(value));
} | class class_name[name] begin[{]
method[put, return_type[void], modifier[public static], parameter[writer, value]] begin[{]
call[writer.write, parameter[call[String.valueOf, parameter[member[.value]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[put] operator[SEP] identifier[Writer] identifier[writer] , Keyword[byte] identifier[value] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public synchronized void initiate(@Nullable KeyParameter userKey, ClientChannelProperties clientChannelProperties) throws ValueOutOfRangeException, InsufficientMoneyException {
final NetworkParameters params = wallet.getParams();
Transaction template = new Transaction(params);
// We always place the client key before the server key because, if either side wants some privacy, they can
// use a fresh key for the the multisig contract and nowhere else
List<ECKey> keys = Lists.newArrayList(myKey, serverKey);
// There is also probably a change output, but we don't bother shuffling them as it's obvious from the
// format which one is the change. If we start obfuscating the change output better in future this may
// be worth revisiting.
TransactionOutput multisigOutput = template.addOutput(totalValue, ScriptBuilder.createMultiSigOutputScript(2, keys));
if (multisigOutput.isDust())
throw new ValueOutOfRangeException("totalValue too small to use");
SendRequest req = SendRequest.forTx(template);
req.coinSelector = AllowUnconfirmedCoinSelector.get();
req.shuffleOutputs = false; // TODO: Fix things so shuffling is usable.
req = clientChannelProperties.modifyContractSendRequest(req);
if (userKey != null) req.aesKey = userKey;
wallet.completeTx(req);
Coin multisigFee = req.tx.getFee();
multisigContract = req.tx;
// Build a refund transaction that protects us in the case of a bad server that's just trying to cause havoc
// by locking up peoples money (perhaps as a precursor to a ransom attempt). We time lock it so the server
// has an assurance that we cannot take back our money by claiming a refund before the channel closes - this
// relies on the fact that since Bitcoin 0.8 time locked transactions are non-final. This will need to change
// in future as it breaks the intended design of timelocking/tx replacement, but for now it simplifies this
// specific protocol somewhat.
refundTx = new Transaction(params);
// don't disable lock time. the sequence will be included in the server's signature and thus won't be changeable.
// by using this sequence value, we avoid extra full replace-by-fee and relative lock time processing.
refundTx.addInput(multisigOutput).setSequenceNumber(TransactionInput.NO_SEQUENCE - 1L);
refundTx.setLockTime(expiryTime);
if (Context.get().isEnsureMinRequiredFee()) {
// Must pay min fee.
final Coin valueAfterFee = totalValue.subtract(Transaction.REFERENCE_DEFAULT_MIN_TX_FEE);
if (Transaction.MIN_NONDUST_OUTPUT.compareTo(valueAfterFee) > 0)
throw new ValueOutOfRangeException("totalValue too small to use");
refundTx.addOutput(valueAfterFee, LegacyAddress.fromKey(params, myKey));
refundFees = multisigFee.add(Transaction.REFERENCE_DEFAULT_MIN_TX_FEE);
} else {
refundTx.addOutput(totalValue, LegacyAddress.fromKey(params, myKey));
refundFees = multisigFee;
}
refundTx.getConfidence().setSource(TransactionConfidence.Source.SELF);
log.info("initiated channel with multi-sig contract {}, refund {}", multisigContract.getTxId(),
refundTx.getTxId());
stateMachine.transition(State.INITIATED);
// Client should now call getIncompleteRefundTransaction() and send it to the server.
} | class class_name[name] begin[{]
method[initiate, return_type[void], modifier[synchronized public], parameter[userKey, clientChannelProperties]] begin[{]
local_variable[type[NetworkParameters], params]
local_variable[type[Transaction], template]
local_variable[type[List], keys]
local_variable[type[TransactionOutput], multisigOutput]
if[call[multisigOutput.isDust, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="totalValue too small to use")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ValueOutOfRangeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[SendRequest], req]
assign[member[req.coinSelector], call[AllowUnconfirmedCoinSelector.get, parameter[]]]
assign[member[req.shuffleOutputs], literal[false]]
assign[member[.req], call[clientChannelProperties.modifyContractSendRequest, parameter[member[.req]]]]
if[binary_operation[member[.userKey], !=, literal[null]]] begin[{]
assign[member[req.aesKey], member[.userKey]]
else begin[{]
None
end[}]
call[wallet.completeTx, parameter[member[.req]]]
local_variable[type[Coin], multisigFee]
assign[member[.multisigContract], member[req.tx]]
assign[member[.refundTx], ClassCreator(arguments=[MemberReference(member=params, 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=Transaction, sub_type=None))]
call[refundTx.addInput, parameter[member[.multisigOutput]]]
call[refundTx.setLockTime, parameter[member[.expiryTime]]]
if[call[Context.get, parameter[]]] begin[{]
local_variable[type[Coin], valueAfterFee]
if[binary_operation[call[Transaction.MIN_NONDUST_OUTPUT.compareTo, parameter[member[.valueAfterFee]]], >, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="totalValue too small to use")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ValueOutOfRangeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[refundTx.addOutput, parameter[member[.valueAfterFee], call[LegacyAddress.fromKey, parameter[member[.params], member[.myKey]]]]]
assign[member[.refundFees], call[multisigFee.add, parameter[member[Transaction.REFERENCE_DEFAULT_MIN_TX_FEE]]]]
else begin[{]
call[refundTx.addOutput, parameter[member[.totalValue], call[LegacyAddress.fromKey, parameter[member[.params], member[.myKey]]]]]
assign[member[.refundFees], member[.multisigFee]]
end[}]
call[refundTx.getConfidence, parameter[]]
call[log.info, parameter[literal["initiated channel with multi-sig contract {}, refund {}"], call[multisigContract.getTxId, parameter[]], call[refundTx.getTxId, parameter[]]]]
call[stateMachine.transition, parameter[member[State.INITIATED]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[synchronized] Keyword[void] identifier[initiate] operator[SEP] annotation[@] identifier[Nullable] identifier[KeyParameter] identifier[userKey] , identifier[ClientChannelProperties] identifier[clientChannelProperties] operator[SEP] Keyword[throws] identifier[ValueOutOfRangeException] , identifier[InsufficientMoneyException] {
Keyword[final] identifier[NetworkParameters] identifier[params] operator[=] identifier[wallet] operator[SEP] identifier[getParams] operator[SEP] operator[SEP] operator[SEP] identifier[Transaction] identifier[template] operator[=] Keyword[new] identifier[Transaction] operator[SEP] identifier[params] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ECKey] operator[>] identifier[keys] operator[=] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] identifier[myKey] , identifier[serverKey] operator[SEP] operator[SEP] identifier[TransactionOutput] identifier[multisigOutput] operator[=] identifier[template] operator[SEP] identifier[addOutput] operator[SEP] identifier[totalValue] , identifier[ScriptBuilder] operator[SEP] identifier[createMultiSigOutputScript] operator[SEP] Other[2] , identifier[keys] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[multisigOutput] operator[SEP] identifier[isDust] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ValueOutOfRangeException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[SendRequest] identifier[req] operator[=] identifier[SendRequest] operator[SEP] identifier[forTx] operator[SEP] identifier[template] operator[SEP] operator[SEP] identifier[req] operator[SEP] identifier[coinSelector] operator[=] identifier[AllowUnconfirmedCoinSelector] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[req] operator[SEP] identifier[shuffleOutputs] operator[=] literal[boolean] operator[SEP] identifier[req] operator[=] identifier[clientChannelProperties] operator[SEP] identifier[modifyContractSendRequest] operator[SEP] identifier[req] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[userKey] operator[!=] Other[null] operator[SEP] identifier[req] operator[SEP] identifier[aesKey] operator[=] identifier[userKey] operator[SEP] identifier[wallet] operator[SEP] identifier[completeTx] operator[SEP] identifier[req] operator[SEP] operator[SEP] identifier[Coin] identifier[multisigFee] operator[=] identifier[req] operator[SEP] identifier[tx] operator[SEP] identifier[getFee] operator[SEP] operator[SEP] operator[SEP] identifier[multisigContract] operator[=] identifier[req] operator[SEP] identifier[tx] operator[SEP] identifier[refundTx] operator[=] Keyword[new] identifier[Transaction] operator[SEP] identifier[params] operator[SEP] operator[SEP] identifier[refundTx] operator[SEP] identifier[addInput] operator[SEP] identifier[multisigOutput] operator[SEP] operator[SEP] identifier[setSequenceNumber] operator[SEP] identifier[TransactionInput] operator[SEP] identifier[NO_SEQUENCE] operator[-] Other[1L] operator[SEP] operator[SEP] identifier[refundTx] operator[SEP] identifier[setLockTime] operator[SEP] identifier[expiryTime] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Context] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[isEnsureMinRequiredFee] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[Coin] identifier[valueAfterFee] operator[=] identifier[totalValue] operator[SEP] identifier[subtract] operator[SEP] identifier[Transaction] operator[SEP] identifier[REFERENCE_DEFAULT_MIN_TX_FEE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Transaction] operator[SEP] identifier[MIN_NONDUST_OUTPUT] operator[SEP] identifier[compareTo] operator[SEP] identifier[valueAfterFee] operator[SEP] operator[>] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[ValueOutOfRangeException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[refundTx] operator[SEP] identifier[addOutput] operator[SEP] identifier[valueAfterFee] , identifier[LegacyAddress] operator[SEP] identifier[fromKey] operator[SEP] identifier[params] , identifier[myKey] operator[SEP] operator[SEP] operator[SEP] identifier[refundFees] operator[=] identifier[multisigFee] operator[SEP] identifier[add] operator[SEP] identifier[Transaction] operator[SEP] identifier[REFERENCE_DEFAULT_MIN_TX_FEE] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[refundTx] operator[SEP] identifier[addOutput] operator[SEP] identifier[totalValue] , identifier[LegacyAddress] operator[SEP] identifier[fromKey] operator[SEP] identifier[params] , identifier[myKey] operator[SEP] operator[SEP] operator[SEP] identifier[refundFees] operator[=] identifier[multisigFee] operator[SEP]
}
identifier[refundTx] operator[SEP] identifier[getConfidence] operator[SEP] operator[SEP] operator[SEP] identifier[setSource] operator[SEP] identifier[TransactionConfidence] operator[SEP] identifier[Source] operator[SEP] identifier[SELF] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[multisigContract] operator[SEP] identifier[getTxId] operator[SEP] operator[SEP] , identifier[refundTx] operator[SEP] identifier[getTxId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stateMachine] operator[SEP] identifier[transition] operator[SEP] identifier[State] operator[SEP] identifier[INITIATED] operator[SEP] operator[SEP]
}
|
@Override
public Object writeReplace(Object obj)
{
Calendar cal = (Calendar) obj;
return new CalendarHandle(cal.getClass(), cal.getTimeInMillis());
} | class class_name[name] begin[{]
method[writeReplace, return_type[type[Object]], modifier[public], parameter[obj]] begin[{]
local_variable[type[Calendar], cal]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getTimeInMillis, postfix_operators=[], prefix_operators=[], qualifier=cal, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CalendarHandle, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[writeReplace] operator[SEP] identifier[Object] identifier[obj] operator[SEP] {
identifier[Calendar] identifier[cal] operator[=] operator[SEP] identifier[Calendar] operator[SEP] identifier[obj] operator[SEP] Keyword[return] Keyword[new] identifier[CalendarHandle] operator[SEP] identifier[cal] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[cal] operator[SEP] identifier[getTimeInMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void addMixIns(Set<Map.Entry<Class<?>, Class<?>>> toAddMixIns) {
ThreadJacksonMixInHolder holder = holderThreadLocal.get();
if (holder == null) {
holder = new ThreadJacksonMixInHolder();
holderThreadLocal.set(holder);
}
if (holder.mixIns == null) {
holder.mixIns = new HashSet<Map.Entry<Class<?>, Class<?>>>();
}
holder.mixIns.addAll(toAddMixIns);
} | class class_name[name] begin[{]
method[addMixIns, return_type[void], modifier[public static], parameter[toAddMixIns]] begin[{]
local_variable[type[ThreadJacksonMixInHolder], holder]
if[binary_operation[member[.holder], ==, literal[null]]] begin[{]
assign[member[.holder], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ThreadJacksonMixInHolder, sub_type=None))]
call[holderThreadLocal.set, parameter[member[.holder]]]
else begin[{]
None
end[}]
if[binary_operation[member[holder.mixIns], ==, literal[null]]] begin[{]
assign[member[holder.mixIns], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))], dimensions=None, name=HashSet, sub_type=None))]
else begin[{]
None
end[}]
call[holder.mixIns.addAll, parameter[member[.toAddMixIns]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[addMixIns] operator[SEP] identifier[Set] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Class] operator[<] operator[?] operator[>] , identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[>] identifier[toAddMixIns] operator[SEP] {
identifier[ThreadJacksonMixInHolder] identifier[holder] operator[=] identifier[holderThreadLocal] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[holder] operator[==] Other[null] operator[SEP] {
identifier[holder] operator[=] Keyword[new] identifier[ThreadJacksonMixInHolder] operator[SEP] operator[SEP] operator[SEP] identifier[holderThreadLocal] operator[SEP] identifier[set] operator[SEP] identifier[holder] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[holder] operator[SEP] identifier[mixIns] operator[==] Other[null] operator[SEP] {
identifier[holder] operator[SEP] identifier[mixIns] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Class] operator[<] operator[?] operator[>] , identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
identifier[holder] operator[SEP] identifier[mixIns] operator[SEP] identifier[addAll] operator[SEP] identifier[toAddMixIns] operator[SEP] operator[SEP]
}
|
public Period setStart( Date theDate, TemporalPrecisionEnum thePrecision) {
start = new DateTimeType(theDate, thePrecision);
return this;
} | class class_name[name] begin[{]
method[setStart, return_type[type[Period]], modifier[public], parameter[theDate, thePrecision]] begin[{]
assign[member[.start], ClassCreator(arguments=[MemberReference(member=theDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=thePrecision, 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=DateTimeType, sub_type=None))]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Period] identifier[setStart] operator[SEP] identifier[Date] identifier[theDate] , identifier[TemporalPrecisionEnum] identifier[thePrecision] operator[SEP] {
identifier[start] operator[=] Keyword[new] identifier[DateTimeType] operator[SEP] identifier[theDate] , identifier[thePrecision] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public static boolean isReadable(Document doc) {
Element root = XmlUtils.getRootElement(doc);
return "openimmo".equals(root.getLocalName());
} | class class_name[name] begin[{]
method[isReadable, return_type[type[boolean]], modifier[public static], parameter[doc]] begin[{]
local_variable[type[Element], root]
return[literal["openimmo"]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isReadable] operator[SEP] identifier[Document] identifier[doc] operator[SEP] {
identifier[Element] identifier[root] operator[=] identifier[XmlUtils] operator[SEP] identifier[getRootElement] operator[SEP] identifier[doc] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[root] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static BigMoney of(BigMoneyProvider moneyProvider) {
MoneyUtils.checkNotNull(moneyProvider, "BigMoneyProvider must not be null");
BigMoney money = moneyProvider.toBigMoney();
MoneyUtils.checkNotNull(money, "BigMoneyProvider must not return null");
return money;
} | class class_name[name] begin[{]
method[of, return_type[type[BigMoney]], modifier[public static], parameter[moneyProvider]] begin[{]
call[MoneyUtils.checkNotNull, parameter[member[.moneyProvider], literal["BigMoneyProvider must not be null"]]]
local_variable[type[BigMoney], money]
call[MoneyUtils.checkNotNull, parameter[member[.money], literal["BigMoneyProvider must not return null"]]]
return[member[.money]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[BigMoney] identifier[of] operator[SEP] identifier[BigMoneyProvider] identifier[moneyProvider] operator[SEP] {
identifier[MoneyUtils] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[moneyProvider] , literal[String] operator[SEP] operator[SEP] identifier[BigMoney] identifier[money] operator[=] identifier[moneyProvider] operator[SEP] identifier[toBigMoney] operator[SEP] operator[SEP] operator[SEP] identifier[MoneyUtils] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[money] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[money] operator[SEP]
}
|
public static int writeIntAsVarIntBytes(int intVal, byte[] bytes, int offset) {
int pos = offset;
int v = intVal;
if ((v & ~0x7F) == 0) {
bytes[pos++] = ((byte) v);
return 1 + offset;
}
while (true) {
if ((v & ~0x7F) == 0) {
bytes[pos++] = ((byte) v);
return pos;
} else {
bytes[pos++] = (byte) ((v & 0x7F) | 0x80);
v >>>= 7;
}
}
} | class class_name[name] begin[{]
method[writeIntAsVarIntBytes, return_type[type[int]], modifier[public static], parameter[intVal, bytes, offset]] begin[{]
local_variable[type[int], pos]
local_variable[type[int], v]
if[binary_operation[binary_operation[member[.v], &, literal[0x7F]], ==, literal[0]]] begin[{]
assign[member[.bytes], Cast(expression=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))]
return[binary_operation[literal[1], +, member[.offset]]]
else begin[{]
None
end[}]
while[literal[true]] begin[{]
if[binary_operation[binary_operation[member[.v], &, literal[0x7F]], ==, literal[0]]] begin[{]
assign[member[.bytes], Cast(expression=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))]
return[member[.pos]]
else begin[{]
assign[member[.bytes], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x7F), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x80), operator=|), type=BasicType(dimensions=[], name=byte))]
assign[member[.v], literal[7]]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[writeIntAsVarIntBytes] operator[SEP] Keyword[int] identifier[intVal] , Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] , Keyword[int] identifier[offset] operator[SEP] {
Keyword[int] identifier[pos] operator[=] identifier[offset] operator[SEP] Keyword[int] identifier[v] operator[=] identifier[intVal] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[v] operator[&] operator[~] literal[Integer] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[bytes] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] identifier[v] operator[SEP] operator[SEP] Keyword[return] Other[1] operator[+] identifier[offset] operator[SEP]
}
Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[v] operator[&] operator[~] literal[Integer] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[bytes] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] identifier[v] operator[SEP] operator[SEP] Keyword[return] identifier[pos] operator[SEP]
}
Keyword[else] {
identifier[bytes] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[v] operator[&] literal[Integer] operator[SEP] operator[|] literal[Integer] operator[SEP] operator[SEP] identifier[v] operator[>>>=] Other[7] operator[SEP]
}
}
}
|
public DfuServiceInitiator setZip(@NonNull final String path) {
return init(null, path, 0, DfuBaseService.TYPE_AUTO, DfuBaseService.MIME_TYPE_ZIP);
} | class class_name[name] begin[{]
method[setZip, return_type[type[DfuServiceInitiator]], modifier[public], parameter[path]] begin[{]
return[call[.init, parameter[literal[null], member[.path], literal[0], member[DfuBaseService.TYPE_AUTO], member[DfuBaseService.MIME_TYPE_ZIP]]]]
end[}]
END[}] | Keyword[public] identifier[DfuServiceInitiator] identifier[setZip] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[String] identifier[path] operator[SEP] {
Keyword[return] identifier[init] operator[SEP] Other[null] , identifier[path] , Other[0] , identifier[DfuBaseService] operator[SEP] identifier[TYPE_AUTO] , identifier[DfuBaseService] operator[SEP] identifier[MIME_TYPE_ZIP] operator[SEP] operator[SEP]
}
|
public void printTo(StringBuilder buf, ReadablePartial partial) {
try {
printTo((Appendable) buf, partial);
} catch (IOException ex) {
// StringBuilder does not throw IOException
}
} | class class_name[name] begin[{]
method[printTo, return_type[void], modifier[public], parameter[buf, partial]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Appendable, sub_type=None)), MemberReference(member=partial, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printTo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[printTo] operator[SEP] identifier[StringBuilder] identifier[buf] , identifier[ReadablePartial] identifier[partial] operator[SEP] {
Keyword[try] {
identifier[printTo] operator[SEP] operator[SEP] identifier[Appendable] operator[SEP] identifier[buf] , identifier[partial] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] {
}
}
|
public static Cluster createCluster(String clusterName,
CassandraHostConfigurator cassandraHostConfigurator,
Map<String, String> credentials) {
synchronized (clusters) {
Cluster cluster = clusters.get(clusterName);
if ( cluster == null ) {
cluster = new ThriftCluster(clusterName,
cassandraHostConfigurator, credentials);
clusters.put(clusterName, cluster);
cluster.onStartup();
}
return cluster;
}
} | class class_name[name] begin[{]
method[createCluster, return_type[type[Cluster]], modifier[public static], parameter[clusterName, cassandraHostConfigurator, credentials]] begin[{]
SYNCHRONIZED[member[.clusters]] BEGIN[{]
local_variable[type[Cluster], cluster]
if[binary_operation[member[.cluster], ==, literal[null]]] begin[{]
assign[member[.cluster], ClassCreator(arguments=[MemberReference(member=clusterName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cassandraHostConfigurator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=credentials, 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=ThriftCluster, sub_type=None))]
call[clusters.put, parameter[member[.clusterName], member[.cluster]]]
call[cluster.onStartup, parameter[]]
else begin[{]
None
end[}]
return[member[.cluster]]
END[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Cluster] identifier[createCluster] operator[SEP] identifier[String] identifier[clusterName] , identifier[CassandraHostConfigurator] identifier[cassandraHostConfigurator] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[credentials] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[clusters] operator[SEP] {
identifier[Cluster] identifier[cluster] operator[=] identifier[clusters] operator[SEP] identifier[get] operator[SEP] identifier[clusterName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cluster] operator[==] Other[null] operator[SEP] {
identifier[cluster] operator[=] Keyword[new] identifier[ThriftCluster] operator[SEP] identifier[clusterName] , identifier[cassandraHostConfigurator] , identifier[credentials] operator[SEP] operator[SEP] identifier[clusters] operator[SEP] identifier[put] operator[SEP] identifier[clusterName] , identifier[cluster] operator[SEP] operator[SEP] identifier[cluster] operator[SEP] identifier[onStartup] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[cluster] operator[SEP]
}
}
|
public void add(BytesRef payload) {
// check space first
// ba is the backing array for data
if (payload.length() > ba.available()) {
if (autoFlush) {
flush();
}
else {
throw new EsHadoopIllegalStateException(
String.format("Auto-flush disabled and bulk buffer full; disable manual flush or increase " +
"capacity [current size %s]; bailing out", ba.capacity()));
}
}
data.copyFrom(payload);
dataEntries++;
if (bufferEntriesThreshold > 0 && dataEntries >= bufferEntriesThreshold) {
if (autoFlush) {
flush();
}
else {
// handle the corner case of manual flush that occurs only after the buffer is completely full (think size of 1)
if (dataEntries > bufferEntriesThreshold) {
throw new EsHadoopIllegalStateException(
String.format(
"Auto-flush disabled and maximum number of entries surpassed; disable manual " +
"flush or increase capacity [current size %s]; bailing out",
bufferEntriesThreshold));
}
}
}
} | class class_name[name] begin[{]
method[add, return_type[void], modifier[public], parameter[payload]] begin[{]
if[binary_operation[call[payload.length, parameter[]], >, call[ba.available, parameter[]]]] begin[{]
if[member[.autoFlush]] begin[{]
call[.flush, parameter[]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Auto-flush disabled and bulk buffer full; disable manual flush or increase "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="capacity [current size %s]; bailing out"), operator=+), MethodInvocation(arguments=[], member=capacity, postfix_operators=[], prefix_operators=[], qualifier=ba, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EsHadoopIllegalStateException, sub_type=None)), label=None)
end[}]
else begin[{]
None
end[}]
call[data.copyFrom, parameter[member[.payload]]]
member[.dataEntries]
if[binary_operation[binary_operation[member[.bufferEntriesThreshold], >, literal[0]], &&, binary_operation[member[.dataEntries], >=, member[.bufferEntriesThreshold]]]] begin[{]
if[member[.autoFlush]] begin[{]
call[.flush, parameter[]]
else begin[{]
if[binary_operation[member[.dataEntries], >, member[.bufferEntriesThreshold]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Auto-flush disabled and maximum number of entries surpassed; disable manual "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="flush or increase capacity [current size %s]; bailing out"), operator=+), MemberReference(member=bufferEntriesThreshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EsHadoopIllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[add] operator[SEP] identifier[BytesRef] identifier[payload] operator[SEP] {
Keyword[if] operator[SEP] identifier[payload] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[ba] operator[SEP] identifier[available] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[autoFlush] operator[SEP] {
identifier[flush] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[EsHadoopIllegalStateException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] operator[+] literal[String] , identifier[ba] operator[SEP] identifier[capacity] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[data] operator[SEP] identifier[copyFrom] operator[SEP] identifier[payload] operator[SEP] operator[SEP] identifier[dataEntries] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[bufferEntriesThreshold] operator[>] Other[0] operator[&&] identifier[dataEntries] operator[>=] identifier[bufferEntriesThreshold] operator[SEP] {
Keyword[if] operator[SEP] identifier[autoFlush] operator[SEP] {
identifier[flush] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[dataEntries] operator[>] identifier[bufferEntriesThreshold] operator[SEP] {
Keyword[throw] Keyword[new] identifier[EsHadoopIllegalStateException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] operator[+] literal[String] , identifier[bufferEntriesThreshold] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
|
public SmartHandle drop(int index, String newName, Class<?> type) {
return new SmartHandle(signature.insertArg(index, newName, type), MethodHandles.dropArguments(handle, index, type));
} | class class_name[name] begin[{]
method[drop, return_type[type[SmartHandle]], modifier[public], parameter[index, newName, type]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insertArg, postfix_operators=[], prefix_operators=[], qualifier=signature, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=handle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=dropArguments, postfix_operators=[], prefix_operators=[], qualifier=MethodHandles, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SmartHandle, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[SmartHandle] identifier[drop] operator[SEP] Keyword[int] identifier[index] , identifier[String] identifier[newName] , identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[SEP] {
Keyword[return] Keyword[new] identifier[SmartHandle] operator[SEP] identifier[signature] operator[SEP] identifier[insertArg] operator[SEP] identifier[index] , identifier[newName] , identifier[type] operator[SEP] , identifier[MethodHandles] operator[SEP] identifier[dropArguments] operator[SEP] identifier[handle] , identifier[index] , identifier[type] operator[SEP] operator[SEP] operator[SEP]
}
|
public boolean containsKey(final Object k) {
return this._current.containsKey(k)
|| (this._parent != null && this._parent.containsKey(k));
} | class class_name[name] begin[{]
method[containsKey, return_type[type[boolean]], modifier[public], parameter[k]] begin[{]
return[binary_operation[THIS[member[None._current]call[None.containsKey, parameter[member[.k]]]], ||, binary_operation[binary_operation[THIS[member[None._parent]], !=, literal[null]], &&, THIS[member[None._parent]call[None.containsKey, parameter[member[.k]]]]]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[containsKey] operator[SEP] Keyword[final] identifier[Object] identifier[k] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[_current] operator[SEP] identifier[containsKey] operator[SEP] identifier[k] operator[SEP] operator[||] operator[SEP] Keyword[this] operator[SEP] identifier[_parent] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[_parent] operator[SEP] identifier[containsKey] operator[SEP] identifier[k] operator[SEP] operator[SEP] operator[SEP]
}
|
public EClass getIfcStructuralAction() {
if (ifcStructuralActionEClass == null) {
ifcStructuralActionEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(534);
}
return ifcStructuralActionEClass;
} | class class_name[name] begin[{]
method[getIfcStructuralAction, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcStructuralActionEClass], ==, literal[null]]] begin[{]
assign[member[.ifcStructuralActionEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=534)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))]
else begin[{]
None
end[}]
return[member[.ifcStructuralActionEClass]]
end[}]
END[}] | Keyword[public] identifier[EClass] identifier[getIfcStructuralAction] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcStructuralActionEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcStructuralActionEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[534] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcStructuralActionEClass] operator[SEP]
}
|
public static <T> T deserializeValue(byte[] serializedValue, TypeSerializer<T> serializer) throws IOException {
if (serializedValue == null) {
return null;
} else {
final DataInputDeserializer deser = new DataInputDeserializer(
serializedValue, 0, serializedValue.length);
final T value = serializer.deserialize(deser);
if (deser.available() > 0) {
throw new IOException(
"Unconsumed bytes in the deserialized value. " +
"This indicates a mismatch in the value serializers " +
"used by the KvState instance and this access.");
}
return value;
}
} | class class_name[name] begin[{]
method[deserializeValue, return_type[type[T]], modifier[public static], parameter[serializedValue, serializer]] begin[{]
if[binary_operation[member[.serializedValue], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
local_variable[type[DataInputDeserializer], deser]
local_variable[type[T], value]
if[binary_operation[call[deser.available, parameter[]], >, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unconsumed bytes in the deserialized value. "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This indicates a mismatch in the value serializers "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="used by the KvState instance and this access."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.value]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[deserializeValue] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[serializedValue] , identifier[TypeSerializer] operator[<] identifier[T] operator[>] identifier[serializer] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[serializedValue] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[else] {
Keyword[final] identifier[DataInputDeserializer] identifier[deser] operator[=] Keyword[new] identifier[DataInputDeserializer] operator[SEP] identifier[serializedValue] , Other[0] , identifier[serializedValue] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[final] identifier[T] identifier[value] operator[=] identifier[serializer] operator[SEP] identifier[deserialize] operator[SEP] identifier[deser] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[deser] operator[SEP] identifier[available] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[value] operator[SEP]
}
}
|
@SuppressWarnings("unchecked")
@Override
public EList<IfcPerson> getResponsiblePersons() {
return (EList<IfcPerson>) eGet(Ifc4Package.Literals.IFC_INVENTORY__RESPONSIBLE_PERSONS, true);
} | class class_name[name] begin[{]
method[getResponsiblePersons, return_type[type[EList]], modifier[public], parameter[]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=IFC_INVENTORY__RESPONSIBLE_PERSONS, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package.Literals, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IfcPerson, sub_type=None))], dimensions=[], name=EList, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[EList] operator[<] identifier[IfcPerson] operator[>] identifier[getResponsiblePersons] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[EList] operator[<] identifier[IfcPerson] operator[>] operator[SEP] identifier[eGet] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[Literals] operator[SEP] identifier[IFC_INVENTORY__RESPONSIBLE_PERSONS] , literal[boolean] operator[SEP] operator[SEP]
}
|
public static int getCompatibleBufferedImageType(final BufferedImage image) {
Validate.notNull(image, "image");
WritableRaster raster = image.getRaster();
SampleModel sm = raster.getSampleModel();
int numBands = raster.getNumBands();
ColorModel cm = image.getColorModel();
ColorSpace cs = cm.getColorSpace();
boolean isAlphaPre = cm.isAlphaPremultiplied();
int csType = cs.getType();
int dataType = raster.getDataBuffer().getDataType();
if (csType != ColorSpace.TYPE_RGB) {
if (csType == ColorSpace.TYPE_GRAY && cm instanceof ComponentColorModel) {
if (sm instanceof ComponentSampleModel && ((ComponentSampleModel) sm).getPixelStride() != numBands) {
return BufferedImage.TYPE_CUSTOM;
}
else if (dataType == DataBuffer.TYPE_BYTE && raster.getNumBands() == 1 &&
cm.getComponentSize(0) == 8 && ((ComponentSampleModel) sm).getPixelStride() == 1) {
return BufferedImage.TYPE_BYTE_GRAY;
}
else if (dataType == DataBuffer.TYPE_USHORT && raster.getNumBands() == 1 &&
cm.getComponentSize(0) == 16 && ((ComponentSampleModel) sm).getPixelStride() == 1) {
return BufferedImage.TYPE_USHORT_GRAY;
}
}
else {
return BufferedImage.TYPE_CUSTOM;
}
}
if ((dataType == DataBuffer.TYPE_INT) && (numBands == 3 || numBands == 4)) {
// Check if the raster params and the color model are correct
int pixSize = cm.getPixelSize();
if (cm instanceof DirectColorModel && sm.getNumDataElements() == 1 && (pixSize == 32 || pixSize == 24)) {
// Now check on the DirectColorModel params
DirectColorModel dcm = (DirectColorModel) cm;
int rmask = dcm.getRedMask();
int gmask = dcm.getGreenMask();
int bmask = dcm.getBlueMask();
if (rmask == DCM_RED_MASK && gmask == DCM_GREEN_MASK && bmask == DCM_BLUE_MASK) {
if (dcm.getAlphaMask() == DCM_ALPHA_MASK) {
return isAlphaPre ? BufferedImage.TYPE_INT_ARGB_PRE : BufferedImage.TYPE_INT_ARGB;
}
else if (!dcm.hasAlpha()) {
// No Alpha
return BufferedImage.TYPE_INT_RGB;
}
}
else if (rmask == DCM_BGR_RED_MASK && gmask == DCM_BGR_GRN_MASK && bmask == DCM_BGR_BLU_MASK) {
if (!dcm.hasAlpha()) {
return BufferedImage.TYPE_INT_BGR;
}
}
}
}
else if ((cm instanceof IndexColorModel) && (numBands == 1) && (!cm.hasAlpha() || !isAlphaPre)) {
IndexColorModel icm = (IndexColorModel) cm;
int pixSize = icm.getPixelSize();
if (dataType == DataBuffer.TYPE_BYTE && sm instanceof MultiPixelPackedSampleModel) {
return BufferedImage.TYPE_BYTE_BINARY;
}
if (dataType == DataBuffer.TYPE_BYTE && sm instanceof ComponentSampleModel) {
ComponentSampleModel csm = (ComponentSampleModel) sm;
if (csm.getPixelStride() == 1 && pixSize <= 8) {
return BufferedImage.TYPE_BYTE_INDEXED;
}
}
}
else if ((dataType == DataBuffer.TYPE_USHORT) &&
(cm instanceof DirectColorModel) && (numBands == 3) && !cm.hasAlpha()) {
DirectColorModel dcm = (DirectColorModel) cm;
if (dcm.getRedMask() == DCM_565_RED_MASK &&
dcm.getGreenMask() == DCM_565_GRN_MASK && dcm.getBlueMask() == DCM_565_BLU_MASK) {
return BufferedImage.TYPE_USHORT_565_RGB;
}
else if (dcm.getRedMask() == DCM_555_RED_MASK &&
dcm.getGreenMask() == DCM_555_GRN_MASK && dcm.getBlueMask() == DCM_555_BLU_MASK) {
return BufferedImage.TYPE_USHORT_555_RGB;
}
}
else if (dataType == DataBuffer.TYPE_BYTE && cm instanceof ComponentColorModel &&
raster.getSampleModel() instanceof PixelInterleavedSampleModel && (numBands == 3 || numBands == 4)) {
ComponentColorModel ccm = (ComponentColorModel) cm;
PixelInterleavedSampleModel csm = (PixelInterleavedSampleModel) raster.getSampleModel();
int[] offs = csm.getBandOffsets();
int[] nBits = ccm.getComponentSize();
boolean is8bit = true;
for (int i = 0; i < numBands; i++) {
if (nBits[i] != 8) {
is8bit = false;
break;
}
}
if (is8bit && csm.getPixelStride() == numBands &&
offs[0] == numBands - 1 && offs[1] == numBands - 2 && offs[2] == numBands - 3) {
if (numBands == 3 && !ccm.hasAlpha()) {
return BufferedImage.TYPE_3BYTE_BGR;
}
else if (offs[3] == 0 && ccm.hasAlpha()) {
return isAlphaPre ? BufferedImage.TYPE_4BYTE_ABGR_PRE : BufferedImage.TYPE_4BYTE_ABGR;
}
}
}
return BufferedImage.TYPE_CUSTOM;
} | class class_name[name] begin[{]
method[getCompatibleBufferedImageType, return_type[type[int]], modifier[public static], parameter[image]] begin[{]
call[Validate.notNull, parameter[member[.image], literal["image"]]]
local_variable[type[WritableRaster], raster]
local_variable[type[SampleModel], sm]
local_variable[type[int], numBands]
local_variable[type[ColorModel], cm]
local_variable[type[ColorSpace], cs]
local_variable[type[boolean], isAlphaPre]
local_variable[type[int], csType]
local_variable[type[int], dataType]
if[binary_operation[member[.csType], !=, member[ColorSpace.TYPE_RGB]]] begin[{]
if[binary_operation[binary_operation[member[.csType], ==, member[ColorSpace.TYPE_GRAY]], &&, binary_operation[member[.cm], instanceof, type[ComponentColorModel]]]] begin[{]
if[binary_operation[binary_operation[member[.sm], instanceof, type[ComponentSampleModel]], &&, binary_operation[Cast(expression=MemberReference(member=sm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ComponentSampleModel, sub_type=None)), !=, member[.numBands]]]] begin[{]
return[member[BufferedImage.TYPE_CUSTOM]]
else begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.dataType], ==, member[DataBuffer.TYPE_BYTE]], &&, binary_operation[call[raster.getNumBands, parameter[]], ==, literal[1]]], &&, binary_operation[call[cm.getComponentSize, parameter[literal[0]]], ==, literal[8]]], &&, binary_operation[Cast(expression=MemberReference(member=sm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ComponentSampleModel, sub_type=None)), ==, literal[1]]]] begin[{]
return[member[BufferedImage.TYPE_BYTE_GRAY]]
else begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.dataType], ==, member[DataBuffer.TYPE_USHORT]], &&, binary_operation[call[raster.getNumBands, parameter[]], ==, literal[1]]], &&, binary_operation[call[cm.getComponentSize, parameter[literal[0]]], ==, literal[16]]], &&, binary_operation[Cast(expression=MemberReference(member=sm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ComponentSampleModel, sub_type=None)), ==, literal[1]]]] begin[{]
return[member[BufferedImage.TYPE_USHORT_GRAY]]
else begin[{]
None
end[}]
end[}]
end[}]
else begin[{]
return[member[BufferedImage.TYPE_CUSTOM]]
end[}]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.dataType], ==, member[DataBuffer.TYPE_INT]], &&, binary_operation[binary_operation[member[.numBands], ==, literal[3]], ||, binary_operation[member[.numBands], ==, literal[4]]]]] begin[{]
local_variable[type[int], pixSize]
if[binary_operation[binary_operation[binary_operation[member[.cm], instanceof, type[DirectColorModel]], &&, binary_operation[call[sm.getNumDataElements, parameter[]], ==, literal[1]]], &&, binary_operation[binary_operation[member[.pixSize], ==, literal[32]], ||, binary_operation[member[.pixSize], ==, literal[24]]]]] begin[{]
local_variable[type[DirectColorModel], dcm]
local_variable[type[int], rmask]
local_variable[type[int], gmask]
local_variable[type[int], bmask]
if[binary_operation[binary_operation[binary_operation[member[.rmask], ==, member[.DCM_RED_MASK]], &&, binary_operation[member[.gmask], ==, member[.DCM_GREEN_MASK]]], &&, binary_operation[member[.bmask], ==, member[.DCM_BLUE_MASK]]]] begin[{]
if[binary_operation[call[dcm.getAlphaMask, parameter[]], ==, member[.DCM_ALPHA_MASK]]] begin[{]
return[TernaryExpression(condition=MemberReference(member=isAlphaPre, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=TYPE_INT_ARGB, postfix_operators=[], prefix_operators=[], qualifier=BufferedImage, selectors=[]), if_true=MemberReference(member=TYPE_INT_ARGB_PRE, postfix_operators=[], prefix_operators=[], qualifier=BufferedImage, selectors=[]))]
else begin[{]
if[call[dcm.hasAlpha, parameter[]]] begin[{]
return[member[BufferedImage.TYPE_INT_RGB]]
else begin[{]
None
end[}]
end[}]
else begin[{]
if[binary_operation[binary_operation[binary_operation[member[.rmask], ==, member[.DCM_BGR_RED_MASK]], &&, binary_operation[member[.gmask], ==, member[.DCM_BGR_GRN_MASK]]], &&, binary_operation[member[.bmask], ==, member[.DCM_BGR_BLU_MASK]]]] begin[{]
if[call[dcm.hasAlpha, parameter[]]] begin[{]
return[member[BufferedImage.TYPE_INT_BGR]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[binary_operation[binary_operation[member[.cm], instanceof, type[IndexColorModel]], &&, binary_operation[member[.numBands], ==, literal[1]]], &&, binary_operation[call[cm.hasAlpha, parameter[]], ||, member[.isAlphaPre]]]] begin[{]
local_variable[type[IndexColorModel], icm]
local_variable[type[int], pixSize]
if[binary_operation[binary_operation[member[.dataType], ==, member[DataBuffer.TYPE_BYTE]], &&, binary_operation[member[.sm], instanceof, type[MultiPixelPackedSampleModel]]]] begin[{]
return[member[BufferedImage.TYPE_BYTE_BINARY]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.dataType], ==, member[DataBuffer.TYPE_BYTE]], &&, binary_operation[member[.sm], instanceof, type[ComponentSampleModel]]]] begin[{]
local_variable[type[ComponentSampleModel], csm]
if[binary_operation[binary_operation[call[csm.getPixelStride, parameter[]], ==, literal[1]], &&, binary_operation[member[.pixSize], <=, literal[8]]]] begin[{]
return[member[BufferedImage.TYPE_BYTE_INDEXED]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.dataType], ==, member[DataBuffer.TYPE_USHORT]], &&, binary_operation[member[.cm], instanceof, type[DirectColorModel]]], &&, binary_operation[member[.numBands], ==, literal[3]]], &&, call[cm.hasAlpha, parameter[]]]] begin[{]
local_variable[type[DirectColorModel], dcm]
if[binary_operation[binary_operation[binary_operation[call[dcm.getRedMask, parameter[]], ==, member[.DCM_565_RED_MASK]], &&, binary_operation[call[dcm.getGreenMask, parameter[]], ==, member[.DCM_565_GRN_MASK]]], &&, binary_operation[call[dcm.getBlueMask, parameter[]], ==, member[.DCM_565_BLU_MASK]]]] begin[{]
return[member[BufferedImage.TYPE_USHORT_565_RGB]]
else begin[{]
if[binary_operation[binary_operation[binary_operation[call[dcm.getRedMask, parameter[]], ==, member[.DCM_555_RED_MASK]], &&, binary_operation[call[dcm.getGreenMask, parameter[]], ==, member[.DCM_555_GRN_MASK]]], &&, binary_operation[call[dcm.getBlueMask, parameter[]], ==, member[.DCM_555_BLU_MASK]]]] begin[{]
return[member[BufferedImage.TYPE_USHORT_555_RGB]]
else begin[{]
None
end[}]
end[}]
else begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.dataType], ==, member[DataBuffer.TYPE_BYTE]], &&, binary_operation[member[.cm], instanceof, type[ComponentColorModel]]], &&, binary_operation[call[raster.getSampleModel, parameter[]], instanceof, type[PixelInterleavedSampleModel]]], &&, binary_operation[binary_operation[member[.numBands], ==, literal[3]], ||, binary_operation[member[.numBands], ==, literal[4]]]]] begin[{]
local_variable[type[ComponentColorModel], ccm]
local_variable[type[PixelInterleavedSampleModel], csm]
local_variable[type[int], offs]
local_variable[type[int], nBits]
local_variable[type[boolean], is8bit]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=nBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=is8bit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numBands, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.is8bit], &&, binary_operation[call[csm.getPixelStride, parameter[]], ==, member[.numBands]]], &&, binary_operation[member[.offs], ==, binary_operation[member[.numBands], -, literal[1]]]], &&, binary_operation[member[.offs], ==, binary_operation[member[.numBands], -, literal[2]]]], &&, binary_operation[member[.offs], ==, binary_operation[member[.numBands], -, literal[3]]]]] begin[{]
if[binary_operation[binary_operation[member[.numBands], ==, literal[3]], &&, call[ccm.hasAlpha, parameter[]]]] begin[{]
return[member[BufferedImage.TYPE_3BYTE_BGR]]
else begin[{]
if[binary_operation[binary_operation[member[.offs], ==, literal[0]], &&, call[ccm.hasAlpha, parameter[]]]] begin[{]
return[TernaryExpression(condition=MemberReference(member=isAlphaPre, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=TYPE_4BYTE_ABGR, postfix_operators=[], prefix_operators=[], qualifier=BufferedImage, selectors=[]), if_true=MemberReference(member=TYPE_4BYTE_ABGR_PRE, postfix_operators=[], prefix_operators=[], qualifier=BufferedImage, selectors=[]))]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
return[member[BufferedImage.TYPE_CUSTOM]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[getCompatibleBufferedImageType] operator[SEP] Keyword[final] identifier[BufferedImage] identifier[image] operator[SEP] {
identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[image] , literal[String] operator[SEP] operator[SEP] identifier[WritableRaster] identifier[raster] operator[=] identifier[image] operator[SEP] identifier[getRaster] operator[SEP] operator[SEP] operator[SEP] identifier[SampleModel] identifier[sm] operator[=] identifier[raster] operator[SEP] identifier[getSampleModel] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[numBands] operator[=] identifier[raster] operator[SEP] identifier[getNumBands] operator[SEP] operator[SEP] operator[SEP] identifier[ColorModel] identifier[cm] operator[=] identifier[image] operator[SEP] identifier[getColorModel] operator[SEP] operator[SEP] operator[SEP] identifier[ColorSpace] identifier[cs] operator[=] identifier[cm] operator[SEP] identifier[getColorSpace] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[isAlphaPre] operator[=] identifier[cm] operator[SEP] identifier[isAlphaPremultiplied] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[csType] operator[=] identifier[cs] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[dataType] operator[=] identifier[raster] operator[SEP] identifier[getDataBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[getDataType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[csType] operator[!=] identifier[ColorSpace] operator[SEP] identifier[TYPE_RGB] operator[SEP] {
Keyword[if] operator[SEP] identifier[csType] operator[==] identifier[ColorSpace] operator[SEP] identifier[TYPE_GRAY] operator[&&] identifier[cm] Keyword[instanceof] identifier[ComponentColorModel] operator[SEP] {
Keyword[if] operator[SEP] identifier[sm] Keyword[instanceof] identifier[ComponentSampleModel] operator[&&] operator[SEP] operator[SEP] identifier[ComponentSampleModel] operator[SEP] identifier[sm] operator[SEP] operator[SEP] identifier[getPixelStride] operator[SEP] operator[SEP] operator[!=] identifier[numBands] operator[SEP] {
Keyword[return] identifier[BufferedImage] operator[SEP] identifier[TYPE_CUSTOM] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[dataType] operator[==] identifier[DataBuffer] operator[SEP] identifier[TYPE_BYTE] operator[&&] identifier[raster] operator[SEP] identifier[getNumBands] operator[SEP] operator[SEP] operator[==] Other[1] operator[&&] identifier[cm] operator[SEP] identifier[getComponentSize] operator[SEP] Other[0] operator[SEP] operator[==] Other[8] operator[&&] operator[SEP] operator[SEP] identifier[ComponentSampleModel] operator[SEP] identifier[sm] operator[SEP] operator[SEP] identifier[getPixelStride] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
Keyword[return] identifier[BufferedImage] operator[SEP] identifier[TYPE_BYTE_GRAY] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[dataType] operator[==] identifier[DataBuffer] operator[SEP] identifier[TYPE_USHORT] operator[&&] identifier[raster] operator[SEP] identifier[getNumBands] operator[SEP] operator[SEP] operator[==] Other[1] operator[&&] identifier[cm] operator[SEP] identifier[getComponentSize] operator[SEP] Other[0] operator[SEP] operator[==] Other[16] operator[&&] operator[SEP] operator[SEP] identifier[ComponentSampleModel] operator[SEP] identifier[sm] operator[SEP] operator[SEP] identifier[getPixelStride] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
Keyword[return] identifier[BufferedImage] operator[SEP] identifier[TYPE_USHORT_GRAY] operator[SEP]
}
}
Keyword[else] {
Keyword[return] identifier[BufferedImage] operator[SEP] identifier[TYPE_CUSTOM] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[SEP] identifier[dataType] operator[==] identifier[DataBuffer] operator[SEP] identifier[TYPE_INT] operator[SEP] operator[&&] operator[SEP] identifier[numBands] operator[==] Other[3] operator[||] identifier[numBands] operator[==] Other[4] operator[SEP] operator[SEP] {
Keyword[int] identifier[pixSize] operator[=] identifier[cm] operator[SEP] identifier[getPixelSize] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cm] Keyword[instanceof] identifier[DirectColorModel] operator[&&] identifier[sm] operator[SEP] identifier[getNumDataElements] operator[SEP] operator[SEP] operator[==] Other[1] operator[&&] operator[SEP] identifier[pixSize] operator[==] Other[32] operator[||] identifier[pixSize] operator[==] Other[24] operator[SEP] operator[SEP] {
identifier[DirectColorModel] identifier[dcm] operator[=] operator[SEP] identifier[DirectColorModel] operator[SEP] identifier[cm] operator[SEP] Keyword[int] identifier[rmask] operator[=] identifier[dcm] operator[SEP] identifier[getRedMask] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[gmask] operator[=] identifier[dcm] operator[SEP] identifier[getGreenMask] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[bmask] operator[=] identifier[dcm] operator[SEP] identifier[getBlueMask] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rmask] operator[==] identifier[DCM_RED_MASK] operator[&&] identifier[gmask] operator[==] identifier[DCM_GREEN_MASK] operator[&&] identifier[bmask] operator[==] identifier[DCM_BLUE_MASK] operator[SEP] {
Keyword[if] operator[SEP] identifier[dcm] operator[SEP] identifier[getAlphaMask] operator[SEP] operator[SEP] operator[==] identifier[DCM_ALPHA_MASK] operator[SEP] {
Keyword[return] identifier[isAlphaPre] operator[?] identifier[BufferedImage] operator[SEP] identifier[TYPE_INT_ARGB_PRE] operator[:] identifier[BufferedImage] operator[SEP] identifier[TYPE_INT_ARGB] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[dcm] operator[SEP] identifier[hasAlpha] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[BufferedImage] operator[SEP] identifier[TYPE_INT_RGB] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[rmask] operator[==] identifier[DCM_BGR_RED_MASK] operator[&&] identifier[gmask] operator[==] identifier[DCM_BGR_GRN_MASK] operator[&&] identifier[bmask] operator[==] identifier[DCM_BGR_BLU_MASK] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[dcm] operator[SEP] identifier[hasAlpha] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[BufferedImage] operator[SEP] identifier[TYPE_INT_BGR] operator[SEP]
}
}
}
}
Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[cm] Keyword[instanceof] identifier[IndexColorModel] operator[SEP] operator[&&] operator[SEP] identifier[numBands] operator[==] Other[1] operator[SEP] operator[&&] operator[SEP] operator[!] identifier[cm] operator[SEP] identifier[hasAlpha] operator[SEP] operator[SEP] operator[||] operator[!] identifier[isAlphaPre] operator[SEP] operator[SEP] {
identifier[IndexColorModel] identifier[icm] operator[=] operator[SEP] identifier[IndexColorModel] operator[SEP] identifier[cm] operator[SEP] Keyword[int] identifier[pixSize] operator[=] identifier[icm] operator[SEP] identifier[getPixelSize] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dataType] operator[==] identifier[DataBuffer] operator[SEP] identifier[TYPE_BYTE] operator[&&] identifier[sm] Keyword[instanceof] identifier[MultiPixelPackedSampleModel] operator[SEP] {
Keyword[return] identifier[BufferedImage] operator[SEP] identifier[TYPE_BYTE_BINARY] operator[SEP]
}
Keyword[if] operator[SEP] identifier[dataType] operator[==] identifier[DataBuffer] operator[SEP] identifier[TYPE_BYTE] operator[&&] identifier[sm] Keyword[instanceof] identifier[ComponentSampleModel] operator[SEP] {
identifier[ComponentSampleModel] identifier[csm] operator[=] operator[SEP] identifier[ComponentSampleModel] operator[SEP] identifier[sm] operator[SEP] Keyword[if] operator[SEP] identifier[csm] operator[SEP] identifier[getPixelStride] operator[SEP] operator[SEP] operator[==] Other[1] operator[&&] identifier[pixSize] operator[<=] Other[8] operator[SEP] {
Keyword[return] identifier[BufferedImage] operator[SEP] identifier[TYPE_BYTE_INDEXED] operator[SEP]
}
}
}
Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[dataType] operator[==] identifier[DataBuffer] operator[SEP] identifier[TYPE_USHORT] operator[SEP] operator[&&] operator[SEP] identifier[cm] Keyword[instanceof] identifier[DirectColorModel] operator[SEP] operator[&&] operator[SEP] identifier[numBands] operator[==] Other[3] operator[SEP] operator[&&] operator[!] identifier[cm] operator[SEP] identifier[hasAlpha] operator[SEP] operator[SEP] operator[SEP] {
identifier[DirectColorModel] identifier[dcm] operator[=] operator[SEP] identifier[DirectColorModel] operator[SEP] identifier[cm] operator[SEP] Keyword[if] operator[SEP] identifier[dcm] operator[SEP] identifier[getRedMask] operator[SEP] operator[SEP] operator[==] identifier[DCM_565_RED_MASK] operator[&&] identifier[dcm] operator[SEP] identifier[getGreenMask] operator[SEP] operator[SEP] operator[==] identifier[DCM_565_GRN_MASK] operator[&&] identifier[dcm] operator[SEP] identifier[getBlueMask] operator[SEP] operator[SEP] operator[==] identifier[DCM_565_BLU_MASK] operator[SEP] {
Keyword[return] identifier[BufferedImage] operator[SEP] identifier[TYPE_USHORT_565_RGB] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[dcm] operator[SEP] identifier[getRedMask] operator[SEP] operator[SEP] operator[==] identifier[DCM_555_RED_MASK] operator[&&] identifier[dcm] operator[SEP] identifier[getGreenMask] operator[SEP] operator[SEP] operator[==] identifier[DCM_555_GRN_MASK] operator[&&] identifier[dcm] operator[SEP] identifier[getBlueMask] operator[SEP] operator[SEP] operator[==] identifier[DCM_555_BLU_MASK] operator[SEP] {
Keyword[return] identifier[BufferedImage] operator[SEP] identifier[TYPE_USHORT_555_RGB] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[dataType] operator[==] identifier[DataBuffer] operator[SEP] identifier[TYPE_BYTE] operator[&&] identifier[cm] Keyword[instanceof] identifier[ComponentColorModel] operator[&&] identifier[raster] operator[SEP] identifier[getSampleModel] operator[SEP] operator[SEP] Keyword[instanceof] identifier[PixelInterleavedSampleModel] operator[&&] operator[SEP] identifier[numBands] operator[==] Other[3] operator[||] identifier[numBands] operator[==] Other[4] operator[SEP] operator[SEP] {
identifier[ComponentColorModel] identifier[ccm] operator[=] operator[SEP] identifier[ComponentColorModel] operator[SEP] identifier[cm] operator[SEP] identifier[PixelInterleavedSampleModel] identifier[csm] operator[=] operator[SEP] identifier[PixelInterleavedSampleModel] operator[SEP] identifier[raster] operator[SEP] identifier[getSampleModel] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[offs] operator[=] identifier[csm] operator[SEP] identifier[getBandOffsets] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[nBits] operator[=] identifier[ccm] operator[SEP] identifier[getComponentSize] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[is8bit] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numBands] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[nBits] operator[SEP] identifier[i] operator[SEP] operator[!=] Other[8] operator[SEP] {
identifier[is8bit] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[is8bit] operator[&&] identifier[csm] operator[SEP] identifier[getPixelStride] operator[SEP] operator[SEP] operator[==] identifier[numBands] operator[&&] identifier[offs] operator[SEP] Other[0] operator[SEP] operator[==] identifier[numBands] operator[-] Other[1] operator[&&] identifier[offs] operator[SEP] Other[1] operator[SEP] operator[==] identifier[numBands] operator[-] Other[2] operator[&&] identifier[offs] operator[SEP] Other[2] operator[SEP] operator[==] identifier[numBands] operator[-] Other[3] operator[SEP] {
Keyword[if] operator[SEP] identifier[numBands] operator[==] Other[3] operator[&&] operator[!] identifier[ccm] operator[SEP] identifier[hasAlpha] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[BufferedImage] operator[SEP] identifier[TYPE_3BYTE_BGR] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[offs] operator[SEP] Other[3] operator[SEP] operator[==] Other[0] operator[&&] identifier[ccm] operator[SEP] identifier[hasAlpha] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[isAlphaPre] operator[?] identifier[BufferedImage] operator[SEP] identifier[TYPE_4BYTE_ABGR_PRE] operator[:] identifier[BufferedImage] operator[SEP] identifier[TYPE_4BYTE_ABGR] operator[SEP]
}
}
}
Keyword[return] identifier[BufferedImage] operator[SEP] identifier[TYPE_CUSTOM] operator[SEP]
}
|
public boolean isEIPBound() {
InstanceInfo myInfo = applicationInfoManager.getInfo();
String myInstanceId = ((AmazonInfo) myInfo.getDataCenterInfo()).get(MetaDataKey.instanceId);
String myZone = ((AmazonInfo) myInfo.getDataCenterInfo()).get(MetaDataKey.availabilityZone);
String myPublicIP = ((AmazonInfo) myInfo.getDataCenterInfo()).get(MetaDataKey.publicIpv4);
Collection<String> candidateEIPs = getCandidateEIPs(myInstanceId, myZone);
for (String eipEntry : candidateEIPs) {
if (eipEntry.equals(myPublicIP)) {
logger.info("My instance {} seems to be already associated with the public ip {}",
myInstanceId, myPublicIP);
return true;
}
}
return false;
} | class class_name[name] begin[{]
method[isEIPBound, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
local_variable[type[InstanceInfo], myInfo]
local_variable[type[String], myInstanceId]
local_variable[type[String], myZone]
local_variable[type[String], myPublicIP]
local_variable[type[Collection], candidateEIPs]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=myPublicIP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=eipEntry, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="My instance {} seems to be already associated with the public ip {}"), MemberReference(member=myInstanceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=myPublicIP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=candidateEIPs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=eipEntry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isEIPBound] operator[SEP] operator[SEP] {
identifier[InstanceInfo] identifier[myInfo] operator[=] identifier[applicationInfoManager] operator[SEP] identifier[getInfo] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[myInstanceId] operator[=] operator[SEP] operator[SEP] identifier[AmazonInfo] operator[SEP] identifier[myInfo] operator[SEP] identifier[getDataCenterInfo] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[MetaDataKey] operator[SEP] identifier[instanceId] operator[SEP] operator[SEP] identifier[String] identifier[myZone] operator[=] operator[SEP] operator[SEP] identifier[AmazonInfo] operator[SEP] identifier[myInfo] operator[SEP] identifier[getDataCenterInfo] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[MetaDataKey] operator[SEP] identifier[availabilityZone] operator[SEP] operator[SEP] identifier[String] identifier[myPublicIP] operator[=] operator[SEP] operator[SEP] identifier[AmazonInfo] operator[SEP] identifier[myInfo] operator[SEP] identifier[getDataCenterInfo] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[MetaDataKey] operator[SEP] identifier[publicIpv4] operator[SEP] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[candidateEIPs] operator[=] identifier[getCandidateEIPs] operator[SEP] identifier[myInstanceId] , identifier[myZone] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[eipEntry] operator[:] identifier[candidateEIPs] operator[SEP] {
Keyword[if] operator[SEP] identifier[eipEntry] operator[SEP] identifier[equals] operator[SEP] identifier[myPublicIP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[myInstanceId] , identifier[myPublicIP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public Observable<ServiceResponse<GenericResourceInner>> beginCreateOrUpdateByIdWithServiceResponseAsync(String resourceId, String apiVersion, GenericResourceInner parameters) {
if (resourceId == null) {
throw new IllegalArgumentException("Parameter resourceId is required and cannot be null.");
}
if (apiVersion == null) {
throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
Validator.validate(parameters);
return service.beginCreateOrUpdateById(resourceId, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<GenericResourceInner>>>() {
@Override
public Observable<ServiceResponse<GenericResourceInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<GenericResourceInner> clientResponse = beginCreateOrUpdateByIdDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} | class class_name[name] begin[{]
method[beginCreateOrUpdateByIdWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceId, apiVersion, parameters]] begin[{]
if[binary_operation[member[.resourceId], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceId 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[.apiVersion], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter apiVersion is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.parameters], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter parameters is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[Validator.validate, parameter[member[.parameters]]]
return[call[service.beginCreateOrUpdateById, parameter[member[.resourceId], member[.apiVersion], member[.parameters], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[GenericResourceInner] operator[>] operator[>] identifier[beginCreateOrUpdateByIdWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceId] , identifier[String] identifier[apiVersion] , identifier[GenericResourceInner] identifier[parameters] operator[SEP] {
Keyword[if] operator[SEP] identifier[resourceId] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[apiVersion] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[parameters] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[parameters] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[beginCreateOrUpdateById] operator[SEP] identifier[resourceId] , identifier[apiVersion] , identifier[parameters] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[GenericResourceInner] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[GenericResourceInner] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] {
Keyword[try] {
identifier[ServiceResponse] operator[<] identifier[GenericResourceInner] operator[>] identifier[clientResponse] operator[=] identifier[beginCreateOrUpdateByIdDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
|
public static String tdStyleHtmlContent(String style, String... content) {
return tagStyleHtmlContent(Html.Tag.TD, style, content);
} | class class_name[name] begin[{]
method[tdStyleHtmlContent, return_type[type[String]], modifier[public static], parameter[style, content]] begin[{]
return[call[.tagStyleHtmlContent, parameter[member[Html.Tag.TD], member[.style], member[.content]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[tdStyleHtmlContent] operator[SEP] identifier[String] identifier[style] , identifier[String] operator[...] identifier[content] operator[SEP] {
Keyword[return] identifier[tagStyleHtmlContent] operator[SEP] identifier[Html] operator[SEP] identifier[Tag] operator[SEP] identifier[TD] , identifier[style] , identifier[content] operator[SEP] operator[SEP]
}
|
@Override
public Object invokeMethod(String name, Object arg) {
Object[] args = (Object[])arg;
if (CREATE_APPCTX.equals(name)) {
return createApplicationContext();
}
if (REGISTER_BEANS.equals(name) && args.length == 1 && args[0] instanceof GenericApplicationContext) {
registerBeans((GenericApplicationContext)args[0]);
return null;
}
if (BEANS.equals(name) && args.length == 1 && args[0] instanceof Closure) {
return beans((Closure<?>)args[0]);
}
if (REF.equals(name)) {
String refName;
Assert.notNull(args[0], "Argument to ref() is not a valid bean or was not found");
if (args[0] instanceof RuntimeBeanReference) {
refName = ((RuntimeBeanReference)args[0]).getBeanName();
}
else {
refName = args[0].toString();
}
boolean parentRef = false;
if (args.length > 1) {
if (args[1] instanceof Boolean) {
parentRef = (Boolean) args[1];
}
}
return new RuntimeBeanReference(refName, parentRef);
}
if (namespaceHandlers.containsKey(name) && args.length > 0 && (args[0] instanceof Closure)) {
createDynamicElementReader(name, true).invokeMethod("doCall", args);
return this;
}
if (args.length > 0 && args[0] instanceof Closure) {
// abstract bean definition
return invokeBeanDefiningMethod(name, args);
}
if (args.length > 0 && args[0] instanceof Class || args.length > 0 && args[0] instanceof RuntimeBeanReference || args.length > 0 && args[0] instanceof Map) {
return invokeBeanDefiningMethod(name, args);
}
if (args.length > 1 && args[args.length - 1] instanceof Closure) {
return invokeBeanDefiningMethod(name, args);
}
ApplicationContext ctx = springConfig.getUnrefreshedApplicationContext();
MetaClass mc = DefaultGroovyMethods.getMetaClass(ctx);
if (!mc.respondsTo(ctx, name, args).isEmpty()) {
return mc.invokeMethod(ctx,name, args);
}
return this;
} | class class_name[name] begin[{]
method[invokeMethod, return_type[type[Object]], modifier[public], parameter[name, arg]] begin[{]
local_variable[type[Object], args]
if[call[CREATE_APPCTX.equals, parameter[member[.name]]]] begin[{]
return[call[.createApplicationContext, parameter[]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[REGISTER_BEANS.equals, parameter[member[.name]]], &&, binary_operation[member[args.length], ==, literal[1]]], &&, binary_operation[member[.args], instanceof, type[GenericApplicationContext]]]] begin[{]
call[.registerBeans, parameter[Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=ReferenceType(arguments=None, dimensions=[], name=GenericApplicationContext, sub_type=None))]]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[BEANS.equals, parameter[member[.name]]], &&, binary_operation[member[args.length], ==, literal[1]]], &&, binary_operation[member[.args], instanceof, type[Closure]]]] begin[{]
return[call[.beans, parameter[Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Closure, sub_type=None))]]]
else begin[{]
None
end[}]
if[call[REF.equals, parameter[member[.name]]]] begin[{]
local_variable[type[String], refName]
call[Assert.notNull, parameter[member[.args], literal["Argument to ref() is not a valid bean or was not found"]]]
if[binary_operation[member[.args], instanceof, type[RuntimeBeanReference]]] begin[{]
assign[member[.refName], Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=ReferenceType(arguments=None, dimensions=[], name=RuntimeBeanReference, sub_type=None))]
else begin[{]
assign[member[.refName], member[.args]]
end[}]
local_variable[type[boolean], parentRef]
if[binary_operation[member[args.length], >, literal[1]]] begin[{]
if[binary_operation[member[.args], instanceof, type[Boolean]]] begin[{]
assign[member[.parentRef], Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=refName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parentRef, 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=RuntimeBeanReference, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[namespaceHandlers.containsKey, parameter[member[.name]]], &&, binary_operation[member[args.length], >, literal[0]]], &&, binary_operation[member[.args], instanceof, type[Closure]]]] begin[{]
call[.createDynamicElementReader, parameter[member[.name], literal[true]]]
return[THIS[]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[args.length], >, literal[0]], &&, binary_operation[member[.args], instanceof, type[Closure]]]] begin[{]
return[call[.invokeBeanDefiningMethod, parameter[member[.name], member[.args]]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[args.length], >, literal[0]], &&, binary_operation[member[.args], instanceof, type[Class]]], ||, binary_operation[binary_operation[member[args.length], >, literal[0]], &&, binary_operation[member[.args], instanceof, type[RuntimeBeanReference]]]], ||, binary_operation[binary_operation[member[args.length], >, literal[0]], &&, binary_operation[member[.args], instanceof, type[Map]]]]] begin[{]
return[call[.invokeBeanDefiningMethod, parameter[member[.name], member[.args]]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[args.length], >, literal[1]], &&, binary_operation[member[.args], instanceof, type[Closure]]]] begin[{]
return[call[.invokeBeanDefiningMethod, parameter[member[.name], member[.args]]]]
else begin[{]
None
end[}]
local_variable[type[ApplicationContext], ctx]
local_variable[type[MetaClass], mc]
if[call[mc.respondsTo, parameter[member[.ctx], member[.name], member[.args]]]] begin[{]
return[call[mc.invokeMethod, parameter[member[.ctx], member[.name], member[.args]]]]
else begin[{]
None
end[}]
return[THIS[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[invokeMethod] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[arg] operator[SEP] {
identifier[Object] operator[SEP] operator[SEP] identifier[args] operator[=] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[arg] operator[SEP] Keyword[if] operator[SEP] identifier[CREATE_APPCTX] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[return] identifier[createApplicationContext] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[REGISTER_BEANS] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[&&] identifier[args] operator[SEP] identifier[length] operator[==] Other[1] operator[&&] identifier[args] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[GenericApplicationContext] operator[SEP] {
identifier[registerBeans] operator[SEP] operator[SEP] identifier[GenericApplicationContext] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[BEANS] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[&&] identifier[args] operator[SEP] identifier[length] operator[==] Other[1] operator[&&] identifier[args] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[Closure] operator[SEP] {
Keyword[return] identifier[beans] operator[SEP] operator[SEP] identifier[Closure] operator[<] operator[?] operator[>] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[REF] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[String] identifier[refName] operator[SEP] identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[RuntimeBeanReference] operator[SEP] {
identifier[refName] operator[=] operator[SEP] operator[SEP] identifier[RuntimeBeanReference] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[getBeanName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[refName] operator[=] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[boolean] identifier[parentRef] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] {
Keyword[if] operator[SEP] identifier[args] operator[SEP] Other[1] operator[SEP] Keyword[instanceof] identifier[Boolean] operator[SEP] {
identifier[parentRef] operator[=] operator[SEP] identifier[Boolean] operator[SEP] identifier[args] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[new] identifier[RuntimeBeanReference] operator[SEP] identifier[refName] , identifier[parentRef] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[namespaceHandlers] operator[SEP] identifier[containsKey] operator[SEP] identifier[name] operator[SEP] operator[&&] identifier[args] operator[SEP] identifier[length] operator[>] Other[0] operator[&&] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[Closure] operator[SEP] operator[SEP] {
identifier[createDynamicElementReader] operator[SEP] identifier[name] , literal[boolean] operator[SEP] operator[SEP] identifier[invokeMethod] operator[SEP] literal[String] , identifier[args] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[>] Other[0] operator[&&] identifier[args] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[Closure] operator[SEP] {
Keyword[return] identifier[invokeBeanDefiningMethod] operator[SEP] identifier[name] , identifier[args] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[>] Other[0] operator[&&] identifier[args] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[Class] operator[||] identifier[args] operator[SEP] identifier[length] operator[>] Other[0] operator[&&] identifier[args] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[RuntimeBeanReference] operator[||] identifier[args] operator[SEP] identifier[length] operator[>] Other[0] operator[&&] identifier[args] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[Map] operator[SEP] {
Keyword[return] identifier[invokeBeanDefiningMethod] operator[SEP] identifier[name] , identifier[args] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[>] Other[1] operator[&&] identifier[args] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] Keyword[instanceof] identifier[Closure] operator[SEP] {
Keyword[return] identifier[invokeBeanDefiningMethod] operator[SEP] identifier[name] , identifier[args] operator[SEP] operator[SEP]
}
identifier[ApplicationContext] identifier[ctx] operator[=] identifier[springConfig] operator[SEP] identifier[getUnrefreshedApplicationContext] operator[SEP] operator[SEP] operator[SEP] identifier[MetaClass] identifier[mc] operator[=] identifier[DefaultGroovyMethods] operator[SEP] identifier[getMetaClass] operator[SEP] identifier[ctx] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[mc] operator[SEP] identifier[respondsTo] operator[SEP] identifier[ctx] , identifier[name] , identifier[args] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[mc] operator[SEP] identifier[invokeMethod] operator[SEP] identifier[ctx] , identifier[name] , identifier[args] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public static byte[] hexToByte(String hexStr) {
int hexStrLength = hexStr.length();
if (hexStrLength < 1)
return null;
byte[] result = new byte[hexStrLength / 2];
for (int i = 0; i < hexStrLength / 2; i++) {
int high = Integer.parseInt(hexStr.substring(i * 2, i * 2 + 1), 16);
int low = Integer.parseInt(hexStr.substring(i * 2 + 1, i * 2 + 2), 16);
result[i] = (byte) (high * 16 + low);
}
return result;
} | class class_name[name] begin[{]
method[hexToByte, return_type[type[byte]], modifier[public static], parameter[hexStr]] begin[{]
local_variable[type[int], hexStrLength]
if[binary_operation[member[.hexStrLength], <, literal[1]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[byte], result]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=hexStr, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=high)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=hexStr, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=low)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=high, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=*), operandr=MemberReference(member=low, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), type=BasicType(dimensions=[], name=byte))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=hexStrLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), 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)
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[hexToByte] operator[SEP] identifier[String] identifier[hexStr] operator[SEP] {
Keyword[int] identifier[hexStrLength] operator[=] identifier[hexStr] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hexStrLength] operator[<] Other[1] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[hexStrLength] operator[/] Other[2] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[hexStrLength] operator[/] Other[2] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[int] identifier[high] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[hexStr] operator[SEP] identifier[substring] operator[SEP] identifier[i] operator[*] Other[2] , identifier[i] operator[*] Other[2] operator[+] Other[1] operator[SEP] , Other[16] operator[SEP] operator[SEP] Keyword[int] identifier[low] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[hexStr] operator[SEP] identifier[substring] operator[SEP] identifier[i] operator[*] Other[2] operator[+] Other[1] , identifier[i] operator[*] Other[2] operator[+] Other[2] operator[SEP] , Other[16] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[high] operator[*] Other[16] operator[+] identifier[low] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public <E extends Enum<E> & IApiError> void setApiErrorEnum(Class<E> apiErrorClazz) {
this.apiErrorClazz = apiErrorClazz;
} | class class_name[name] begin[{]
method[setApiErrorEnum, return_type[void], modifier[public], parameter[apiErrorClazz]] begin[{]
assign[THIS[member[None.apiErrorClazz]], member[.apiErrorClazz]]
end[}]
END[}] | Keyword[public] operator[<] identifier[E] Keyword[extends] identifier[Enum] operator[<] identifier[E] operator[>] operator[&] identifier[IApiError] operator[>] Keyword[void] identifier[setApiErrorEnum] operator[SEP] identifier[Class] operator[<] identifier[E] operator[>] identifier[apiErrorClazz] operator[SEP] {
Keyword[this] operator[SEP] identifier[apiErrorClazz] operator[=] identifier[apiErrorClazz] operator[SEP]
}
|
public MockResponse throttleBody(long bytesPerPeriod, long period, TimeUnit unit) {
this.throttleBytesPerPeriod = bytesPerPeriod;
this.throttlePeriodAmount = period;
this.throttlePeriodUnit = unit;
return this;
} | class class_name[name] begin[{]
method[throttleBody, return_type[type[MockResponse]], modifier[public], parameter[bytesPerPeriod, period, unit]] begin[{]
assign[THIS[member[None.throttleBytesPerPeriod]], member[.bytesPerPeriod]]
assign[THIS[member[None.throttlePeriodAmount]], member[.period]]
assign[THIS[member[None.throttlePeriodUnit]], member[.unit]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[MockResponse] identifier[throttleBody] operator[SEP] Keyword[long] identifier[bytesPerPeriod] , Keyword[long] identifier[period] , identifier[TimeUnit] identifier[unit] operator[SEP] {
Keyword[this] operator[SEP] identifier[throttleBytesPerPeriod] operator[=] identifier[bytesPerPeriod] operator[SEP] Keyword[this] operator[SEP] identifier[throttlePeriodAmount] operator[=] identifier[period] operator[SEP] Keyword[this] operator[SEP] identifier[throttlePeriodUnit] operator[=] identifier[unit] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
private StringBuilder buildElementCollectionValue(Field field, Object record, MetamodelImpl metaModel,
Attribute attribute)
{
StringBuilder elementCollectionValueBuilder = new StringBuilder();
EmbeddableType embeddableKey = metaModel.embeddable(((AbstractAttribute) attribute).getBindableJavaType());
((AbstractAttribute) attribute).getJavaMember();
Object value = PropertyAccessorHelper.getObject(record, field);
boolean isPresent = false;
if (Collection.class.isAssignableFrom(field.getType()))
{
if (value instanceof Collection)
{
Collection collection = ((Collection) value);
isPresent = true;
if (List.class.isAssignableFrom(field.getType()))
{
elementCollectionValueBuilder.append(Constants.OPEN_SQUARE_BRACKET);
}
if (Set.class.isAssignableFrom(field.getType()))
{
elementCollectionValueBuilder.append(Constants.OPEN_CURLY_BRACKET);
}
for (Object o : collection)
{
// Allowing null values.
// build embedded value
if (o != null)
{
StringBuilder embeddedValueBuilder = new StringBuilder(Constants.OPEN_CURLY_BRACKET);
for (Field embeddableColumn : ((AbstractAttribute) attribute).getBindableJavaType()
.getDeclaredFields())
{
if (!ReflectUtils.isTransientOrStatic(embeddableColumn))
{
AbstractAttribute subAttribute = (AbstractAttribute) embeddableKey
.getAttribute(embeddableColumn.getName());
if (metaModel.isEmbeddable(subAttribute.getBindableJavaType()))
{
// construct map; recursive
// send attribute
if (embeddableColumn.getType().isAnnotationPresent(ElementCollection.class))
{
// build element collection value
StringBuilder elementCollectionValue = buildElementCollectionValue(
embeddableColumn, o, metaModel, (Attribute) subAttribute);
appendColumnName(embeddedValueBuilder,
((AbstractAttribute) (embeddableKey.getAttribute(embeddableColumn
.getName()))).getJPAColumnName());
embeddedValueBuilder.append(Constants.COLON);
embeddedValueBuilder.append(elementCollectionValue);
}
else
{
buildEmbeddedValue(o, metaModel, embeddedValueBuilder,
(SingularAttribute) subAttribute);
}
}
else
{
// append key value
appendColumnName(
embeddedValueBuilder,
((AbstractAttribute) (embeddableKey.getAttribute(embeddableColumn.getName())))
.getJPAColumnName());
embeddedValueBuilder.append(Constants.COLON);
appendColumnValue(embeddedValueBuilder, o, embeddableColumn);
}
embeddedValueBuilder.append(Constants.COMMA);
}
}
// strip last char and append '}'
embeddedValueBuilder.deleteCharAt(embeddedValueBuilder.length() - 1);
embeddedValueBuilder.append(Constants.CLOSE_CURLY_BRACKET);
// add to columnbuilder and builder
elementCollectionValueBuilder.append(embeddedValueBuilder);
// end if
}
elementCollectionValueBuilder.append(Constants.COMMA);
}
if (!collection.isEmpty())
{
elementCollectionValueBuilder.deleteCharAt(elementCollectionValueBuilder.length() - 1);
}
if (List.class.isAssignableFrom(field.getType()))
{
elementCollectionValueBuilder.append(Constants.CLOSE_SQUARE_BRACKET);
}
if (Set.class.isAssignableFrom(field.getType()))
{
elementCollectionValueBuilder.append(Constants.CLOSE_CURLY_BRACKET);
}
return elementCollectionValueBuilder;
}
return null;
}
else if (Map.class.isAssignableFrom(field.getType()))
{
if (value instanceof Map)
{
Map map = ((Map) value);
isPresent = true;
elementCollectionValueBuilder.append(Constants.OPEN_CURLY_BRACKET);
for (Object mapKey : map.keySet())
{
Object mapValue = map.get(mapKey);
// Allowing null keys.
// key is basic type.. no support for embeddable keys
appendValue(elementCollectionValueBuilder, mapKey != null ? mapKey.getClass() : null, mapKey, false);
elementCollectionValueBuilder.append(Constants.COLON);
// Allowing null values.
if (mapValue != null)
{
StringBuilder embeddedValueBuilder = new StringBuilder(Constants.OPEN_CURLY_BRACKET);
for (Field embeddableColumn : ((AbstractAttribute) attribute).getBindableJavaType()
.getDeclaredFields())
{
if (!ReflectUtils.isTransientOrStatic(embeddableColumn))
{
AbstractAttribute subAttribute = (AbstractAttribute) embeddableKey
.getAttribute(embeddableColumn.getName());
if (metaModel.isEmbeddable(subAttribute.getBindableJavaType()))
{
// construct map; recursive
// send attribute
if (embeddableColumn.getType().isAnnotationPresent(ElementCollection.class))
{
// build element collection value
StringBuilder elementCollectionValue = buildElementCollectionValue(
embeddableColumn, mapValue, metaModel, (Attribute) subAttribute);
appendColumnName(embeddedValueBuilder,
((AbstractAttribute) (embeddableKey.getAttribute(embeddableColumn
.getName()))).getJPAColumnName());
embeddedValueBuilder.append(Constants.COLON);
embeddedValueBuilder.append(elementCollectionValue);
}
else
{
buildEmbeddedValue(mapValue, metaModel, embeddedValueBuilder,
(SingularAttribute) subAttribute);
}
}
else
{
// append key value
appendColumnName(
embeddedValueBuilder,
((AbstractAttribute) (embeddableKey.getAttribute(embeddableColumn.getName())))
.getJPAColumnName());
embeddedValueBuilder.append(Constants.COLON);
appendColumnValue(embeddedValueBuilder, mapValue, embeddableColumn);
}
embeddedValueBuilder.append(Constants.COMMA);
}
}
// strip last char and append '}'
embeddedValueBuilder.deleteCharAt(embeddedValueBuilder.length() - 1);
embeddedValueBuilder.append(Constants.CLOSE_CURLY_BRACKET);
// add to columnbuilder and builder
elementCollectionValueBuilder.append(embeddedValueBuilder);
// end if
}
elementCollectionValueBuilder.append(Constants.COMMA);
}
if (!map.isEmpty())
{
elementCollectionValueBuilder.deleteCharAt(elementCollectionValueBuilder.length() - 1);
}
elementCollectionValueBuilder.append(Constants.CLOSE_CURLY_BRACKET);
return elementCollectionValueBuilder;
}
return null;
}
return null;
} | class class_name[name] begin[{]
method[buildElementCollectionValue, return_type[type[StringBuilder]], modifier[private], parameter[field, record, metaModel, attribute]] begin[{]
local_variable[type[StringBuilder], elementCollectionValueBuilder]
local_variable[type[EmbeddableType], embeddableKey]
Cast(expression=MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None))
local_variable[type[Object], value]
local_variable[type[boolean], isPresent]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Collection, sub_type=None))] begin[{]
if[binary_operation[member[.value], instanceof, type[Collection]]] begin[{]
local_variable[type[Collection], collection]
assign[member[.isPresent], literal[true]]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=List, sub_type=None))] begin[{]
call[elementCollectionValueBuilder.append, parameter[member[Constants.OPEN_SQUARE_BRACKET]]]
else begin[{]
None
end[}]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Set, sub_type=None))] begin[{]
call[elementCollectionValueBuilder.append, parameter[member[Constants.OPEN_CURLY_BRACKET]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=OPEN_CURLY_BRACKET, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=embeddedValueBuilder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=embeddableColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isTransientOrStatic, postfix_operators=[], prefix_operators=['!'], qualifier=ReflectUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=embeddableColumn, selectors=[], type_arguments=None)], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=embeddableKey, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None)), name=subAttribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBindableJavaType, postfix_operators=[], prefix_operators=[], qualifier=subAttribute, selectors=[], type_arguments=None)], member=isEmbeddable, postfix_operators=[], prefix_operators=[], qualifier=metaModel, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=embeddedValueBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=embeddableColumn, selectors=[], type_arguments=None)], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=embeddableKey, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None))], member=appendColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COLON, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=embeddedValueBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=embeddedValueBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=embeddableColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendColumnValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=embeddableColumn, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ElementCollection, sub_type=None))], member=isAnnotationPresent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metaModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=embeddedValueBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=subAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SingularAttribute, sub_type=None))], member=buildEmbeddedValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=embeddableColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metaModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=subAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None))], member=buildElementCollectionValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=elementCollectionValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=embeddedValueBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=embeddableColumn, selectors=[], type_arguments=None)], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=embeddableKey, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None))], member=appendColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COLON, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=embeddedValueBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=elementCollectionValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=embeddedValueBuilder, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COMMA, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=embeddedValueBuilder, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=Cast(expression=MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=embeddableColumn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=embeddedValueBuilder, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=deleteCharAt, postfix_operators=[], prefix_operators=[], qualifier=embeddedValueBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CLOSE_CURLY_BRACKET, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=embeddedValueBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=embeddedValueBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=elementCollectionValueBuilder, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COMMA, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=elementCollectionValueBuilder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=collection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=o)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
if[call[collection.isEmpty, parameter[]]] begin[{]
call[elementCollectionValueBuilder.deleteCharAt, parameter[binary_operation[call[elementCollectionValueBuilder.length, parameter[]], -, literal[1]]]]
else begin[{]
None
end[}]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=List, sub_type=None))] begin[{]
call[elementCollectionValueBuilder.append, parameter[member[Constants.CLOSE_SQUARE_BRACKET]]]
else begin[{]
None
end[}]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Set, sub_type=None))] begin[{]
call[elementCollectionValueBuilder.append, parameter[member[Constants.CLOSE_CURLY_BRACKET]]]
else begin[{]
None
end[}]
return[member[.elementCollectionValueBuilder]]
else begin[{]
None
end[}]
return[literal[null]]
else begin[{]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Map, sub_type=None))] begin[{]
if[binary_operation[member[.value], instanceof, type[Map]]] begin[{]
local_variable[type[Map], map]
assign[member[.isPresent], literal[true]]
call[elementCollectionValueBuilder.append, parameter[member[Constants.OPEN_CURLY_BRACKET]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=mapKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), name=mapValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=elementCollectionValueBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=mapKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=mapKey, selectors=[], type_arguments=None)), MemberReference(member=mapKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=appendValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COLON, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=elementCollectionValueBuilder, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=mapValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=OPEN_CURLY_BRACKET, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=embeddedValueBuilder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=embeddableColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isTransientOrStatic, postfix_operators=[], prefix_operators=['!'], qualifier=ReflectUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=embeddableColumn, selectors=[], type_arguments=None)], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=embeddableKey, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None)), name=subAttribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBindableJavaType, postfix_operators=[], prefix_operators=[], qualifier=subAttribute, selectors=[], type_arguments=None)], member=isEmbeddable, postfix_operators=[], prefix_operators=[], qualifier=metaModel, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=embeddedValueBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=embeddableColumn, selectors=[], type_arguments=None)], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=embeddableKey, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None))], member=appendColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COLON, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=embeddedValueBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=embeddedValueBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mapValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=embeddableColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendColumnValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=embeddableColumn, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ElementCollection, sub_type=None))], member=isAnnotationPresent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mapValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metaModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=embeddedValueBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=subAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SingularAttribute, sub_type=None))], member=buildEmbeddedValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=embeddableColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mapValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metaModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=subAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None))], member=buildElementCollectionValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=elementCollectionValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=embeddedValueBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=embeddableColumn, selectors=[], type_arguments=None)], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=embeddableKey, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None))], member=appendColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COLON, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=embeddedValueBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=elementCollectionValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=embeddedValueBuilder, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COMMA, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=embeddedValueBuilder, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=Cast(expression=MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=embeddableColumn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=embeddedValueBuilder, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=deleteCharAt, postfix_operators=[], prefix_operators=[], qualifier=embeddedValueBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CLOSE_CURLY_BRACKET, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=embeddedValueBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=embeddedValueBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=elementCollectionValueBuilder, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COMMA, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=elementCollectionValueBuilder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=mapKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
if[call[map.isEmpty, parameter[]]] begin[{]
call[elementCollectionValueBuilder.deleteCharAt, parameter[binary_operation[call[elementCollectionValueBuilder.length, parameter[]], -, literal[1]]]]
else begin[{]
None
end[}]
call[elementCollectionValueBuilder.append, parameter[member[Constants.CLOSE_CURLY_BRACKET]]]
return[member[.elementCollectionValueBuilder]]
else begin[{]
None
end[}]
return[literal[null]]
else begin[{]
None
end[}]
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[private] identifier[StringBuilder] identifier[buildElementCollectionValue] operator[SEP] identifier[Field] identifier[field] , identifier[Object] identifier[record] , identifier[MetamodelImpl] identifier[metaModel] , identifier[Attribute] identifier[attribute] operator[SEP] {
identifier[StringBuilder] identifier[elementCollectionValueBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[EmbeddableType] identifier[embeddableKey] operator[=] identifier[metaModel] operator[SEP] identifier[embeddable] operator[SEP] operator[SEP] operator[SEP] identifier[AbstractAttribute] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] identifier[getBindableJavaType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[AbstractAttribute] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] identifier[getJavaMember] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[value] operator[=] identifier[PropertyAccessorHelper] operator[SEP] identifier[getObject] operator[SEP] identifier[record] , identifier[field] operator[SEP] operator[SEP] Keyword[boolean] identifier[isPresent] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[Collection] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Collection] operator[SEP] {
identifier[Collection] identifier[collection] operator[=] operator[SEP] operator[SEP] identifier[Collection] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[isPresent] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[List] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[elementCollectionValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[OPEN_SQUARE_BRACKET] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Set] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[elementCollectionValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[OPEN_CURLY_BRACKET] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Object] identifier[o] operator[:] identifier[collection] operator[SEP] {
Keyword[if] operator[SEP] identifier[o] operator[!=] Other[null] operator[SEP] {
identifier[StringBuilder] identifier[embeddedValueBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[Constants] operator[SEP] identifier[OPEN_CURLY_BRACKET] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[embeddableColumn] operator[:] operator[SEP] operator[SEP] identifier[AbstractAttribute] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] identifier[getBindableJavaType] operator[SEP] operator[SEP] operator[SEP] identifier[getDeclaredFields] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[ReflectUtils] operator[SEP] identifier[isTransientOrStatic] operator[SEP] identifier[embeddableColumn] operator[SEP] operator[SEP] {
identifier[AbstractAttribute] identifier[subAttribute] operator[=] operator[SEP] identifier[AbstractAttribute] operator[SEP] identifier[embeddableKey] operator[SEP] identifier[getAttribute] operator[SEP] identifier[embeddableColumn] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[metaModel] operator[SEP] identifier[isEmbeddable] operator[SEP] identifier[subAttribute] operator[SEP] identifier[getBindableJavaType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[embeddableColumn] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[ElementCollection] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[StringBuilder] identifier[elementCollectionValue] operator[=] identifier[buildElementCollectionValue] operator[SEP] identifier[embeddableColumn] , identifier[o] , identifier[metaModel] , operator[SEP] identifier[Attribute] operator[SEP] identifier[subAttribute] operator[SEP] operator[SEP] identifier[appendColumnName] operator[SEP] identifier[embeddedValueBuilder] , operator[SEP] operator[SEP] identifier[AbstractAttribute] operator[SEP] operator[SEP] identifier[embeddableKey] operator[SEP] identifier[getAttribute] operator[SEP] identifier[embeddableColumn] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getJPAColumnName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[embeddedValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[COLON] operator[SEP] operator[SEP] identifier[embeddedValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[elementCollectionValue] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[buildEmbeddedValue] operator[SEP] identifier[o] , identifier[metaModel] , identifier[embeddedValueBuilder] , operator[SEP] identifier[SingularAttribute] operator[SEP] identifier[subAttribute] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[appendColumnName] operator[SEP] identifier[embeddedValueBuilder] , operator[SEP] operator[SEP] identifier[AbstractAttribute] operator[SEP] operator[SEP] identifier[embeddableKey] operator[SEP] identifier[getAttribute] operator[SEP] identifier[embeddableColumn] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getJPAColumnName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[embeddedValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[COLON] operator[SEP] operator[SEP] identifier[appendColumnValue] operator[SEP] identifier[embeddedValueBuilder] , identifier[o] , identifier[embeddableColumn] operator[SEP] operator[SEP]
}
identifier[embeddedValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[COMMA] operator[SEP] operator[SEP]
}
}
identifier[embeddedValueBuilder] operator[SEP] identifier[deleteCharAt] operator[SEP] identifier[embeddedValueBuilder] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[embeddedValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[CLOSE_CURLY_BRACKET] operator[SEP] operator[SEP] identifier[elementCollectionValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[embeddedValueBuilder] operator[SEP] operator[SEP]
}
identifier[elementCollectionValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[COMMA] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[collection] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[elementCollectionValueBuilder] operator[SEP] identifier[deleteCharAt] operator[SEP] identifier[elementCollectionValueBuilder] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[List] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[elementCollectionValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[CLOSE_SQUARE_BRACKET] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Set] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[elementCollectionValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[CLOSE_CURLY_BRACKET] operator[SEP] operator[SEP]
}
Keyword[return] identifier[elementCollectionValueBuilder] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[Map] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Map] operator[SEP] {
identifier[Map] identifier[map] operator[=] operator[SEP] operator[SEP] identifier[Map] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[isPresent] operator[=] literal[boolean] operator[SEP] identifier[elementCollectionValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[OPEN_CURLY_BRACKET] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[mapKey] operator[:] identifier[map] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[Object] identifier[mapValue] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[mapKey] operator[SEP] operator[SEP] identifier[appendValue] operator[SEP] identifier[elementCollectionValueBuilder] , identifier[mapKey] operator[!=] Other[null] operator[?] identifier[mapKey] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[:] Other[null] , identifier[mapKey] , literal[boolean] operator[SEP] operator[SEP] identifier[elementCollectionValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[COLON] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mapValue] operator[!=] Other[null] operator[SEP] {
identifier[StringBuilder] identifier[embeddedValueBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[Constants] operator[SEP] identifier[OPEN_CURLY_BRACKET] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[embeddableColumn] operator[:] operator[SEP] operator[SEP] identifier[AbstractAttribute] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] identifier[getBindableJavaType] operator[SEP] operator[SEP] operator[SEP] identifier[getDeclaredFields] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[ReflectUtils] operator[SEP] identifier[isTransientOrStatic] operator[SEP] identifier[embeddableColumn] operator[SEP] operator[SEP] {
identifier[AbstractAttribute] identifier[subAttribute] operator[=] operator[SEP] identifier[AbstractAttribute] operator[SEP] identifier[embeddableKey] operator[SEP] identifier[getAttribute] operator[SEP] identifier[embeddableColumn] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[metaModel] operator[SEP] identifier[isEmbeddable] operator[SEP] identifier[subAttribute] operator[SEP] identifier[getBindableJavaType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[embeddableColumn] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[ElementCollection] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[StringBuilder] identifier[elementCollectionValue] operator[=] identifier[buildElementCollectionValue] operator[SEP] identifier[embeddableColumn] , identifier[mapValue] , identifier[metaModel] , operator[SEP] identifier[Attribute] operator[SEP] identifier[subAttribute] operator[SEP] operator[SEP] identifier[appendColumnName] operator[SEP] identifier[embeddedValueBuilder] , operator[SEP] operator[SEP] identifier[AbstractAttribute] operator[SEP] operator[SEP] identifier[embeddableKey] operator[SEP] identifier[getAttribute] operator[SEP] identifier[embeddableColumn] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getJPAColumnName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[embeddedValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[COLON] operator[SEP] operator[SEP] identifier[embeddedValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[elementCollectionValue] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[buildEmbeddedValue] operator[SEP] identifier[mapValue] , identifier[metaModel] , identifier[embeddedValueBuilder] , operator[SEP] identifier[SingularAttribute] operator[SEP] identifier[subAttribute] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[appendColumnName] operator[SEP] identifier[embeddedValueBuilder] , operator[SEP] operator[SEP] identifier[AbstractAttribute] operator[SEP] operator[SEP] identifier[embeddableKey] operator[SEP] identifier[getAttribute] operator[SEP] identifier[embeddableColumn] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getJPAColumnName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[embeddedValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[COLON] operator[SEP] operator[SEP] identifier[appendColumnValue] operator[SEP] identifier[embeddedValueBuilder] , identifier[mapValue] , identifier[embeddableColumn] operator[SEP] operator[SEP]
}
identifier[embeddedValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[COMMA] operator[SEP] operator[SEP]
}
}
identifier[embeddedValueBuilder] operator[SEP] identifier[deleteCharAt] operator[SEP] identifier[embeddedValueBuilder] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[embeddedValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[CLOSE_CURLY_BRACKET] operator[SEP] operator[SEP] identifier[elementCollectionValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[embeddedValueBuilder] operator[SEP] operator[SEP]
}
identifier[elementCollectionValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[COMMA] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[map] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[elementCollectionValueBuilder] operator[SEP] identifier[deleteCharAt] operator[SEP] identifier[elementCollectionValueBuilder] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP]
}
identifier[elementCollectionValueBuilder] operator[SEP] identifier[append] operator[SEP] identifier[Constants] operator[SEP] identifier[CLOSE_CURLY_BRACKET] operator[SEP] operator[SEP] Keyword[return] identifier[elementCollectionValueBuilder] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public static <OLD, NEW, EV> DataSet<Edge<NEW, EV>> translateEdgeIds(DataSet<Edge<OLD, EV>> edges, TranslateFunction<OLD, NEW> translator) {
return translateEdgeIds(edges, translator, PARALLELISM_DEFAULT);
} | class class_name[name] begin[{]
method[translateEdgeIds, return_type[type[DataSet]], modifier[public static], parameter[edges, translator]] begin[{]
return[call[.translateEdgeIds, parameter[member[.edges], member[.translator], member[.PARALLELISM_DEFAULT]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[OLD] , identifier[NEW] , identifier[EV] operator[>] identifier[DataSet] operator[<] identifier[Edge] operator[<] identifier[NEW] , identifier[EV] operator[>] operator[>] identifier[translateEdgeIds] operator[SEP] identifier[DataSet] operator[<] identifier[Edge] operator[<] identifier[OLD] , identifier[EV] operator[>] operator[>] identifier[edges] , identifier[TranslateFunction] operator[<] identifier[OLD] , identifier[NEW] operator[>] identifier[translator] operator[SEP] {
Keyword[return] identifier[translateEdgeIds] operator[SEP] identifier[edges] , identifier[translator] , identifier[PARALLELISM_DEFAULT] operator[SEP] operator[SEP]
}
|
private static String[] parsePair (String pair) {
String[] tmp = new String[2];
int indexOfA = pair.indexOf('{')+1;
int indexOfB = pair.indexOf(',');
tmp[0] = pair.substring(indexOfA,indexOfB);
tmp[1] = pair.substring(indexOfB+2,pair.length()-1);
return tmp;
} | class class_name[name] begin[{]
method[parsePair, return_type[type[String]], modifier[private static], parameter[pair]] begin[{]
local_variable[type[String], tmp]
local_variable[type[int], indexOfA]
local_variable[type[int], indexOfB]
assign[member[.tmp], call[pair.substring, parameter[member[.indexOfA], member[.indexOfB]]]]
assign[member[.tmp], call[pair.substring, parameter[binary_operation[member[.indexOfB], +, literal[2]], binary_operation[call[pair.length, parameter[]], -, literal[1]]]]]
return[member[.tmp]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[parsePair] operator[SEP] identifier[String] identifier[pair] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[tmp] operator[=] Keyword[new] identifier[String] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[int] identifier[indexOfA] operator[=] identifier[pair] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[int] identifier[indexOfB] operator[=] identifier[pair] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[tmp] operator[SEP] Other[0] operator[SEP] operator[=] identifier[pair] operator[SEP] identifier[substring] operator[SEP] identifier[indexOfA] , identifier[indexOfB] operator[SEP] operator[SEP] identifier[tmp] operator[SEP] Other[1] operator[SEP] operator[=] identifier[pair] operator[SEP] identifier[substring] operator[SEP] identifier[indexOfB] operator[+] Other[2] , identifier[pair] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[tmp] operator[SEP]
}
|
static FileSystem createProxiedFileSystemUsingKeytab(State state, URI fsURI, Configuration conf)
throws IOException, InterruptedException {
Preconditions.checkArgument(state.contains(ConfigurationKeys.FS_PROXY_AS_USER_NAME));
Preconditions.checkArgument(state.contains(ConfigurationKeys.SUPER_USER_NAME_TO_PROXY_AS_OTHERS));
Preconditions.checkArgument(state.contains(ConfigurationKeys.SUPER_USER_KEY_TAB_LOCATION));
return createProxiedFileSystemUsingKeytab(state.getProp(ConfigurationKeys.FS_PROXY_AS_USER_NAME),
state.getProp(ConfigurationKeys.SUPER_USER_NAME_TO_PROXY_AS_OTHERS),
new Path(state.getProp(ConfigurationKeys.SUPER_USER_KEY_TAB_LOCATION)), fsURI, conf);
} | class class_name[name] begin[{]
method[createProxiedFileSystemUsingKeytab, return_type[type[FileSystem]], modifier[static], parameter[state, fsURI, conf]] begin[{]
call[Preconditions.checkArgument, parameter[call[state.contains, parameter[member[ConfigurationKeys.FS_PROXY_AS_USER_NAME]]]]]
call[Preconditions.checkArgument, parameter[call[state.contains, parameter[member[ConfigurationKeys.SUPER_USER_NAME_TO_PROXY_AS_OTHERS]]]]]
call[Preconditions.checkArgument, parameter[call[state.contains, parameter[member[ConfigurationKeys.SUPER_USER_KEY_TAB_LOCATION]]]]]
return[call[.createProxiedFileSystemUsingKeytab, parameter[call[state.getProp, parameter[member[ConfigurationKeys.FS_PROXY_AS_USER_NAME]]], call[state.getProp, parameter[member[ConfigurationKeys.SUPER_USER_NAME_TO_PROXY_AS_OTHERS]]], ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=SUPER_USER_KEY_TAB_LOCATION, postfix_operators=[], prefix_operators=[], qualifier=ConfigurationKeys, selectors=[])], member=getProp, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Path, sub_type=None)), member[.fsURI], member[.conf]]]]
end[}]
END[}] | Keyword[static] identifier[FileSystem] identifier[createProxiedFileSystemUsingKeytab] operator[SEP] identifier[State] identifier[state] , identifier[URI] identifier[fsURI] , identifier[Configuration] identifier[conf] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] {
identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[state] operator[SEP] identifier[contains] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[FS_PROXY_AS_USER_NAME] operator[SEP] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[state] operator[SEP] identifier[contains] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[SUPER_USER_NAME_TO_PROXY_AS_OTHERS] operator[SEP] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[state] operator[SEP] identifier[contains] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[SUPER_USER_KEY_TAB_LOCATION] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[createProxiedFileSystemUsingKeytab] operator[SEP] identifier[state] operator[SEP] identifier[getProp] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[FS_PROXY_AS_USER_NAME] operator[SEP] , identifier[state] operator[SEP] identifier[getProp] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[SUPER_USER_NAME_TO_PROXY_AS_OTHERS] operator[SEP] , Keyword[new] identifier[Path] operator[SEP] identifier[state] operator[SEP] identifier[getProp] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[SUPER_USER_KEY_TAB_LOCATION] operator[SEP] operator[SEP] , identifier[fsURI] , identifier[conf] operator[SEP] operator[SEP]
}
|
@Override
public void setCharacterEncoding(String charset) {
if (null != this.outWriter || isCommitted()) {
return;
}
if (null != charset) {
this.encoding = connection.getEncodingUtils().stripQuotes(charset);
}
if (null != this.contentType) {
int index = this.contentType.indexOf("charset=");
StringBuilder sb = new StringBuilder();
if (-1 != index) {
sb.append(this.contentType.substring(0, index - 1).trim());
} else {
sb.append(this.contentType);
}
if (this.encoding != null) {
sb.append(";charset=").append(this.encoding);
}
this.contentType = sb.toString();
this.response.setHeader("Content-Type", this.contentType);
}
} | class class_name[name] begin[{]
method[setCharacterEncoding, return_type[void], modifier[public], parameter[charset]] begin[{]
if[binary_operation[binary_operation[literal[null], !=, THIS[member[None.outWriter]]], ||, call[.isCommitted, parameter[]]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[binary_operation[literal[null], !=, member[.charset]]] begin[{]
assign[THIS[member[None.encoding]], call[connection.getEncodingUtils, parameter[]]]
else begin[{]
None
end[}]
if[binary_operation[literal[null], !=, THIS[member[None.contentType]]]] begin[{]
local_variable[type[int], index]
local_variable[type[StringBuilder], sb]
if[binary_operation[literal[1], !=, member[.index]]] begin[{]
call[sb.append, parameter[THIS[member[None.contentType]call[None.substring, parameter[literal[0], binary_operation[member[.index], -, literal[1]]]]call[None.trim, parameter[]]]]]
else begin[{]
call[sb.append, parameter[THIS[member[None.contentType]]]]
end[}]
if[binary_operation[THIS[member[None.encoding]], !=, literal[null]]] begin[{]
call[sb.append, parameter[literal[";charset="]]]
else begin[{]
None
end[}]
assign[THIS[member[None.contentType]], call[sb.toString, parameter[]]]
THIS[member[None.response]call[None.setHeader, parameter[literal["Content-Type"], THIS[member[None.contentType]]]]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setCharacterEncoding] operator[SEP] identifier[String] identifier[charset] operator[SEP] {
Keyword[if] operator[SEP] Other[null] operator[!=] Keyword[this] operator[SEP] identifier[outWriter] operator[||] identifier[isCommitted] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] Other[null] operator[!=] identifier[charset] operator[SEP] {
Keyword[this] operator[SEP] identifier[encoding] operator[=] identifier[connection] operator[SEP] identifier[getEncodingUtils] operator[SEP] operator[SEP] operator[SEP] identifier[stripQuotes] operator[SEP] identifier[charset] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Other[null] operator[!=] Keyword[this] operator[SEP] identifier[contentType] operator[SEP] {
Keyword[int] identifier[index] operator[=] Keyword[this] operator[SEP] identifier[contentType] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[-] Other[1] operator[!=] identifier[index] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[contentType] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[index] operator[-] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[contentType] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[encoding] operator[!=] Other[null] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[encoding] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[contentType] operator[=] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[response] operator[SEP] identifier[setHeader] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[contentType] operator[SEP] operator[SEP]
}
}
|
public void setWidth(Double width) {
if (width != null && width < 0.0) {
throw new GeoPackageException(
"Width must be greater than or equal to 0.0, invalid value: "
+ width);
}
setValue(getWidthColumnIndex(), width);
} | class class_name[name] begin[{]
method[setWidth, return_type[void], modifier[public], parameter[width]] begin[{]
if[binary_operation[binary_operation[member[.width], !=, literal[null]], &&, binary_operation[member[.width], <, literal[0.0]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Width must be greater than or equal to 0.0, invalid value: "), operandr=MemberReference(member=width, 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=GeoPackageException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.setValue, parameter[call[.getWidthColumnIndex, parameter[]], member[.width]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setWidth] operator[SEP] identifier[Double] identifier[width] operator[SEP] {
Keyword[if] operator[SEP] identifier[width] operator[!=] Other[null] operator[&&] identifier[width] operator[<] literal[Float] operator[SEP] {
Keyword[throw] Keyword[new] identifier[GeoPackageException] operator[SEP] literal[String] operator[+] identifier[width] operator[SEP] operator[SEP]
}
identifier[setValue] operator[SEP] identifier[getWidthColumnIndex] operator[SEP] operator[SEP] , identifier[width] operator[SEP] operator[SEP]
}
|
public String toHexString() {
final StringBuffer sb = new StringBuffer();
for (final byte b : this.bytes) {
sb.append(Integer.toHexString(b & 0xFF));
}
return sb.substring(0, Math.min(this.bitLength / 4, sb.length()));
} | class class_name[name] begin[{]
method[toHexString, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[StringBuffer], sb]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&)], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=bytes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=b)], modifiers={'final'}, type=BasicType(dimensions=[], name=byte))), label=None)
return[call[sb.substring, parameter[literal[0], call[Math.min, parameter[binary_operation[THIS[member[None.bitLength]], /, literal[4]], call[sb.length, parameter[]]]]]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[toHexString] operator[SEP] operator[SEP] {
Keyword[final] identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] Keyword[byte] identifier[b] operator[:] Keyword[this] operator[SEP] identifier[bytes] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[b] operator[&] literal[Integer] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sb] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[Math] operator[SEP] identifier[min] operator[SEP] Keyword[this] operator[SEP] identifier[bitLength] operator[/] Other[4] , identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
protected CmsObject getSearchCms(CmsGallerySearchBean searchObj) throws CmsException {
CmsObject searchCms = getCmsObject();
if (searchObj.isIncludeExpired()) {
searchCms = OpenCms.initCmsObject(getCmsObject());
searchCms.getRequestContext().setRequestTime(CmsResource.DATE_RELEASED_EXPIRED_IGNORE);
}
return searchCms;
} | class class_name[name] begin[{]
method[getSearchCms, return_type[type[CmsObject]], modifier[protected], parameter[searchObj]] begin[{]
local_variable[type[CmsObject], searchCms]
if[call[searchObj.isIncludeExpired, parameter[]]] begin[{]
assign[member[.searchCms], call[OpenCms.initCmsObject, parameter[call[.getCmsObject, parameter[]]]]]
call[searchCms.getRequestContext, parameter[]]
else begin[{]
None
end[}]
return[member[.searchCms]]
end[}]
END[}] | Keyword[protected] identifier[CmsObject] identifier[getSearchCms] operator[SEP] identifier[CmsGallerySearchBean] identifier[searchObj] operator[SEP] Keyword[throws] identifier[CmsException] {
identifier[CmsObject] identifier[searchCms] operator[=] identifier[getCmsObject] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[searchObj] operator[SEP] identifier[isIncludeExpired] operator[SEP] operator[SEP] operator[SEP] {
identifier[searchCms] operator[=] identifier[OpenCms] operator[SEP] identifier[initCmsObject] operator[SEP] identifier[getCmsObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[searchCms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[setRequestTime] operator[SEP] identifier[CmsResource] operator[SEP] identifier[DATE_RELEASED_EXPIRED_IGNORE] operator[SEP] operator[SEP]
}
Keyword[return] identifier[searchCms] operator[SEP]
}
|
public ApiResponse<ApiSuccessResponse> stopRecordingWithHttpInfo(String id, StopRecordingBody stopRecordingBody) throws ApiException {
com.squareup.okhttp.Call call = stopRecordingValidateBeforeCall(id, stopRecordingBody, null, null);
Type localVarReturnType = new TypeToken<ApiSuccessResponse>(){}.getType();
return apiClient.execute(call, localVarReturnType);
} | class class_name[name] begin[{]
method[stopRecordingWithHttpInfo, return_type[type[ApiResponse]], modifier[public], parameter[id, stopRecordingBody]] begin[{]
local_variable[type[com], call]
local_variable[type[Type], localVarReturnType]
return[call[apiClient.execute, parameter[member[.call], member[.localVarReturnType]]]]
end[}]
END[}] | Keyword[public] identifier[ApiResponse] operator[<] identifier[ApiSuccessResponse] operator[>] identifier[stopRecordingWithHttpInfo] operator[SEP] identifier[String] identifier[id] , identifier[StopRecordingBody] identifier[stopRecordingBody] operator[SEP] Keyword[throws] identifier[ApiException] {
identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[call] operator[=] identifier[stopRecordingValidateBeforeCall] operator[SEP] identifier[id] , identifier[stopRecordingBody] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[Type] identifier[localVarReturnType] operator[=] Keyword[new] identifier[TypeToken] operator[<] identifier[ApiSuccessResponse] operator[>] operator[SEP] operator[SEP] {
} operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[apiClient] operator[SEP] identifier[execute] operator[SEP] identifier[call] , identifier[localVarReturnType] operator[SEP] operator[SEP]
}
|
public static void stopService() {
DaemonStarter.currentPhase.set(LifecyclePhase.STOPPING);
final CountDownLatch cdl = new CountDownLatch(1);
Executors.newSingleThreadExecutor().execute(() -> {
DaemonStarter.getLifecycleListener().stopping();
DaemonStarter.daemon.stop();
cdl.countDown();
});
try {
int timeout = DaemonStarter.lifecycleListener.get().getShutdownTimeoutSeconds();
if (!cdl.await(timeout, TimeUnit.SECONDS)) {
DaemonStarter.rlog.error("Failed to stop gracefully");
DaemonStarter.abortSystem();
}
} catch (InterruptedException e) {
DaemonStarter.rlog.error("Failure awaiting stop", e);
Thread.currentThread().interrupt();
}
} | class class_name[name] begin[{]
method[stopService, return_type[void], modifier[public static], parameter[]] begin[{]
call[DaemonStarter.currentPhase.set, parameter[member[LifecyclePhase.STOPPING]]]
local_variable[type[CountDownLatch], cdl]
call[Executors.newSingleThreadExecutor, parameter[]]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=DaemonStarter.lifecycleListener, selectors=[MethodInvocation(arguments=[], member=getShutdownTimeoutSeconds, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=timeout)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SECONDS, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit, selectors=[])], member=await, postfix_operators=[], prefix_operators=['!'], qualifier=cdl, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to stop gracefully")], member=error, postfix_operators=[], prefix_operators=[], qualifier=DaemonStarter.rlog, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=abortSystem, postfix_operators=[], prefix_operators=[], qualifier=DaemonStarter, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failure awaiting stop"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=DaemonStarter.rlog, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=interrupt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[stopService] operator[SEP] operator[SEP] {
identifier[DaemonStarter] operator[SEP] identifier[currentPhase] operator[SEP] identifier[set] operator[SEP] identifier[LifecyclePhase] operator[SEP] identifier[STOPPING] operator[SEP] operator[SEP] Keyword[final] identifier[CountDownLatch] identifier[cdl] operator[=] Keyword[new] identifier[CountDownLatch] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[Executors] operator[SEP] identifier[newSingleThreadExecutor] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] operator[->] {
identifier[DaemonStarter] operator[SEP] identifier[getLifecycleListener] operator[SEP] operator[SEP] operator[SEP] identifier[stopping] operator[SEP] operator[SEP] operator[SEP] identifier[DaemonStarter] operator[SEP] identifier[daemon] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] identifier[cdl] operator[SEP] identifier[countDown] operator[SEP] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] Keyword[try] {
Keyword[int] identifier[timeout] operator[=] identifier[DaemonStarter] operator[SEP] identifier[lifecycleListener] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getShutdownTimeoutSeconds] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[cdl] operator[SEP] identifier[await] operator[SEP] identifier[timeout] , identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] operator[SEP] {
identifier[DaemonStarter] operator[SEP] identifier[rlog] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[DaemonStarter] operator[SEP] identifier[abortSystem] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] {
identifier[DaemonStarter] operator[SEP] identifier[rlog] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public final value_function_return value_function() throws RecognitionException {
value_function_return retval = new value_function_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
equality_value_function_return equality_value_function85 =null;
compariable_value_function_return compariable_value_function86 =null;
try {
// MessageFilter.g:169:2: ( equality_value_function | compariable_value_function )
int alt12=2;
int LA12_0 = input.LA(1);
if ( (LA12_0==FALSE||LA12_0==NULL||LA12_0==STRING||LA12_0==TRUE||LA12_0==XPATH_FUN_NAME) ) {
alt12=1;
}
else if ( (LA12_0==EOF||LA12_0==AND||LA12_0==NUMBER||LA12_0==OR||(LA12_0 >= TIME_MILLIS_FUN_NAME && LA12_0 <= TIME_STRING_FUN_NAME)||(LA12_0 >= 34 && LA12_0 <= 35)) ) {
alt12=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 12, 0, input);
throw nvae;
}
switch (alt12) {
case 1 :
// MessageFilter.g:169:4: equality_value_function
{
root_0 = (CommonTree)adaptor.nil();
pushFollow(FOLLOW_equality_value_function_in_value_function1022);
equality_value_function85=equality_value_function();
state._fsp--;
adaptor.addChild(root_0, equality_value_function85.getTree());
}
break;
case 2 :
// MessageFilter.g:169:30: compariable_value_function
{
root_0 = (CommonTree)adaptor.nil();
pushFollow(FOLLOW_compariable_value_function_in_value_function1026);
compariable_value_function86=compariable_value_function();
state._fsp--;
adaptor.addChild(root_0, compariable_value_function86.getTree());
}
break;
}
retval.stop = input.LT(-1);
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
} | class class_name[name] begin[{]
method[value_function, return_type[type[value_function_return]], modifier[final public], parameter[]] begin[{]
local_variable[type[value_function_return], retval]
assign[member[retval.start], call[input.LT, parameter[literal[1]]]]
local_variable[type[CommonTree], root_0]
local_variable[type[equality_value_function_return], equality_value_function85]
local_variable[type[compariable_value_function_return], compariable_value_function86]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt12)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA12_0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA12_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=FALSE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=LA12_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NULL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA12_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=STRING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA12_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TRUE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA12_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=XPATH_FUN_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA12_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=EOF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=LA12_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=AND, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA12_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NUMBER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA12_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=OR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA12_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TIME_MILLIS_FUN_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA12_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TIME_STRING_FUN_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA12_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=34), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA12_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=35), operator=<=), operator=&&), operator=||), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=input, 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=NoViableAltException, sub_type=None)), name=nvae)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NoViableAltException, sub_type=None)), ThrowStatement(expression=MemberReference(member=nvae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt12, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt12, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=nil, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_equality_value_function_in_value_function1022, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=equality_value_function85, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=equality_value_function, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getTree, postfix_operators=[], prefix_operators=[], qualifier=equality_value_function85, selectors=[], type_arguments=None)], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=nil, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_compariable_value_function_in_value_function1026, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=compariable_value_function86, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=compariable_value_function, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getTree, postfix_operators=[], prefix_operators=[], qualifier=compariable_value_function86, selectors=[], type_arguments=None)], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)]), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alt12, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rulePostProcessing, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[])], member=setTokenBoundaries, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=errorNode, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None)
return[member[.retval]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[value_function_return] identifier[value_function] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
identifier[value_function_return] identifier[retval] operator[=] Keyword[new] identifier[value_function_return] operator[SEP] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[start] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[CommonTree] identifier[root_0] operator[=] Other[null] operator[SEP] identifier[equality_value_function_return] identifier[equality_value_function85] operator[=] Other[null] operator[SEP] identifier[compariable_value_function_return] identifier[compariable_value_function86] operator[=] Other[null] operator[SEP] Keyword[try] {
Keyword[int] identifier[alt12] operator[=] Other[2] operator[SEP] Keyword[int] identifier[LA12_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LA12_0] operator[==] identifier[FALSE] operator[||] identifier[LA12_0] operator[==] identifier[NULL] operator[||] identifier[LA12_0] operator[==] identifier[STRING] operator[||] identifier[LA12_0] operator[==] identifier[TRUE] operator[||] identifier[LA12_0] operator[==] identifier[XPATH_FUN_NAME] operator[SEP] operator[SEP] {
identifier[alt12] operator[=] Other[1] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[LA12_0] operator[==] identifier[EOF] operator[||] identifier[LA12_0] operator[==] identifier[AND] operator[||] identifier[LA12_0] operator[==] identifier[NUMBER] operator[||] identifier[LA12_0] operator[==] identifier[OR] operator[||] operator[SEP] identifier[LA12_0] operator[>=] identifier[TIME_MILLIS_FUN_NAME] operator[&&] identifier[LA12_0] operator[<=] identifier[TIME_STRING_FUN_NAME] operator[SEP] operator[||] operator[SEP] identifier[LA12_0] operator[>=] Other[34] operator[&&] identifier[LA12_0] operator[<=] Other[35] operator[SEP] operator[SEP] operator[SEP] {
identifier[alt12] operator[=] Other[2] operator[SEP]
}
Keyword[else] {
identifier[NoViableAltException] identifier[nvae] operator[=] Keyword[new] identifier[NoViableAltException] operator[SEP] literal[String] , Other[12] , Other[0] , identifier[input] operator[SEP] operator[SEP] Keyword[throw] identifier[nvae] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[alt12] operator[SEP] {
Keyword[case] Other[1] operator[:] {
identifier[root_0] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] identifier[pushFollow] operator[SEP] identifier[FOLLOW_equality_value_function_in_value_function1022] operator[SEP] operator[SEP] identifier[equality_value_function85] operator[=] identifier[equality_value_function] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[equality_value_function85] operator[SEP] identifier[getTree] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] {
identifier[root_0] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] identifier[pushFollow] operator[SEP] identifier[FOLLOW_compariable_value_function_in_value_function1026] operator[SEP] operator[SEP] identifier[compariable_value_function86] operator[=] identifier[compariable_value_function] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[compariable_value_function86] operator[SEP] identifier[getTree] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP]
}
identifier[retval] operator[SEP] identifier[stop] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[tree] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[rulePostProcessing] operator[SEP] identifier[root_0] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[setTokenBoundaries] operator[SEP] identifier[retval] operator[SEP] identifier[tree] , identifier[retval] operator[SEP] identifier[start] , identifier[retval] operator[SEP] identifier[stop] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] {
identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[tree] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[errorNode] operator[SEP] identifier[input] , identifier[retval] operator[SEP] identifier[start] , identifier[input] operator[SEP] identifier[LT] operator[SEP] operator[-] Other[1] operator[SEP] , identifier[re] operator[SEP] operator[SEP]
}
Keyword[finally] {
}
Keyword[return] identifier[retval] operator[SEP]
}
|
public List<Resource> toList() {
List<Resource> resourceList = new ArrayList<>();
resourceList.add(this);
return resourceList;
} | class class_name[name] begin[{]
method[toList, return_type[type[List]], modifier[public], parameter[]] begin[{]
local_variable[type[List], resourceList]
call[resourceList.add, parameter[THIS[]]]
return[member[.resourceList]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[Resource] operator[>] identifier[toList] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[Resource] operator[>] identifier[resourceList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[resourceList] operator[SEP] identifier[add] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[return] identifier[resourceList] operator[SEP]
}
|
private Pattern findingDescription() {
String metaOrNarrativeOrLifecycleOrScenario = concatenateWithOr(keywords().meta(), keywords().narrative(), keywords().lifecycle(), keywords().scenario());
return compile("(.*?)(" + metaOrNarrativeOrLifecycleOrScenario + ").*", DOTALL);
} | class class_name[name] begin[{]
method[findingDescription, return_type[type[Pattern]], modifier[private], parameter[]] begin[{]
local_variable[type[String], metaOrNarrativeOrLifecycleOrScenario]
return[call[.compile, parameter[binary_operation[binary_operation[literal["(.*?)("], +, member[.metaOrNarrativeOrLifecycleOrScenario]], +, literal[").*"]], member[.DOTALL]]]]
end[}]
END[}] | Keyword[private] identifier[Pattern] identifier[findingDescription] operator[SEP] operator[SEP] {
identifier[String] identifier[metaOrNarrativeOrLifecycleOrScenario] operator[=] identifier[concatenateWithOr] operator[SEP] identifier[keywords] operator[SEP] operator[SEP] operator[SEP] identifier[meta] operator[SEP] operator[SEP] , identifier[keywords] operator[SEP] operator[SEP] operator[SEP] identifier[narrative] operator[SEP] operator[SEP] , identifier[keywords] operator[SEP] operator[SEP] operator[SEP] identifier[lifecycle] operator[SEP] operator[SEP] , identifier[keywords] operator[SEP] operator[SEP] operator[SEP] identifier[scenario] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[compile] operator[SEP] literal[String] operator[+] identifier[metaOrNarrativeOrLifecycleOrScenario] operator[+] literal[String] , identifier[DOTALL] operator[SEP] operator[SEP]
}
|
public final DisjointSubsumer getConclusion(
DisjointSubsumer.Factory factory) {
return factory.getDisjointSubsumer(getDestination(),
getDisjointExpressions(), getPosition());
} | class class_name[name] begin[{]
method[getConclusion, return_type[type[DisjointSubsumer]], modifier[final public], parameter[factory]] begin[{]
return[call[factory.getDisjointSubsumer, parameter[call[.getDestination, parameter[]], call[.getDisjointExpressions, parameter[]], call[.getPosition, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[DisjointSubsumer] identifier[getConclusion] operator[SEP] identifier[DisjointSubsumer] operator[SEP] identifier[Factory] identifier[factory] operator[SEP] {
Keyword[return] identifier[factory] operator[SEP] identifier[getDisjointSubsumer] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] , identifier[getDisjointExpressions] operator[SEP] operator[SEP] , identifier[getPosition] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void addFile(InputStream inputStream) {
String name = "file";
fileStreams.put(normalizeDuplicateName(name), inputStream);
} | class class_name[name] begin[{]
method[addFile, return_type[void], modifier[public], parameter[inputStream]] begin[{]
local_variable[type[String], name]
call[fileStreams.put, parameter[call[.normalizeDuplicateName, parameter[member[.name]]], member[.inputStream]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addFile] operator[SEP] identifier[InputStream] identifier[inputStream] operator[SEP] {
identifier[String] identifier[name] operator[=] literal[String] operator[SEP] identifier[fileStreams] operator[SEP] identifier[put] operator[SEP] identifier[normalizeDuplicateName] operator[SEP] identifier[name] operator[SEP] , identifier[inputStream] operator[SEP] operator[SEP]
}
|
public void setupFields()
{
FieldInfo field = null;
field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
field.setDataClass(Integer.class);
field.setHidden(true);
field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
field.setDataClass(Date.class);
field.setHidden(true);
field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
field.setDataClass(Boolean.class);
field.setHidden(true);
field = new FieldInfo(this, DESCRIPTION, 60, null, null);
field = new FieldInfo(this, SEQUENCE, 10, null, null);
field.setDataClass(Integer.class);
field = new FieldInfo(this, KIND, 10, null, null);
field = new FieldInfo(this, PART_TYPE, Constants.DEFAULT_FIELD_LENGTH, null, null);
field = new FieldInfo(this, JNLP_FILE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
field.setDataClass(Integer.class);
field = new FieldInfo(this, PATH, 128, null, null);
} | class class_name[name] begin[{]
method[setupFields, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[FieldInfo], field]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), 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=FieldInfo, sub_type=None))]
call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]]
call[field.setHidden, parameter[literal[true]]]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=LAST_CHANGED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), 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=FieldInfo, sub_type=None))]
call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]]
call[field.setHidden, parameter[literal[true]]]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=DELETED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FieldInfo, sub_type=None))]
call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))]]
call[field.setHidden, parameter[literal[true]]]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=DESCRIPTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=60), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), 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=FieldInfo, sub_type=None))]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SEQUENCE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), 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=FieldInfo, sub_type=None))]
call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=KIND, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), 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=FieldInfo, sub_type=None))]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=PART_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), 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=FieldInfo, sub_type=None))]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=JNLP_FILE_ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), 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=FieldInfo, sub_type=None))]
call[field.setDataClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=PATH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=128), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), 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=FieldInfo, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setupFields] operator[SEP] operator[SEP] {
identifier[FieldInfo] identifier[field] operator[=] Other[null] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[ID] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setHidden] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[LAST_CHANGED] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Date] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setHidden] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[DELETED] , Other[10] , Other[null] , Keyword[new] identifier[Boolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Boolean] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setHidden] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[DESCRIPTION] , Other[60] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[SEQUENCE] , Other[10] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[KIND] , Other[10] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[PART_TYPE] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[JNLP_FILE_ID] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setDataClass] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[FieldInfo] operator[SEP] Keyword[this] , identifier[PATH] , Other[128] , Other[null] , Other[null] operator[SEP] operator[SEP]
}
|
@Override
public void init(ServletConfig servletConfig) throws ServletException {
super.init(servletConfig);
Class<?> implBeanClass;
LibertyJaxWsImplementorInfo implInfo = null;
try {
implBeanClass = jaxWsModuleMetaData.getModuleInfo().getClassLoader().loadClass(endpointInfo.getImplBeanClassName());
implInfo = new LibertyJaxWsImplementorInfo(implBeanClass, endpointInfo, publisherContext);
} catch (ClassNotFoundException e) {
throw new ServletException(e);
}
Bus serverBus = jaxWsModuleMetaData.getServerMetaData().getServerBus();
JaxWsServiceFactoryBean serviceFactory = new LibertyJaxWsServiceFactoryBean(implInfo, publisherContext);
jaxWsServerFactory = new LibertyJaxWsServerFactoryBean(serviceFactory);
Invoker ejbMethodInvoker = new EJBMethodInvoker();
serviceFactory.setBus(serverBus);
serviceFactory.setInvoker(ejbMethodInvoker);
serviceFactory.setFeatures(jaxWsServerFactory.getFeatures());
serviceFactory.create();
jaxWsServerFactory.setBus(serverBus);
jaxWsServerFactory.setAddress(endpointInfo.getAddress(0));
jaxWsServerFactory.setStart(false);
jaxWsServerFactory.setServiceBean(implBeanClass);
jaxWsServerFactory.setInvoker(ejbMethodInvoker);
server = jaxWsServerFactory.create();
//Config the server side properties
configureEndpointInfoProperties(endpointInfo, server.getEndpoint().getEndpointInfo());
List<Interceptor<? extends Message>> inInterceptors = server.getEndpoint().getInInterceptors();
List<Interceptor<? extends Message>> outInterceptors = server.getEndpoint().getOutInterceptors();
//Initialize EJBMethodInvoker
J2EEName j2EEName = jaxWsModuleMetaData.getServerMetaData().getEndpointJ2EEName(endpointInfo.getPortLink());
if (implInfo.isWebServiceProvider()) {
//add ejb pre-invoke interceptor
EJBPreInvokeInterceptor ejbPreInvokeInterceptor = new EJBPreInvokeInterceptor(j2EEName, implBeanClass, ejbContainer, null);
ejbPreInvokeInterceptor.setEjbJaxWsWebEndpoint(this);
inInterceptors.add(ejbPreInvokeInterceptor);
outInterceptors.add(new EJBPostInvokeInterceptor());
} else {
Service service = serviceFactory.getService();
org.apache.cxf.service.model.EndpointInfo cxfEndpointInfo = service.getEndpointInfo(endpointInfo.getWsdlPort());
MethodDispatcher methodDispatcher = (MethodDispatcher) service.get(MethodDispatcher.class.getName());
List<Method> methods = new ArrayList<Method>(cxfEndpointInfo.getBinding().getOperations().size());
for (BindingOperationInfo bindingOperationInfo : cxfEndpointInfo.getBinding().getOperations()) {
Method method = methodDispatcher.getMethod(bindingOperationInfo);
if (method != null) {
methods.add(method);
} else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Unable to get method for binding operation info " + bindingOperationInfo.getName());
}
}
}
//add ejb pre-invoke interceptor
EJBPreInvokeInterceptor ejbPreInvokeInterceptor = new EJBPreInvokeInterceptor(j2EEName, implBeanClass, ejbContainer, methods);
ejbPreInvokeInterceptor.setEjbJaxWsWebEndpoint(this);
inInterceptors.add(ejbPreInvokeInterceptor);
outInterceptors.add(new EJBPostInvokeInterceptor());
}
// Delay the handler creation in EJBPreInvokeInterceptor, so not like POJOJaxWsWebEndpoint create handler here.
// Customize WSDL Get Interceptor.
customizeWSDLGetInterceptor(implBeanClass);
customizeLoggingInOutIntercetptor(endpointInfo);
server.start();
this.destination = (AbstractHTTPDestination) server.getDestination();
} | class class_name[name] begin[{]
method[init, return_type[void], modifier[public], parameter[servletConfig]] begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=servletConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
local_variable[type[Class], implBeanClass]
local_variable[type[LibertyJaxWsImplementorInfo], implInfo]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=implBeanClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getModuleInfo, postfix_operators=[], prefix_operators=[], qualifier=jaxWsModuleMetaData, selectors=[MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getImplBeanClassName, postfix_operators=[], prefix_operators=[], qualifier=endpointInfo, selectors=[], type_arguments=None)], member=loadClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=implInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=implBeanClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=endpointInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=publisherContext, 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=LibertyJaxWsImplementorInfo, sub_type=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=ServletException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None)
local_variable[type[Bus], serverBus]
local_variable[type[JaxWsServiceFactoryBean], serviceFactory]
assign[member[.jaxWsServerFactory], ClassCreator(arguments=[MemberReference(member=serviceFactory, 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=LibertyJaxWsServerFactoryBean, sub_type=None))]
local_variable[type[Invoker], ejbMethodInvoker]
call[serviceFactory.setBus, parameter[member[.serverBus]]]
call[serviceFactory.setInvoker, parameter[member[.ejbMethodInvoker]]]
call[serviceFactory.setFeatures, parameter[call[jaxWsServerFactory.getFeatures, parameter[]]]]
call[serviceFactory.create, parameter[]]
call[jaxWsServerFactory.setBus, parameter[member[.serverBus]]]
call[jaxWsServerFactory.setAddress, parameter[call[endpointInfo.getAddress, parameter[literal[0]]]]]
call[jaxWsServerFactory.setStart, parameter[literal[false]]]
call[jaxWsServerFactory.setServiceBean, parameter[member[.implBeanClass]]]
call[jaxWsServerFactory.setInvoker, parameter[member[.ejbMethodInvoker]]]
assign[member[.server], call[jaxWsServerFactory.create, parameter[]]]
call[.configureEndpointInfoProperties, parameter[member[.endpointInfo], call[server.getEndpoint, parameter[]]]]
local_variable[type[List], inInterceptors]
local_variable[type[List], outInterceptors]
local_variable[type[J2EEName], j2EEName]
if[call[implInfo.isWebServiceProvider, parameter[]]] begin[{]
local_variable[type[EJBPreInvokeInterceptor], ejbPreInvokeInterceptor]
call[ejbPreInvokeInterceptor.setEjbJaxWsWebEndpoint, parameter[THIS[]]]
call[inInterceptors.add, parameter[member[.ejbPreInvokeInterceptor]]]
call[outInterceptors.add, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EJBPostInvokeInterceptor, sub_type=None))]]
else begin[{]
local_variable[type[Service], service]
local_variable[type[org], cxfEndpointInfo]
local_variable[type[MethodDispatcher], methodDispatcher]
local_variable[type[List], methods]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=bindingOperationInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=methodDispatcher, selectors=[], type_arguments=None), name=method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to get method for binding operation info "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=bindingOperationInfo, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=methods, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getBinding, postfix_operators=[], prefix_operators=[], qualifier=cxfEndpointInfo, selectors=[MethodInvocation(arguments=[], member=getOperations, 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=bindingOperationInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BindingOperationInfo, sub_type=None))), label=None)
local_variable[type[EJBPreInvokeInterceptor], ejbPreInvokeInterceptor]
call[ejbPreInvokeInterceptor.setEjbJaxWsWebEndpoint, parameter[THIS[]]]
call[inInterceptors.add, parameter[member[.ejbPreInvokeInterceptor]]]
call[outInterceptors.add, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EJBPostInvokeInterceptor, sub_type=None))]]
end[}]
call[.customizeWSDLGetInterceptor, parameter[member[.implBeanClass]]]
call[.customizeLoggingInOutIntercetptor, parameter[member[.endpointInfo]]]
call[server.start, parameter[]]
assign[THIS[member[None.destination]], Cast(expression=MethodInvocation(arguments=[], member=getDestination, postfix_operators=[], prefix_operators=[], qualifier=server, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AbstractHTTPDestination, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[init] operator[SEP] identifier[ServletConfig] identifier[servletConfig] operator[SEP] Keyword[throws] identifier[ServletException] {
Keyword[super] operator[SEP] identifier[init] operator[SEP] identifier[servletConfig] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[implBeanClass] operator[SEP] identifier[LibertyJaxWsImplementorInfo] identifier[implInfo] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[implBeanClass] operator[=] identifier[jaxWsModuleMetaData] operator[SEP] identifier[getModuleInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[loadClass] operator[SEP] identifier[endpointInfo] operator[SEP] identifier[getImplBeanClassName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[implInfo] operator[=] Keyword[new] identifier[LibertyJaxWsImplementorInfo] operator[SEP] identifier[implBeanClass] , identifier[endpointInfo] , identifier[publisherContext] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ServletException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
identifier[Bus] identifier[serverBus] operator[=] identifier[jaxWsModuleMetaData] operator[SEP] identifier[getServerMetaData] operator[SEP] operator[SEP] operator[SEP] identifier[getServerBus] operator[SEP] operator[SEP] operator[SEP] identifier[JaxWsServiceFactoryBean] identifier[serviceFactory] operator[=] Keyword[new] identifier[LibertyJaxWsServiceFactoryBean] operator[SEP] identifier[implInfo] , identifier[publisherContext] operator[SEP] operator[SEP] identifier[jaxWsServerFactory] operator[=] Keyword[new] identifier[LibertyJaxWsServerFactoryBean] operator[SEP] identifier[serviceFactory] operator[SEP] operator[SEP] identifier[Invoker] identifier[ejbMethodInvoker] operator[=] Keyword[new] identifier[EJBMethodInvoker] operator[SEP] operator[SEP] operator[SEP] identifier[serviceFactory] operator[SEP] identifier[setBus] operator[SEP] identifier[serverBus] operator[SEP] operator[SEP] identifier[serviceFactory] operator[SEP] identifier[setInvoker] operator[SEP] identifier[ejbMethodInvoker] operator[SEP] operator[SEP] identifier[serviceFactory] operator[SEP] identifier[setFeatures] operator[SEP] identifier[jaxWsServerFactory] operator[SEP] identifier[getFeatures] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[serviceFactory] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[jaxWsServerFactory] operator[SEP] identifier[setBus] operator[SEP] identifier[serverBus] operator[SEP] operator[SEP] identifier[jaxWsServerFactory] operator[SEP] identifier[setAddress] operator[SEP] identifier[endpointInfo] operator[SEP] identifier[getAddress] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[jaxWsServerFactory] operator[SEP] identifier[setStart] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[jaxWsServerFactory] operator[SEP] identifier[setServiceBean] operator[SEP] identifier[implBeanClass] operator[SEP] operator[SEP] identifier[jaxWsServerFactory] operator[SEP] identifier[setInvoker] operator[SEP] identifier[ejbMethodInvoker] operator[SEP] operator[SEP] identifier[server] operator[=] identifier[jaxWsServerFactory] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[configureEndpointInfoProperties] operator[SEP] identifier[endpointInfo] , identifier[server] operator[SEP] identifier[getEndpoint] operator[SEP] operator[SEP] operator[SEP] identifier[getEndpointInfo] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Interceptor] operator[<] operator[?] Keyword[extends] identifier[Message] operator[>] operator[>] identifier[inInterceptors] operator[=] identifier[server] operator[SEP] identifier[getEndpoint] operator[SEP] operator[SEP] operator[SEP] identifier[getInInterceptors] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Interceptor] operator[<] operator[?] Keyword[extends] identifier[Message] operator[>] operator[>] identifier[outInterceptors] operator[=] identifier[server] operator[SEP] identifier[getEndpoint] operator[SEP] operator[SEP] operator[SEP] identifier[getOutInterceptors] operator[SEP] operator[SEP] operator[SEP] identifier[J2EEName] identifier[j2EEName] operator[=] identifier[jaxWsModuleMetaData] operator[SEP] identifier[getServerMetaData] operator[SEP] operator[SEP] operator[SEP] identifier[getEndpointJ2EEName] operator[SEP] identifier[endpointInfo] operator[SEP] identifier[getPortLink] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[implInfo] operator[SEP] identifier[isWebServiceProvider] operator[SEP] operator[SEP] operator[SEP] {
identifier[EJBPreInvokeInterceptor] identifier[ejbPreInvokeInterceptor] operator[=] Keyword[new] identifier[EJBPreInvokeInterceptor] operator[SEP] identifier[j2EEName] , identifier[implBeanClass] , identifier[ejbContainer] , Other[null] operator[SEP] operator[SEP] identifier[ejbPreInvokeInterceptor] operator[SEP] identifier[setEjbJaxWsWebEndpoint] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[inInterceptors] operator[SEP] identifier[add] operator[SEP] identifier[ejbPreInvokeInterceptor] operator[SEP] operator[SEP] identifier[outInterceptors] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[EJBPostInvokeInterceptor] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Service] identifier[service] operator[=] identifier[serviceFactory] operator[SEP] identifier[getService] operator[SEP] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[cxf] operator[SEP] identifier[service] operator[SEP] identifier[model] operator[SEP] identifier[EndpointInfo] identifier[cxfEndpointInfo] operator[=] identifier[service] operator[SEP] identifier[getEndpointInfo] operator[SEP] identifier[endpointInfo] operator[SEP] identifier[getWsdlPort] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[MethodDispatcher] identifier[methodDispatcher] operator[=] operator[SEP] identifier[MethodDispatcher] operator[SEP] identifier[service] operator[SEP] identifier[get] operator[SEP] identifier[MethodDispatcher] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Method] operator[>] identifier[methods] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Method] operator[>] operator[SEP] identifier[cxfEndpointInfo] operator[SEP] identifier[getBinding] operator[SEP] operator[SEP] operator[SEP] identifier[getOperations] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[BindingOperationInfo] identifier[bindingOperationInfo] operator[:] identifier[cxfEndpointInfo] operator[SEP] identifier[getBinding] operator[SEP] operator[SEP] operator[SEP] identifier[getOperations] operator[SEP] operator[SEP] operator[SEP] {
identifier[Method] identifier[method] operator[=] identifier[methodDispatcher] operator[SEP] identifier[getMethod] operator[SEP] identifier[bindingOperationInfo] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[method] operator[!=] Other[null] operator[SEP] {
identifier[methods] operator[SEP] identifier[add] operator[SEP] identifier[method] operator[SEP] operator[SEP]
}
Keyword[else] {
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[bindingOperationInfo] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
identifier[EJBPreInvokeInterceptor] identifier[ejbPreInvokeInterceptor] operator[=] Keyword[new] identifier[EJBPreInvokeInterceptor] operator[SEP] identifier[j2EEName] , identifier[implBeanClass] , identifier[ejbContainer] , identifier[methods] operator[SEP] operator[SEP] identifier[ejbPreInvokeInterceptor] operator[SEP] identifier[setEjbJaxWsWebEndpoint] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[inInterceptors] operator[SEP] identifier[add] operator[SEP] identifier[ejbPreInvokeInterceptor] operator[SEP] operator[SEP] identifier[outInterceptors] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[EJBPostInvokeInterceptor] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[customizeWSDLGetInterceptor] operator[SEP] identifier[implBeanClass] operator[SEP] operator[SEP] identifier[customizeLoggingInOutIntercetptor] operator[SEP] identifier[endpointInfo] operator[SEP] operator[SEP] identifier[server] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[destination] operator[=] operator[SEP] identifier[AbstractHTTPDestination] operator[SEP] identifier[server] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] operator[SEP]
}
|
public void getTrustroots(GSSCredential credential,
GetTrustrootsParams params)
throws MyProxyException {
if (params == null) {
throw new IllegalArgumentException("params == null");
}
if (credential == null) {
try {
credential = getAnonymousCredential();
} catch (GSSException e) {
throw new MyProxyException("Failed to create anonymous credentials", e);
}
}
Socket gsiSocket = null;
OutputStream out = null;
InputStream in = null;
String msg = params.makeRequest();
try {
gsiSocket = getSocket(credential);
if (credential.getName().isAnonymous()) {
this.context.requestAnonymity(true);
}
out = gsiSocket.getOutputStream();
in = gsiSocket.getInputStream();
if (!((GssSocket)gsiSocket).getContext().getConfState())
throw new Exception("Confidentiality requested but not available");
// send message
out.write(msg.getBytes());
out.flush();
if (logger.isDebugEnabled()) {
logger.debug("Req sent:" + params);
}
// get the response
handleReply(in, out, null, true);
} catch(Exception e) {
throw new MyProxyException("MyProxy get-trustroots failed.", e);
} finally {
// close socket
close(out, in, gsiSocket);
}
} | class class_name[name] begin[{]
method[getTrustroots, return_type[void], modifier[public], parameter[credential, params]] begin[{]
if[binary_operation[member[.params], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="params == 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[.credential], ==, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=credential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getAnonymousCredential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to create anonymous credentials"), 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=MyProxyException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['GSSException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
local_variable[type[Socket], gsiSocket]
local_variable[type[OutputStream], out]
local_variable[type[InputStream], in]
local_variable[type[String], msg]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=gsiSocket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=credential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSocket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=credential, selectors=[MethodInvocation(arguments=[], member=isAnonymous, 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=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=context, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=requestAnonymity, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getOutputStream, postfix_operators=[], prefix_operators=[], qualifier=gsiSocket, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=gsiSocket, selectors=[], type_arguments=None)), label=None), IfStatement(condition=Cast(expression=MemberReference(member=gsiSocket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=GssSocket, sub_type=None)), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Confidentiality requested but not available")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Req sent:"), operandr=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=handleReply, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MyProxy get-trustroots failed."), 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=MyProxyException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=gsiSocket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[getTrustroots] operator[SEP] identifier[GSSCredential] identifier[credential] , identifier[GetTrustrootsParams] identifier[params] operator[SEP] Keyword[throws] identifier[MyProxyException] {
Keyword[if] operator[SEP] identifier[params] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[credential] operator[==] Other[null] operator[SEP] {
Keyword[try] {
identifier[credential] operator[=] identifier[getAnonymousCredential] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[GSSException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[MyProxyException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
identifier[Socket] identifier[gsiSocket] operator[=] Other[null] operator[SEP] identifier[OutputStream] identifier[out] operator[=] Other[null] operator[SEP] identifier[InputStream] identifier[in] operator[=] Other[null] operator[SEP] identifier[String] identifier[msg] operator[=] identifier[params] operator[SEP] identifier[makeRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[gsiSocket] operator[=] identifier[getSocket] operator[SEP] identifier[credential] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[credential] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[isAnonymous] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[context] operator[SEP] identifier[requestAnonymity] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[out] operator[=] identifier[gsiSocket] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[in] operator[=] identifier[gsiSocket] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] operator[SEP] identifier[GssSocket] operator[SEP] identifier[gsiSocket] operator[SEP] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[getConfState] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[msg] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[params] operator[SEP] operator[SEP]
}
identifier[handleReply] operator[SEP] identifier[in] , identifier[out] , Other[null] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[MyProxyException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[close] operator[SEP] identifier[out] , identifier[in] , identifier[gsiSocket] operator[SEP] operator[SEP]
}
}
|
protected <R> R executeRequest(Request request, JavaType javaType)
{
long start = System.currentTimeMillis();
boolean error = true;
try
{
Response response = executeRequest(request);
R r = readResponse(response, javaType);
error = false;
return r;
}
finally
{
if(clientEventListener != null)
{
ClientEvent event = new ClientEvent(baseUrl,request.getEntityName(),request.getRequestMethod(),
System.currentTimeMillis() - start,error);
clientEventListener.handleEvent(event);
}
}
} | class class_name[name] begin[{]
method[executeRequest, return_type[type[R]], modifier[protected], parameter[request, javaType]] begin[{]
local_variable[type[long], start]
local_variable[type[boolean], error]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=executeRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=response)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Response, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=javaType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=r)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), ReturnStatement(expression=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=clientEventListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=baseUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getEntityName, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getRequestMethod, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), BinaryOperation(operandl=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operandr=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), MemberReference(member=error, 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=ClientEvent, sub_type=None)), name=event)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClientEvent, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleEvent, postfix_operators=[], prefix_operators=[], qualifier=clientEventListener, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None)
end[}]
END[}] | Keyword[protected] operator[<] identifier[R] operator[>] identifier[R] identifier[executeRequest] operator[SEP] identifier[Request] identifier[request] , identifier[JavaType] identifier[javaType] operator[SEP] {
Keyword[long] identifier[start] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[error] operator[=] literal[boolean] operator[SEP] Keyword[try] {
identifier[Response] identifier[response] operator[=] identifier[executeRequest] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[R] identifier[r] operator[=] identifier[readResponse] operator[SEP] identifier[response] , identifier[javaType] operator[SEP] operator[SEP] identifier[error] operator[=] literal[boolean] operator[SEP] Keyword[return] identifier[r] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[clientEventListener] operator[!=] Other[null] operator[SEP] {
identifier[ClientEvent] identifier[event] operator[=] Keyword[new] identifier[ClientEvent] operator[SEP] identifier[baseUrl] , identifier[request] operator[SEP] identifier[getEntityName] operator[SEP] operator[SEP] , identifier[request] operator[SEP] identifier[getRequestMethod] operator[SEP] operator[SEP] , identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[start] , identifier[error] operator[SEP] operator[SEP] identifier[clientEventListener] operator[SEP] identifier[handleEvent] operator[SEP] identifier[event] operator[SEP] operator[SEP]
}
}
}
|
public AccountHeaderBuilder withAccountHeader(@LayoutRes int resLayout) {
if (mActivity == null) {
throw new RuntimeException("please pass an activity first to use this call");
}
if (resLayout != -1) {
this.mAccountHeaderContainer = mActivity.getLayoutInflater().inflate(resLayout, null, false);
} else {
if (mCompactStyle) {
this.mAccountHeaderContainer = mActivity.getLayoutInflater().inflate(R.layout.material_drawer_compact_header, null, false);
} else {
this.mAccountHeaderContainer = mActivity.getLayoutInflater().inflate(R.layout.material_drawer_header, null, false);
}
}
return this;
} | class class_name[name] begin[{]
method[withAccountHeader, return_type[type[AccountHeaderBuilder]], modifier[public], parameter[resLayout]] begin[{]
if[binary_operation[member[.mActivity], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="please pass an activity first to use this call")], 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)
else begin[{]
None
end[}]
if[binary_operation[member[.resLayout], !=, literal[1]]] begin[{]
assign[THIS[member[None.mAccountHeaderContainer]], call[mActivity.getLayoutInflater, parameter[]]]
else begin[{]
if[member[.mCompactStyle]] begin[{]
assign[THIS[member[None.mAccountHeaderContainer]], call[mActivity.getLayoutInflater, parameter[]]]
else begin[{]
assign[THIS[member[None.mAccountHeaderContainer]], call[mActivity.getLayoutInflater, parameter[]]]
end[}]
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[AccountHeaderBuilder] identifier[withAccountHeader] operator[SEP] annotation[@] identifier[LayoutRes] Keyword[int] identifier[resLayout] operator[SEP] {
Keyword[if] operator[SEP] identifier[mActivity] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[resLayout] operator[!=] operator[-] Other[1] operator[SEP] {
Keyword[this] operator[SEP] identifier[mAccountHeaderContainer] operator[=] identifier[mActivity] operator[SEP] identifier[getLayoutInflater] operator[SEP] operator[SEP] operator[SEP] identifier[inflate] operator[SEP] identifier[resLayout] , Other[null] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[mCompactStyle] operator[SEP] {
Keyword[this] operator[SEP] identifier[mAccountHeaderContainer] operator[=] identifier[mActivity] operator[SEP] identifier[getLayoutInflater] operator[SEP] operator[SEP] operator[SEP] identifier[inflate] operator[SEP] identifier[R] operator[SEP] identifier[layout] operator[SEP] identifier[material_drawer_compact_header] , Other[null] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[mAccountHeaderContainer] operator[=] identifier[mActivity] operator[SEP] identifier[getLayoutInflater] operator[SEP] operator[SEP] operator[SEP] identifier[inflate] operator[SEP] identifier[R] operator[SEP] identifier[layout] operator[SEP] identifier[material_drawer_header] , Other[null] , literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public IfcFastenerTypeEnum createIfcFastenerTypeEnumFromString(EDataType eDataType, String initialValue) {
IfcFastenerTypeEnum result = IfcFastenerTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
} | class class_name[name] begin[{]
method[createIfcFastenerTypeEnumFromString, return_type[type[IfcFastenerTypeEnum]], modifier[public], parameter[eDataType, initialValue]] begin[{]
local_variable[type[IfcFastenerTypeEnum], result]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value '"), operandr=MemberReference(member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid enumerator of '"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=eDataType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[IfcFastenerTypeEnum] identifier[createIfcFastenerTypeEnumFromString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[String] identifier[initialValue] operator[SEP] {
identifier[IfcFastenerTypeEnum] identifier[result] operator[=] identifier[IfcFastenerTypeEnum] operator[SEP] identifier[get] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[initialValue] operator[+] literal[String] operator[+] identifier[eDataType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
static boolean nodeTypeMayHaveSideEffects(Node n, AbstractCompiler compiler) {
if (isAssignmentOp(n)) {
return true;
}
switch (n.getToken()) {
case DELPROP:
case DEC:
case INC:
case YIELD:
case THROW:
case AWAIT:
case FOR_IN: // assigns to a loop LHS
case FOR_OF: // assigns to a loop LHS, runs an iterator
case FOR_AWAIT_OF: // assigns to a loop LHS, runs an iterator, async operations.
return true;
case CALL:
case TAGGED_TEMPLATELIT:
return NodeUtil.functionCallHasSideEffects(n, compiler);
case NEW:
return NodeUtil.constructorCallHasSideEffects(n);
case NAME:
// A variable definition.
// TODO(b/129564961): Consider EXPORT declarations.
return n.hasChildren();
case REST:
case SPREAD:
return NodeUtil.iteratesImpureIterable(n);
default:
break;
}
return false;
} | class class_name[name] begin[{]
method[nodeTypeMayHaveSideEffects, return_type[type[boolean]], modifier[static], parameter[n, compiler]] begin[{]
if[call[.isAssignmentOp, parameter[member[.n]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
SwitchStatement(cases=[SwitchStatementCase(case=['DELPROP', 'DEC', 'INC', 'YIELD', 'THROW', 'AWAIT', 'FOR_IN', 'FOR_OF', 'FOR_AWAIT_OF'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]), SwitchStatementCase(case=['CALL', 'TAGGED_TEMPLATELIT'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=compiler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=functionCallHasSideEffects, postfix_operators=[], prefix_operators=[], qualifier=NodeUtil, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['NEW'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=constructorCallHasSideEffects, postfix_operators=[], prefix_operators=[], qualifier=NodeUtil, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['NAME'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=hasChildren, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['REST', 'SPREAD'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=iteratesImpureIterable, postfix_operators=[], prefix_operators=[], qualifier=NodeUtil, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[], member=getToken, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None), label=None)
return[literal[false]]
end[}]
END[}] | Keyword[static] Keyword[boolean] identifier[nodeTypeMayHaveSideEffects] operator[SEP] identifier[Node] identifier[n] , identifier[AbstractCompiler] identifier[compiler] operator[SEP] {
Keyword[if] operator[SEP] identifier[isAssignmentOp] operator[SEP] identifier[n] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[n] operator[SEP] identifier[getToken] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] identifier[DELPROP] operator[:] Keyword[case] identifier[DEC] operator[:] Keyword[case] identifier[INC] operator[:] Keyword[case] identifier[YIELD] operator[:] Keyword[case] identifier[THROW] operator[:] Keyword[case] identifier[AWAIT] operator[:] Keyword[case] identifier[FOR_IN] operator[:] Keyword[case] identifier[FOR_OF] operator[:] Keyword[case] identifier[FOR_AWAIT_OF] operator[:] Keyword[return] literal[boolean] operator[SEP] Keyword[case] identifier[CALL] operator[:] Keyword[case] identifier[TAGGED_TEMPLATELIT] operator[:] Keyword[return] identifier[NodeUtil] operator[SEP] identifier[functionCallHasSideEffects] operator[SEP] identifier[n] , identifier[compiler] operator[SEP] operator[SEP] Keyword[case] identifier[NEW] operator[:] Keyword[return] identifier[NodeUtil] operator[SEP] identifier[constructorCallHasSideEffects] operator[SEP] identifier[n] operator[SEP] operator[SEP] Keyword[case] identifier[NAME] operator[:] Keyword[return] identifier[n] operator[SEP] identifier[hasChildren] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[REST] operator[:] Keyword[case] identifier[SPREAD] operator[:] Keyword[return] identifier[NodeUtil] operator[SEP] identifier[iteratesImpureIterable] operator[SEP] identifier[n] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[break] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.