code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
---|---|---|
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
// Get the LabelService.
LabelServiceInterface labelService =
adManagerServices.get(session, LabelServiceInterface.class);
// Create a competitive exclusion label.
Label competitiveExclusionLabel = new Label();
competitiveExclusionLabel.setName(
"Car company label #" + new Random().nextInt(Integer.MAX_VALUE));
competitiveExclusionLabel.setTypes(new LabelType[] {LabelType.COMPETITIVE_EXCLUSION});
// Create an ad unit frequency cap label.
Label adUnitFrequencyCapLabel = new Label();
adUnitFrequencyCapLabel.setName(
"Don't run too often label #" + new Random().nextInt(Integer.MAX_VALUE));
adUnitFrequencyCapLabel.setTypes(new LabelType[] {LabelType.AD_UNIT_FREQUENCY_CAP});
// Create the labels on the server.
Label[] labels =
labelService.createLabels(new Label[] {competitiveExclusionLabel, adUnitFrequencyCapLabel});
for (Label createdLabel : labels) {
System.out.printf("A label with ID %d and name '%s' was created.%n",
createdLabel.getId(), createdLabel.getName());
}
} | class class_name[name] begin[{]
method[runExample, return_type[void], modifier[public static], parameter[adManagerServices, session]] begin[{]
local_variable[type[LabelServiceInterface], labelService]
local_variable[type[Label], competitiveExclusionLabel]
call[competitiveExclusionLabel.setName, parameter[binary_operation[literal["Car company label #"], +, ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[])], member=nextInt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Random, sub_type=None))]]]
call[competitiveExclusionLabel.setTypes, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=COMPETITIVE_EXCLUSION, postfix_operators=[], prefix_operators=[], qualifier=LabelType, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LabelType, sub_type=None))]]
local_variable[type[Label], adUnitFrequencyCapLabel]
call[adUnitFrequencyCapLabel.setName, parameter[binary_operation[literal["Don't run too often label #"], +, ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[])], member=nextInt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Random, sub_type=None))]]]
call[adUnitFrequencyCapLabel.setTypes, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=AD_UNIT_FREQUENCY_CAP, postfix_operators=[], prefix_operators=[], qualifier=LabelType, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LabelType, sub_type=None))]]
local_variable[type[Label], labels]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A label with ID %d and name '%s' was created.%n"), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=createdLabel, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=createdLabel, selectors=[], type_arguments=None)], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=labels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=createdLabel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Label, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[runExample] operator[SEP] identifier[AdManagerServices] identifier[adManagerServices] , identifier[AdManagerSession] identifier[session] operator[SEP] Keyword[throws] identifier[RemoteException] {
identifier[LabelServiceInterface] identifier[labelService] operator[=] identifier[adManagerServices] operator[SEP] identifier[get] operator[SEP] identifier[session] , identifier[LabelServiceInterface] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Label] identifier[competitiveExclusionLabel] operator[=] Keyword[new] identifier[Label] operator[SEP] operator[SEP] operator[SEP] identifier[competitiveExclusionLabel] operator[SEP] identifier[setName] operator[SEP] literal[String] operator[+] Keyword[new] identifier[Random] operator[SEP] operator[SEP] operator[SEP] identifier[nextInt] operator[SEP] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] operator[SEP] identifier[competitiveExclusionLabel] operator[SEP] identifier[setTypes] operator[SEP] Keyword[new] identifier[LabelType] operator[SEP] operator[SEP] {
identifier[LabelType] operator[SEP] identifier[COMPETITIVE_EXCLUSION]
} operator[SEP] operator[SEP] identifier[Label] identifier[adUnitFrequencyCapLabel] operator[=] Keyword[new] identifier[Label] operator[SEP] operator[SEP] operator[SEP] identifier[adUnitFrequencyCapLabel] operator[SEP] identifier[setName] operator[SEP] literal[String] operator[+] Keyword[new] identifier[Random] operator[SEP] operator[SEP] operator[SEP] identifier[nextInt] operator[SEP] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] operator[SEP] identifier[adUnitFrequencyCapLabel] operator[SEP] identifier[setTypes] operator[SEP] Keyword[new] identifier[LabelType] operator[SEP] operator[SEP] {
identifier[LabelType] operator[SEP] identifier[AD_UNIT_FREQUENCY_CAP]
} operator[SEP] operator[SEP] identifier[Label] operator[SEP] operator[SEP] identifier[labels] operator[=] identifier[labelService] operator[SEP] identifier[createLabels] operator[SEP] Keyword[new] identifier[Label] operator[SEP] operator[SEP] {
identifier[competitiveExclusionLabel] , identifier[adUnitFrequencyCapLabel]
} operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Label] identifier[createdLabel] operator[:] identifier[labels] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[createdLabel] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[createdLabel] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private void createPreparedStatement(final String name, final String query, final int timeout, final boolean recovering) throws NameAlreadyExistsException, DatabaseEngineException {
if (!recovering) {
if (stmts.containsKey(name)) {
throw new NameAlreadyExistsException(String.format("There's already a PreparedStatement with the name '%s'", name));
}
try {
getConnection();
} catch (final Exception e) {
throw new DatabaseEngineException("Could not create prepared statement", e);
}
}
PreparedStatement ps;
try {
ps = conn.prepareStatement(query);
if (timeout > 0) {
ps.setQueryTimeout(timeout);
}
stmts.put(name, new PreparedStatementCapsule(query, ps, timeout));
} catch (final SQLException e) {
throw new DatabaseEngineException("Could not create prepared statement", e);
}
} | class class_name[name] begin[{]
method[createPreparedStatement, return_type[void], modifier[private], parameter[name, query, timeout, recovering]] begin[{]
if[member[.recovering]] begin[{]
if[call[stmts.containsKey, parameter[member[.name]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="There's already a PreparedStatement with the name '%s'"), MemberReference(member=name, 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=NameAlreadyExistsException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getConnection, 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="Could not create prepared statement"), 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=DatabaseEngineException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
local_variable[type[PreparedStatement], ps]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=prepareStatement, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setQueryTimeout, postfix_operators=[], prefix_operators=[], qualifier=ps, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timeout, 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=PreparedStatementCapsule, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=stmts, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not create prepared statement"), 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=DatabaseEngineException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[createPreparedStatement] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[String] identifier[query] , Keyword[final] Keyword[int] identifier[timeout] , Keyword[final] Keyword[boolean] identifier[recovering] operator[SEP] Keyword[throws] identifier[NameAlreadyExistsException] , identifier[DatabaseEngineException] {
Keyword[if] operator[SEP] operator[!] identifier[recovering] operator[SEP] {
Keyword[if] operator[SEP] identifier[stmts] operator[SEP] identifier[containsKey] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NameAlreadyExistsException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[name] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[getConnection] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseEngineException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
identifier[PreparedStatement] identifier[ps] operator[SEP] Keyword[try] {
identifier[ps] operator[=] identifier[conn] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[query] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[timeout] operator[>] Other[0] operator[SEP] {
identifier[ps] operator[SEP] identifier[setQueryTimeout] operator[SEP] identifier[timeout] operator[SEP] operator[SEP]
}
identifier[stmts] operator[SEP] identifier[put] operator[SEP] identifier[name] , Keyword[new] identifier[PreparedStatementCapsule] operator[SEP] identifier[query] , identifier[ps] , identifier[timeout] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[SQLException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DatabaseEngineException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public static List<CommercePriceList> findByUuid_C(String uuid,
long companyId) {
return getPersistence().findByUuid_C(uuid, companyId);
} | class class_name[name] begin[{]
method[findByUuid_C, return_type[type[List]], modifier[public static], parameter[uuid, companyId]] begin[{]
return[call[.getPersistence, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[CommercePriceList] operator[>] identifier[findByUuid_C] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[companyId] operator[SEP] {
Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByUuid_C] operator[SEP] identifier[uuid] , identifier[companyId] operator[SEP] operator[SEP]
}
|
@RunAsSystem
public Group getGroup(String groupName) {
Fetch roleFetch = new Fetch().field(RoleMetadata.NAME).field(RoleMetadata.LABEL);
Fetch fetch =
new Fetch()
.field(GroupMetadata.ROLES, roleFetch)
.field(GroupMetadata.NAME)
.field(GroupMetadata.LABEL)
.field(GroupMetadata.DESCRIPTION)
.field(GroupMetadata.ID)
.field(GroupMetadata.PUBLIC)
.field(GroupMetadata.ROOT_PACKAGE);
Group group =
dataService
.query(GroupMetadata.GROUP, Group.class)
.eq(GroupMetadata.NAME, groupName)
.fetch(fetch)
.findOne();
if (group == null) {
throw new UnknownEntityException(
groupMetadata, groupMetadata.getAttribute(GroupMetadata.NAME), groupName);
}
return group;
} | class class_name[name] begin[{]
method[getGroup, return_type[type[Group]], modifier[public], parameter[groupName]] begin[{]
local_variable[type[Fetch], roleFetch]
local_variable[type[Fetch], fetch]
local_variable[type[Group], group]
if[binary_operation[member[.group], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=groupMetadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=GroupMetadata, selectors=[])], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=groupMetadata, selectors=[], type_arguments=None), MemberReference(member=groupName, 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=UnknownEntityException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.group]]
end[}]
END[}] | annotation[@] identifier[RunAsSystem] Keyword[public] identifier[Group] identifier[getGroup] operator[SEP] identifier[String] identifier[groupName] operator[SEP] {
identifier[Fetch] identifier[roleFetch] operator[=] Keyword[new] identifier[Fetch] operator[SEP] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[RoleMetadata] operator[SEP] identifier[NAME] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[RoleMetadata] operator[SEP] identifier[LABEL] operator[SEP] operator[SEP] identifier[Fetch] identifier[fetch] operator[=] Keyword[new] identifier[Fetch] operator[SEP] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[GroupMetadata] operator[SEP] identifier[ROLES] , identifier[roleFetch] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[GroupMetadata] operator[SEP] identifier[NAME] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[GroupMetadata] operator[SEP] identifier[LABEL] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[GroupMetadata] operator[SEP] identifier[DESCRIPTION] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[GroupMetadata] operator[SEP] identifier[ID] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[GroupMetadata] operator[SEP] identifier[PUBLIC] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[GroupMetadata] operator[SEP] identifier[ROOT_PACKAGE] operator[SEP] operator[SEP] identifier[Group] identifier[group] operator[=] identifier[dataService] operator[SEP] identifier[query] operator[SEP] identifier[GroupMetadata] operator[SEP] identifier[GROUP] , identifier[Group] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[eq] operator[SEP] identifier[GroupMetadata] operator[SEP] identifier[NAME] , identifier[groupName] operator[SEP] operator[SEP] identifier[fetch] operator[SEP] identifier[fetch] operator[SEP] operator[SEP] identifier[findOne] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[group] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UnknownEntityException] operator[SEP] identifier[groupMetadata] , identifier[groupMetadata] operator[SEP] identifier[getAttribute] operator[SEP] identifier[GroupMetadata] operator[SEP] identifier[NAME] operator[SEP] , identifier[groupName] operator[SEP] operator[SEP]
}
Keyword[return] identifier[group] operator[SEP]
}
|
public static boolean isOrSubtype(final Class<? extends Entity> descendant,
final Class<? extends Entity> ancestor) {
return ancestor.isAssignableFrom(descendant);
} | class class_name[name] begin[{]
method[isOrSubtype, return_type[type[boolean]], modifier[public static], parameter[descendant, ancestor]] begin[{]
return[call[ancestor.isAssignableFrom, parameter[member[.descendant]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isOrSubtype] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Entity] operator[>] identifier[descendant] , Keyword[final] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Entity] operator[>] identifier[ancestor] operator[SEP] {
Keyword[return] identifier[ancestor] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[descendant] operator[SEP] operator[SEP]
}
|
public static String getSerializedSchema(String gdatHeader) {
/*Format :
GDAT\nVERSION:4\nSCHEMALENGTH:123\n
FTA {\n
STREAM <name> {\n
<list of fields>\n
}\n
<query text>\n
}
*/
int startBracketIndex = gdatHeader.indexOf("{");
startBracketIndex = gdatHeader.indexOf("{", startBracketIndex + 1);
int endBracketIndex = gdatHeader.indexOf("}");
Preconditions.checkArgument(endBracketIndex > startBracketIndex);
return gdatHeader.substring(startBracketIndex + 1, endBracketIndex);
} | class class_name[name] begin[{]
method[getSerializedSchema, return_type[type[String]], modifier[public static], parameter[gdatHeader]] begin[{]
local_variable[type[int], startBracketIndex]
assign[member[.startBracketIndex], call[gdatHeader.indexOf, parameter[literal["{"], binary_operation[member[.startBracketIndex], +, literal[1]]]]]
local_variable[type[int], endBracketIndex]
call[Preconditions.checkArgument, parameter[binary_operation[member[.endBracketIndex], >, member[.startBracketIndex]]]]
return[call[gdatHeader.substring, parameter[binary_operation[member[.startBracketIndex], +, literal[1]], member[.endBracketIndex]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getSerializedSchema] operator[SEP] identifier[String] identifier[gdatHeader] operator[SEP] {
Keyword[int] identifier[startBracketIndex] operator[=] identifier[gdatHeader] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[startBracketIndex] operator[=] identifier[gdatHeader] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[startBracketIndex] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[endBracketIndex] operator[=] identifier[gdatHeader] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[endBracketIndex] operator[>] identifier[startBracketIndex] operator[SEP] operator[SEP] Keyword[return] identifier[gdatHeader] operator[SEP] identifier[substring] operator[SEP] identifier[startBracketIndex] operator[+] Other[1] , identifier[endBracketIndex] operator[SEP] operator[SEP]
}
|
public FetchRet fetch(String url, String bucket, String key) throws QiniuException {
String resource = UrlSafeBase64.encodeToString(url);
String to = encodedEntry(bucket, key);
String path = String.format("/fetch/%s/to/%s", resource, to);
Response res = ioPost(bucket, path);
if (!res.isOK()) {
throw new QiniuException(res);
}
FetchRet fetchRet = res.jsonToObject(FetchRet.class);
res.close();
return fetchRet;
} | class class_name[name] begin[{]
method[fetch, return_type[type[FetchRet]], modifier[public], parameter[url, bucket, key]] begin[{]
local_variable[type[String], resource]
local_variable[type[String], to]
local_variable[type[String], path]
local_variable[type[Response], res]
if[call[res.isOK, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=res, 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=QiniuException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[FetchRet], fetchRet]
call[res.close, parameter[]]
return[member[.fetchRet]]
end[}]
END[}] | Keyword[public] identifier[FetchRet] identifier[fetch] operator[SEP] identifier[String] identifier[url] , identifier[String] identifier[bucket] , identifier[String] identifier[key] operator[SEP] Keyword[throws] identifier[QiniuException] {
identifier[String] identifier[resource] operator[=] identifier[UrlSafeBase64] operator[SEP] identifier[encodeToString] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[String] identifier[to] operator[=] identifier[encodedEntry] operator[SEP] identifier[bucket] , identifier[key] operator[SEP] operator[SEP] identifier[String] identifier[path] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[resource] , identifier[to] operator[SEP] operator[SEP] identifier[Response] identifier[res] operator[=] identifier[ioPost] operator[SEP] identifier[bucket] , identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[res] operator[SEP] identifier[isOK] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[QiniuException] operator[SEP] identifier[res] operator[SEP] operator[SEP]
}
identifier[FetchRet] identifier[fetchRet] operator[=] identifier[res] operator[SEP] identifier[jsonToObject] operator[SEP] identifier[FetchRet] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[fetchRet] operator[SEP]
}
|
@CheckReturnValue
@NonNull
public final <R> ParallelFlowable<R> concatMap(
@NonNull Function<? super T, ? extends Publisher<? extends R>> mapper,
int prefetch) {
ObjectHelper.requireNonNull(mapper, "mapper is null");
ObjectHelper.verifyPositive(prefetch, "prefetch");
return RxJavaPlugins.onAssembly(new ParallelConcatMap<T, R>(this, mapper, prefetch, ErrorMode.IMMEDIATE));
} | class class_name[name] begin[{]
method[concatMap, return_type[type[ParallelFlowable]], modifier[final public], parameter[mapper, prefetch]] begin[{]
call[ObjectHelper.requireNonNull, parameter[member[.mapper], literal["mapper is null"]]]
call[ObjectHelper.verifyPositive, parameter[member[.prefetch], literal["prefetch"]]]
return[call[RxJavaPlugins.onAssembly, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=mapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prefetch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=IMMEDIATE, postfix_operators=[], prefix_operators=[], qualifier=ErrorMode, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))], dimensions=None, name=ParallelConcatMap, sub_type=None))]]]
end[}]
END[}] | annotation[@] identifier[CheckReturnValue] annotation[@] identifier[NonNull] Keyword[public] Keyword[final] operator[<] identifier[R] operator[>] identifier[ParallelFlowable] operator[<] identifier[R] operator[>] identifier[concatMap] operator[SEP] annotation[@] identifier[NonNull] identifier[Function] operator[<] operator[?] Keyword[super] identifier[T] , operator[?] Keyword[extends] identifier[Publisher] operator[<] operator[?] Keyword[extends] identifier[R] operator[>] operator[>] identifier[mapper] , Keyword[int] identifier[prefetch] operator[SEP] {
identifier[ObjectHelper] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[mapper] , literal[String] operator[SEP] operator[SEP] identifier[ObjectHelper] operator[SEP] identifier[verifyPositive] operator[SEP] identifier[prefetch] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[RxJavaPlugins] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[new] identifier[ParallelConcatMap] operator[<] identifier[T] , identifier[R] operator[>] operator[SEP] Keyword[this] , identifier[mapper] , identifier[prefetch] , identifier[ErrorMode] operator[SEP] identifier[IMMEDIATE] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String resolveFileName(final Part part) throws MessagingException {
if (!(part instanceof MimeBodyPart)) {
return part.getFileName();
}
final String contentType = part.getContentType();
String ret;
try {
ret = MimeUtility.decodeText(part.getFileName());
} catch (final Exception ex) {
// String[] contentId = part.getHeader("Content-ID");
// if (contentId != null && contentId.length > 0) {
final String contentId = ((MimeBodyPart) part).getContentID();
if (contentId != null) {
ret = contentId + contentTypeForFileName(contentType);
} else {
ret = defaultFileName(contentType);
}
}
return ret;
} | class class_name[name] begin[{]
method[resolveFileName, return_type[type[String]], modifier[public static], parameter[part]] begin[{]
if[binary_operation[member[.part], instanceof, type[MimeBodyPart]]] begin[{]
return[call[part.getFileName, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[String], contentType]
local_variable[type[String], ret]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFileName, postfix_operators=[], prefix_operators=[], qualifier=part, selectors=[], type_arguments=None)], member=decodeText, postfix_operators=[], prefix_operators=[], qualifier=MimeUtility, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=part, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MimeBodyPart, sub_type=None)), name=contentId)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=contentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=contentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=defaultFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=contentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=contentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contentTypeForFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None)
return[member[.ret]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[resolveFileName] operator[SEP] Keyword[final] identifier[Part] identifier[part] operator[SEP] Keyword[throws] identifier[MessagingException] {
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[part] Keyword[instanceof] identifier[MimeBodyPart] operator[SEP] operator[SEP] {
Keyword[return] identifier[part] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] identifier[String] identifier[contentType] operator[=] identifier[part] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[ret] operator[SEP] Keyword[try] {
identifier[ret] operator[=] identifier[MimeUtility] operator[SEP] identifier[decodeText] operator[SEP] identifier[part] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[ex] operator[SEP] {
Keyword[final] identifier[String] identifier[contentId] operator[=] operator[SEP] operator[SEP] identifier[MimeBodyPart] operator[SEP] identifier[part] operator[SEP] operator[SEP] identifier[getContentID] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[contentId] operator[!=] Other[null] operator[SEP] {
identifier[ret] operator[=] identifier[contentId] operator[+] identifier[contentTypeForFileName] operator[SEP] identifier[contentType] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[ret] operator[=] identifier[defaultFileName] operator[SEP] identifier[contentType] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[ret] operator[SEP]
}
|
private List<StatementGroup> copyStatementGroups(List<StatementGroup> statementGroups) {
if (filter.excludeAllProperties()) {
return Collections.emptyList();
}
List<StatementGroup> result = new ArrayList<>(statementGroups.size());
for (StatementGroup statementGroup : statementGroups) {
if (filter.includePropertyId(statementGroup.getProperty())) {
result.add(copy(statementGroup));
}
}
return result;
} | class class_name[name] begin[{]
method[copyStatementGroups, return_type[type[List]], modifier[private], parameter[statementGroups]] begin[{]
if[call[filter.excludeAllProperties, parameter[]]] begin[{]
return[call[Collections.emptyList, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[List], result]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=statementGroup, selectors=[], type_arguments=None)], member=includePropertyId, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=statementGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=statementGroups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=statementGroup)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StatementGroup, sub_type=None))), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[private] identifier[List] operator[<] identifier[StatementGroup] operator[>] identifier[copyStatementGroups] operator[SEP] identifier[List] operator[<] identifier[StatementGroup] operator[>] identifier[statementGroups] operator[SEP] {
Keyword[if] operator[SEP] identifier[filter] operator[SEP] identifier[excludeAllProperties] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[StatementGroup] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[statementGroups] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[StatementGroup] identifier[statementGroup] operator[:] identifier[statementGroups] operator[SEP] {
Keyword[if] operator[SEP] identifier[filter] operator[SEP] identifier[includePropertyId] operator[SEP] identifier[statementGroup] operator[SEP] identifier[getProperty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[copy] operator[SEP] identifier[statementGroup] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
@Override
public AddRoleToDBClusterResult addRoleToDBCluster(AddRoleToDBClusterRequest request) {
request = beforeClientExecution(request);
return executeAddRoleToDBCluster(request);
} | class class_name[name] begin[{]
method[addRoleToDBCluster, return_type[type[AddRoleToDBClusterResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeAddRoleToDBCluster, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[AddRoleToDBClusterResult] identifier[addRoleToDBCluster] operator[SEP] identifier[AddRoleToDBClusterRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeAddRoleToDBCluster] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public int getNumPoints() {
if (isEmpty()) {
return 0;
}
int total = 0;
for (Polygon polygon : polygons) {
total += polygon.getNumPoints();
}
return total;
} | class class_name[name] begin[{]
method[getNumPoints, return_type[type[int]], modifier[public], parameter[]] begin[{]
if[call[.isEmpty, parameter[]]] begin[{]
return[literal[0]]
else begin[{]
None
end[}]
local_variable[type[int], total]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getNumPoints, postfix_operators=[], prefix_operators=[], qualifier=polygon, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=polygons, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=polygon)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Polygon, sub_type=None))), label=None)
return[member[.total]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[getNumPoints] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[0] operator[SEP]
}
Keyword[int] identifier[total] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Polygon] identifier[polygon] operator[:] identifier[polygons] operator[SEP] {
identifier[total] operator[+=] identifier[polygon] operator[SEP] identifier[getNumPoints] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[total] operator[SEP]
}
|
public boolean getForecast(String LATITUDE, String LONGITUDE) {
try {
String reply = httpGET( urlBuilder(LATITUDE, LONGITUDE) );
if(reply == null)
return false;
this.forecast = Json.parse(reply).asObject();
//this.forecast = JsonObject.readFrom(reply);
} catch (NullPointerException e) {
System.err.println("Unable to connect to the API: "+e.getMessage());
return false;
}
return getForecast(this.forecast);
} | class class_name[name] begin[{]
method[getForecast, return_type[type[boolean]], modifier[public], parameter[LATITUDE, LONGITUDE]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=LATITUDE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=LONGITUDE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=urlBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=httpGET, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=reply)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=reply, 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=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=forecast, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[MemberReference(member=reply, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=Json, selectors=[MethodInvocation(arguments=[], member=asObject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to connect to the API: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NullPointerException']))], finally_block=None, label=None, resources=None)
return[call[.getForecast, parameter[THIS[member[None.forecast]]]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[getForecast] operator[SEP] identifier[String] identifier[LATITUDE] , identifier[String] identifier[LONGITUDE] operator[SEP] {
Keyword[try] {
identifier[String] identifier[reply] operator[=] identifier[httpGET] operator[SEP] identifier[urlBuilder] operator[SEP] identifier[LATITUDE] , identifier[LONGITUDE] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reply] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[this] operator[SEP] identifier[forecast] operator[=] identifier[Json] operator[SEP] identifier[parse] operator[SEP] identifier[reply] operator[SEP] operator[SEP] identifier[asObject] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NullPointerException] identifier[e] operator[SEP] {
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] identifier[getForecast] operator[SEP] Keyword[this] operator[SEP] identifier[forecast] operator[SEP] operator[SEP]
}
|
public java.util.Map<String, String> getMonday() {
if (monday == null) {
monday = new com.amazonaws.internal.SdkInternalMap<String, String>();
}
return monday;
} | class class_name[name] begin[{]
method[getMonday, return_type[type[java]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.monday], ==, literal[null]]] begin[{]
assign[member[.monday], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalMap, sub_type=None)))))]
else begin[{]
None
end[}]
return[member[.monday]]
end[}]
END[}] | Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[getMonday] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[monday] operator[==] Other[null] operator[SEP] {
identifier[monday] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[monday] operator[SEP]
}
|
public List<File> getOnApp(int appId, Integer limit, Integer offset) {
WebResource resource = getResourceFactory().getApiResource(
"/file/app/" + appId + "/");
if (limit != null) {
resource = resource.queryParam("limit", limit.toString());
}
if (offset != null) {
resource = resource.queryParam("offset", offset.toString());
}
return resource.get(new GenericType<List<File>>() {
});
} | class class_name[name] begin[{]
method[getOnApp, return_type[type[List]], modifier[public], parameter[appId, limit, offset]] begin[{]
local_variable[type[WebResource], resource]
if[binary_operation[member[.limit], !=, literal[null]]] begin[{]
assign[member[.resource], call[resource.queryParam, parameter[literal["limit"], call[limit.toString, parameter[]]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.offset], !=, literal[null]]] begin[{]
assign[member[.resource], call[resource.queryParam, parameter[literal["offset"], call[offset.toString, parameter[]]]]]
else begin[{]
None
end[}]
return[call[resource.get, parameter[ClassCreator(arguments=[], body=[], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=GenericType, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[File] operator[>] identifier[getOnApp] operator[SEP] Keyword[int] identifier[appId] , identifier[Integer] identifier[limit] , identifier[Integer] identifier[offset] operator[SEP] {
identifier[WebResource] identifier[resource] operator[=] identifier[getResourceFactory] operator[SEP] operator[SEP] operator[SEP] identifier[getApiResource] operator[SEP] literal[String] operator[+] identifier[appId] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[limit] operator[!=] Other[null] operator[SEP] {
identifier[resource] operator[=] identifier[resource] operator[SEP] identifier[queryParam] operator[SEP] literal[String] , identifier[limit] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[offset] operator[!=] Other[null] operator[SEP] {
identifier[resource] operator[=] identifier[resource] operator[SEP] identifier[queryParam] operator[SEP] literal[String] , identifier[offset] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[resource] operator[SEP] identifier[get] operator[SEP] Keyword[new] identifier[GenericType] operator[<] identifier[List] operator[<] identifier[File] operator[>] operator[>] operator[SEP] operator[SEP] {
} operator[SEP] operator[SEP]
}
|
public static CreateResult create(String accessToken, CashCard cashCard) {
Create<CashCard> card = new Create<CashCard>();
card.setCard(cashCard);
return create(accessToken, card);
} | class class_name[name] begin[{]
method[create, return_type[type[CreateResult]], modifier[public static], parameter[accessToken, cashCard]] begin[{]
local_variable[type[Create], card]
call[card.setCard, parameter[member[.cashCard]]]
return[call[.create, parameter[member[.accessToken], member[.card]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[CreateResult] identifier[create] operator[SEP] identifier[String] identifier[accessToken] , identifier[CashCard] identifier[cashCard] operator[SEP] {
identifier[Create] operator[<] identifier[CashCard] operator[>] identifier[card] operator[=] Keyword[new] identifier[Create] operator[<] identifier[CashCard] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[card] operator[SEP] identifier[setCard] operator[SEP] identifier[cashCard] operator[SEP] operator[SEP] Keyword[return] identifier[create] operator[SEP] identifier[accessToken] , identifier[card] operator[SEP] operator[SEP]
}
|
public EClass getIfcAddress() {
if (ifcAddressEClass == null) {
ifcAddressEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(6);
}
return ifcAddressEClass;
} | class class_name[name] begin[{]
method[getIfcAddress, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcAddressEClass], ==, literal[null]]] begin[{]
assign[member[.ifcAddressEClass], 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=6)], 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[.ifcAddressEClass]]
end[}]
END[}] | Keyword[public] identifier[EClass] identifier[getIfcAddress] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcAddressEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcAddressEClass] 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[6] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcAddressEClass] operator[SEP]
}
|
@SuppressWarnings("unchecked")
static Class<?> getParameterType(Object object, Class<?> expectedType) {
Collection<Class<?>> extendedAndImplementedTypes =
getExtendedAndImplementedTypes(object.getClass(), new LinkedList<Class<?>>());
for (Class<?> type : extendedAndImplementedTypes) {
Type[] implementedInterfaces = type.getGenericInterfaces();
for (Type implementedInterface : implementedInterfaces) {
if (implementedInterface instanceof ParameterizedType) {
ParameterizedType parameterizedCandidateType = (ParameterizedType) implementedInterface;
if (parameterizedCandidateType.getRawType().equals(expectedType)) {
Type[] typeArguments = parameterizedCandidateType.getActualTypeArguments();
Type typeArgument;
if (typeArguments.length == 0) {
typeArgument = Object.class;
} else {
typeArgument = parameterizedCandidateType.getActualTypeArguments()[0];
}
return (Class<?>) typeArgument;
}
}
}
}
// This may never happen in case the caller checked if object instanceof expectedType
throw new RuntimeException("Expected type " + expectedType +
" is not in class hierarchy of " + object.getClass());
} | class class_name[name] begin[{]
method[getParameterType, return_type[type[Class]], modifier[static], parameter[object, expectedType]] begin[{]
local_variable[type[Collection], extendedAndImplementedTypes]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getGenericInterfaces, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), name=implementedInterfaces)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Type, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=implementedInterface, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ParameterizedType, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=implementedInterface, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ParameterizedType, sub_type=None)), name=parameterizedCandidateType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ParameterizedType, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getRawType, postfix_operators=[], prefix_operators=[], qualifier=parameterizedCandidateType, selectors=[MethodInvocation(arguments=[MemberReference(member=expectedType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getActualTypeArguments, postfix_operators=[], prefix_operators=[], qualifier=parameterizedCandidateType, selectors=[], type_arguments=None), name=typeArguments)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Type, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=typeArgument)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=typeArguments, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=typeArgument, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getActualTypeArguments, postfix_operators=[], prefix_operators=[], qualifier=parameterizedCandidateType, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=typeArgument, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))), label=None)])), ReturnStatement(expression=Cast(expression=MemberReference(member=typeArgument, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=implementedInterfaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=implementedInterface)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=extendedAndImplementedTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None)
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected type "), operandr=MemberReference(member=expectedType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not in class hierarchy of "), operator=+), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[static] identifier[Class] operator[<] operator[?] operator[>] identifier[getParameterType] operator[SEP] identifier[Object] identifier[object] , identifier[Class] operator[<] operator[?] operator[>] identifier[expectedType] operator[SEP] {
identifier[Collection] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[extendedAndImplementedTypes] operator[=] identifier[getExtendedAndImplementedTypes] operator[SEP] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , Keyword[new] identifier[LinkedList] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[:] identifier[extendedAndImplementedTypes] operator[SEP] {
identifier[Type] operator[SEP] operator[SEP] identifier[implementedInterfaces] operator[=] identifier[type] operator[SEP] identifier[getGenericInterfaces] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Type] identifier[implementedInterface] operator[:] identifier[implementedInterfaces] operator[SEP] {
Keyword[if] operator[SEP] identifier[implementedInterface] Keyword[instanceof] identifier[ParameterizedType] operator[SEP] {
identifier[ParameterizedType] identifier[parameterizedCandidateType] operator[=] operator[SEP] identifier[ParameterizedType] operator[SEP] identifier[implementedInterface] operator[SEP] Keyword[if] operator[SEP] identifier[parameterizedCandidateType] operator[SEP] identifier[getRawType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[expectedType] operator[SEP] operator[SEP] {
identifier[Type] operator[SEP] operator[SEP] identifier[typeArguments] operator[=] identifier[parameterizedCandidateType] operator[SEP] identifier[getActualTypeArguments] operator[SEP] operator[SEP] operator[SEP] identifier[Type] identifier[typeArgument] operator[SEP] Keyword[if] operator[SEP] identifier[typeArguments] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
identifier[typeArgument] operator[=] identifier[Object] operator[SEP] Keyword[class] operator[SEP]
}
Keyword[else] {
identifier[typeArgument] operator[=] identifier[parameterizedCandidateType] operator[SEP] identifier[getActualTypeArguments] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[typeArgument] operator[SEP]
}
}
}
}
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[expectedType] operator[+] literal[String] operator[+] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public DayPartitionRule build() {
final Map<Weekday, List<ChronoInterval<PlainTime>>> wRules = new EnumMap<>(this.weekdayRules);
final Map<PlainDate, List<ChronoInterval<PlainTime>>> eRules = new HashMap<>(this.exceptionRules);
final Set<PlainDate> invalid = new HashSet<>(this.exclusions);
return new DayPartitionRule() {
@Override
public List<ChronoInterval<PlainTime>> getPartitions(PlainDate date) {
if (!this.isExcluded(date) && activeFilter.test(date)) {
List<ChronoInterval<PlainTime>> partitions = eRules.get(date);
if (partitions == null) {
partitions = wRules.get(date.getDayOfWeek());
}
if (partitions != null) {
return Collections.unmodifiableList(partitions);
}
}
return Collections.emptyList();
}
@Override
public boolean isExcluded(PlainDate date) {
return invalid.contains(date);
}
};
} | class class_name[name] begin[{]
method[build, return_type[type[DayPartitionRule]], modifier[public], parameter[]] begin[{]
local_variable[type[Map], wRules]
local_variable[type[Map], eRules]
local_variable[type[Set], invalid]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isExcluded, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=MethodInvocation(arguments=[MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=test, postfix_operators=[], prefix_operators=[], qualifier=activeFilter, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=eRules, selectors=[], type_arguments=None), name=partitions)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PlainTime, sub_type=None))], dimensions=[], name=ChronoInterval, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=partitions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=partitions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDayOfWeek, postfix_operators=[], prefix_operators=[], qualifier=date, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=wRules, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=partitions, 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=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=partitions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unmodifiableList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), label=None)]))])), ReturnStatement(expression=MethodInvocation(arguments=[], member=emptyList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=getPartitions, parameters=[FormalParameter(annotations=[], modifiers=set(), name=date, type=ReferenceType(arguments=None, dimensions=[], name=PlainDate, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PlainTime, sub_type=None))], dimensions=[], name=ChronoInterval, sub_type=None))], dimensions=[], name=List, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=invalid, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=isExcluded, parameters=[FormalParameter(annotations=[], modifiers=set(), name=date, type=ReferenceType(arguments=None, dimensions=[], name=PlainDate, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DayPartitionRule, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[DayPartitionRule] identifier[build] operator[SEP] operator[SEP] {
Keyword[final] identifier[Map] operator[<] identifier[Weekday] , identifier[List] operator[<] identifier[ChronoInterval] operator[<] identifier[PlainTime] operator[>] operator[>] operator[>] identifier[wRules] operator[=] Keyword[new] identifier[EnumMap] operator[<] operator[>] operator[SEP] Keyword[this] operator[SEP] identifier[weekdayRules] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[PlainDate] , identifier[List] operator[<] identifier[ChronoInterval] operator[<] identifier[PlainTime] operator[>] operator[>] operator[>] identifier[eRules] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] Keyword[this] operator[SEP] identifier[exceptionRules] operator[SEP] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[PlainDate] operator[>] identifier[invalid] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] Keyword[this] operator[SEP] identifier[exclusions] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[DayPartitionRule] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[ChronoInterval] operator[<] identifier[PlainTime] operator[>] operator[>] identifier[getPartitions] operator[SEP] identifier[PlainDate] identifier[date] operator[SEP] {
Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[isExcluded] operator[SEP] identifier[date] operator[SEP] operator[&&] identifier[activeFilter] operator[SEP] identifier[test] operator[SEP] identifier[date] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[ChronoInterval] operator[<] identifier[PlainTime] operator[>] operator[>] identifier[partitions] operator[=] identifier[eRules] operator[SEP] identifier[get] operator[SEP] identifier[date] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[partitions] operator[==] Other[null] operator[SEP] {
identifier[partitions] operator[=] identifier[wRules] operator[SEP] identifier[get] operator[SEP] identifier[date] operator[SEP] identifier[getDayOfWeek] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[partitions] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableList] operator[SEP] identifier[partitions] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isExcluded] operator[SEP] identifier[PlainDate] identifier[date] operator[SEP] {
Keyword[return] identifier[invalid] operator[SEP] identifier[contains] operator[SEP] identifier[date] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
public DescribeSpotPriceHistoryResult withSpotPriceHistory(SpotPrice... spotPriceHistory) {
if (this.spotPriceHistory == null) {
setSpotPriceHistory(new com.amazonaws.internal.SdkInternalList<SpotPrice>(spotPriceHistory.length));
}
for (SpotPrice ele : spotPriceHistory) {
this.spotPriceHistory.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withSpotPriceHistory, return_type[type[DescribeSpotPriceHistoryResult]], modifier[public], parameter[spotPriceHistory]] begin[{]
if[binary_operation[THIS[member[None.spotPriceHistory]], ==, literal[null]]] begin[{]
call[.setSpotPriceHistory, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=spotPriceHistory, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SpotPrice, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=spotPriceHistory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=spotPriceHistory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SpotPrice, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[DescribeSpotPriceHistoryResult] identifier[withSpotPriceHistory] operator[SEP] identifier[SpotPrice] operator[...] identifier[spotPriceHistory] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[spotPriceHistory] operator[==] Other[null] operator[SEP] {
identifier[setSpotPriceHistory] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[SpotPrice] operator[>] operator[SEP] identifier[spotPriceHistory] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[SpotPrice] identifier[ele] operator[:] identifier[spotPriceHistory] operator[SEP] {
Keyword[this] operator[SEP] identifier[spotPriceHistory] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
Expression genCodeForParamAccess(String paramName, VarDefn varDefn) {
Expression source = OPT_DATA;
if (varDefn.isInjected()) {
// Special case for csp_nonce. It is created by the compiler itself, and users should not need
// to set it. So, instead of generating opt_ij_data.csp_nonce, we generate opt_ij_data &&
// opt_ij_data.csp_nonce.
// TODO(lukes): we only need to generate this logic if there aren't any other ij params
if (paramName.equals(CSP_NONCE_VARIABLE_NAME)) {
return OPT_IJ_DATA.and(OPT_IJ_DATA.dotAccess(paramName), codeGenerator);
}
source = OPT_IJ_DATA;
} else if (varDefn.kind() == VarDefn.Kind.STATE) {
return genCodeForStateAccess(paramName, (TemplateStateVar) varDefn);
}
return source.dotAccess(paramName);
} | class class_name[name] begin[{]
method[genCodeForParamAccess, return_type[type[Expression]], modifier[default], parameter[paramName, varDefn]] begin[{]
local_variable[type[Expression], source]
if[call[varDefn.isInjected, parameter[]]] begin[{]
if[call[paramName.equals, parameter[member[.CSP_NONCE_VARIABLE_NAME]]]] begin[{]
return[call[OPT_IJ_DATA.and, parameter[call[OPT_IJ_DATA.dotAccess, parameter[member[.paramName]]], member[.codeGenerator]]]]
else begin[{]
None
end[}]
assign[member[.source], member[.OPT_IJ_DATA]]
else begin[{]
if[binary_operation[call[varDefn.kind, parameter[]], ==, member[VarDefn.Kind.STATE]]] begin[{]
return[call[.genCodeForStateAccess, parameter[member[.paramName], Cast(expression=MemberReference(member=varDefn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TemplateStateVar, sub_type=None))]]]
else begin[{]
None
end[}]
end[}]
return[call[source.dotAccess, parameter[member[.paramName]]]]
end[}]
END[}] | identifier[Expression] identifier[genCodeForParamAccess] operator[SEP] identifier[String] identifier[paramName] , identifier[VarDefn] identifier[varDefn] operator[SEP] {
identifier[Expression] identifier[source] operator[=] identifier[OPT_DATA] operator[SEP] Keyword[if] operator[SEP] identifier[varDefn] operator[SEP] identifier[isInjected] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[paramName] operator[SEP] identifier[equals] operator[SEP] identifier[CSP_NONCE_VARIABLE_NAME] operator[SEP] operator[SEP] {
Keyword[return] identifier[OPT_IJ_DATA] operator[SEP] identifier[and] operator[SEP] identifier[OPT_IJ_DATA] operator[SEP] identifier[dotAccess] operator[SEP] identifier[paramName] operator[SEP] , identifier[codeGenerator] operator[SEP] operator[SEP]
}
identifier[source] operator[=] identifier[OPT_IJ_DATA] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[varDefn] operator[SEP] identifier[kind] operator[SEP] operator[SEP] operator[==] identifier[VarDefn] operator[SEP] identifier[Kind] operator[SEP] identifier[STATE] operator[SEP] {
Keyword[return] identifier[genCodeForStateAccess] operator[SEP] identifier[paramName] , operator[SEP] identifier[TemplateStateVar] operator[SEP] identifier[varDefn] operator[SEP] operator[SEP]
}
Keyword[return] identifier[source] operator[SEP] identifier[dotAccess] operator[SEP] identifier[paramName] operator[SEP] operator[SEP]
}
|
private static boolean checkAlreadyCompactedBasedOnCompletionFile(FileSystem fs, Dataset dataset) {
Path filePath = new Path(dataset.outputPath(), MRCompactor.COMPACTION_COMPLETE_FILE_NAME);
try {
return fs.exists(filePath);
} catch (IOException e) {
LOG.error("Failed to verify the existence of file " + filePath, e);
return false;
}
} | class class_name[name] begin[{]
method[checkAlreadyCompactedBasedOnCompletionFile, return_type[type[boolean]], modifier[private static], parameter[fs, dataset]] begin[{]
local_variable[type[Path], filePath]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=filePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exists, postfix_operators=[], prefix_operators=[], qualifier=fs, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to verify the existence of file "), operandr=MemberReference(member=filePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[boolean] identifier[checkAlreadyCompactedBasedOnCompletionFile] operator[SEP] identifier[FileSystem] identifier[fs] , identifier[Dataset] identifier[dataset] operator[SEP] {
identifier[Path] identifier[filePath] operator[=] Keyword[new] identifier[Path] operator[SEP] identifier[dataset] operator[SEP] identifier[outputPath] operator[SEP] operator[SEP] , identifier[MRCompactor] operator[SEP] identifier[COMPACTION_COMPLETE_FILE_NAME] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] identifier[fs] operator[SEP] identifier[exists] operator[SEP] identifier[filePath] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[filePath] , identifier[e] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
}
|
@SuppressWarnings("unchecked")
public ManagedUser getManagedUser(final String username) {
final Query query = pm.newQuery(ManagedUser.class, "username == :username");
final List<ManagedUser> result = (List<ManagedUser>) query.execute(username);
return Collections.isEmpty(result) ? null : result.get(0);
} | class class_name[name] begin[{]
method[getManagedUser, return_type[type[ManagedUser]], modifier[public], parameter[username]] begin[{]
local_variable[type[Query], query]
local_variable[type[List], result]
return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[ManagedUser] identifier[getManagedUser] operator[SEP] Keyword[final] identifier[String] identifier[username] operator[SEP] {
Keyword[final] identifier[Query] identifier[query] operator[=] identifier[pm] operator[SEP] identifier[newQuery] operator[SEP] identifier[ManagedUser] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[ManagedUser] operator[>] identifier[result] operator[=] operator[SEP] identifier[List] operator[<] identifier[ManagedUser] operator[>] operator[SEP] identifier[query] operator[SEP] identifier[execute] operator[SEP] identifier[username] operator[SEP] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[isEmpty] operator[SEP] identifier[result] operator[SEP] operator[?] Other[null] operator[:] identifier[result] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
|
public Object remove(int index) {
if (index < 0 || index >= values.size()) {
return null;
}
return values.remove(index);
} | class class_name[name] begin[{]
method[remove, return_type[type[Object]], modifier[public], parameter[index]] begin[{]
if[binary_operation[binary_operation[member[.index], <, literal[0]], ||, binary_operation[member[.index], >=, call[values.size, parameter[]]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[call[values.remove, parameter[member[.index]]]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[remove] operator[SEP] Keyword[int] identifier[index] operator[SEP] {
Keyword[if] operator[SEP] identifier[index] operator[<] Other[0] operator[||] identifier[index] operator[>=] identifier[values] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[return] identifier[values] operator[SEP] identifier[remove] operator[SEP] identifier[index] operator[SEP] operator[SEP]
}
|
public static synchronized CarbonManager getInstanceFor(XMPPConnection connection) {
CarbonManager carbonManager = INSTANCES.get(connection);
if (carbonManager == null) {
carbonManager = new CarbonManager(connection);
INSTANCES.put(connection, carbonManager);
}
return carbonManager;
} | class class_name[name] begin[{]
method[getInstanceFor, return_type[type[CarbonManager]], modifier[synchronized public static], parameter[connection]] begin[{]
local_variable[type[CarbonManager], carbonManager]
if[binary_operation[member[.carbonManager], ==, literal[null]]] begin[{]
assign[member[.carbonManager], ClassCreator(arguments=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CarbonManager, sub_type=None))]
call[INSTANCES.put, parameter[member[.connection], member[.carbonManager]]]
else begin[{]
None
end[}]
return[member[.carbonManager]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[synchronized] identifier[CarbonManager] identifier[getInstanceFor] operator[SEP] identifier[XMPPConnection] identifier[connection] operator[SEP] {
identifier[CarbonManager] identifier[carbonManager] operator[=] identifier[INSTANCES] operator[SEP] identifier[get] operator[SEP] identifier[connection] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[carbonManager] operator[==] Other[null] operator[SEP] {
identifier[carbonManager] operator[=] Keyword[new] identifier[CarbonManager] operator[SEP] identifier[connection] operator[SEP] operator[SEP] identifier[INSTANCES] operator[SEP] identifier[put] operator[SEP] identifier[connection] , identifier[carbonManager] operator[SEP] operator[SEP]
}
Keyword[return] identifier[carbonManager] operator[SEP]
}
|
public PagedResult<Sight> listSights(PaginationParameters paging, Date modifiedSince) throws SmartsheetException {
String path = "sights";
HashMap<String, Object> parameters = new HashMap<String, Object>();
if (paging != null) {
parameters = paging.toHashMap();
}
if (modifiedSince != null) {
String isoDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(modifiedSince);
parameters.put("modifiedSince", isoDate);
}
path += QueryUtil.generateUrl(null, parameters);
return this.listResourcesWithWrapper(path, Sight.class);
} | class class_name[name] begin[{]
method[listSights, return_type[type[PagedResult]], modifier[public], parameter[paging, modifiedSince]] begin[{]
local_variable[type[String], path]
local_variable[type[HashMap], parameters]
if[binary_operation[member[.paging], !=, literal[null]]] begin[{]
assign[member[.parameters], call[paging.toHashMap, parameter[]]]
else begin[{]
None
end[}]
if[binary_operation[member[.modifiedSince], !=, literal[null]]] begin[{]
local_variable[type[String], isoDate]
call[parameters.put, parameter[literal["modifiedSince"], member[.isoDate]]]
else begin[{]
None
end[}]
assign[member[.path], call[QueryUtil.generateUrl, parameter[literal[null], member[.parameters]]]]
return[THIS[call[None.listResourcesWithWrapper, parameter[member[.path], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Sight, sub_type=None))]]]]
end[}]
END[}] | Keyword[public] identifier[PagedResult] operator[<] identifier[Sight] operator[>] identifier[listSights] operator[SEP] identifier[PaginationParameters] identifier[paging] , identifier[Date] identifier[modifiedSince] operator[SEP] Keyword[throws] identifier[SmartsheetException] {
identifier[String] identifier[path] operator[=] literal[String] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[parameters] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[paging] operator[!=] Other[null] operator[SEP] {
identifier[parameters] operator[=] identifier[paging] operator[SEP] identifier[toHashMap] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[modifiedSince] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[isoDate] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[format] operator[SEP] identifier[modifiedSince] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[isoDate] operator[SEP] operator[SEP]
}
identifier[path] operator[+=] identifier[QueryUtil] operator[SEP] identifier[generateUrl] operator[SEP] Other[null] , identifier[parameters] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[listResourcesWithWrapper] operator[SEP] identifier[path] , identifier[Sight] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
public double doubleValue(){
if(intCompact != INFLATED) {
if (scale == 0) {
return (double)intCompact;
} else {
/*
* If both intCompact and the scale can be exactly
* represented as double values, perform a single
* double multiply or divide to compute the (properly
* rounded) result.
*/
if (Math.abs(intCompact) < 1L<<52 ) {
// Don't have too guard against
// Math.abs(MIN_VALUE) because of outer check
// against INFLATED.
if (scale > 0 && scale < double10pow.length) {
return (double)intCompact / double10pow[scale];
} else if (scale < 0 && scale > -double10pow.length) {
return (double)intCompact * double10pow[-scale];
}
}
}
}
// Somewhat inefficient, but guaranteed to work.
return Double.parseDouble(this.toString());
} | class class_name[name] begin[{]
method[doubleValue, return_type[type[double]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.intCompact], !=, member[.INFLATED]]] begin[{]
if[binary_operation[member[.scale], ==, literal[0]]] begin[{]
return[Cast(expression=MemberReference(member=intCompact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double))]
else begin[{]
if[binary_operation[call[Math.abs, parameter[member[.intCompact]]], <, binary_operation[literal[1L], <<, literal[52]]]] begin[{]
if[binary_operation[binary_operation[member[.scale], >, literal[0]], &&, binary_operation[member[.scale], <, member[double10pow.length]]]] begin[{]
return[binary_operation[Cast(expression=MemberReference(member=intCompact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double)), /, member[.double10pow]]]
else begin[{]
if[binary_operation[binary_operation[member[.scale], <, literal[0]], &&, binary_operation[member[.scale], >, member[double10pow.length]]]] begin[{]
return[binary_operation[Cast(expression=MemberReference(member=intCompact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double)), *, member[.double10pow]]]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
return[call[Double.parseDouble, parameter[THIS[call[None.toString, parameter[]]]]]]
end[}]
END[}] | Keyword[public] Keyword[double] identifier[doubleValue] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[intCompact] operator[!=] identifier[INFLATED] operator[SEP] {
Keyword[if] operator[SEP] identifier[scale] operator[==] Other[0] operator[SEP] {
Keyword[return] operator[SEP] Keyword[double] operator[SEP] identifier[intCompact] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[intCompact] operator[SEP] operator[<] Other[1L] operator[<<] Other[52] operator[SEP] {
Keyword[if] operator[SEP] identifier[scale] operator[>] Other[0] operator[&&] identifier[scale] operator[<] identifier[double10pow] operator[SEP] identifier[length] operator[SEP] {
Keyword[return] operator[SEP] Keyword[double] operator[SEP] identifier[intCompact] operator[/] identifier[double10pow] operator[SEP] identifier[scale] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[scale] operator[<] Other[0] operator[&&] identifier[scale] operator[>] operator[-] identifier[double10pow] operator[SEP] identifier[length] operator[SEP] {
Keyword[return] operator[SEP] Keyword[double] operator[SEP] identifier[intCompact] operator[*] identifier[double10pow] operator[SEP] operator[-] identifier[scale] operator[SEP] operator[SEP]
}
}
}
}
Keyword[return] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] Keyword[this] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private void createReflections(String[] scanPackages) {
if (scanPackages.length < 1) {
LOGGER.warn("No package defined in configuration (scanPackages)!");
return;
}
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
FilterBuilder filterBuilder = new FilterBuilder();
for (String packageName : scanPackages) {
configurationBuilder.addUrls(ClasspathHelper.forPackage(packageName));
filterBuilder.include(FilterBuilder.prefix(packageName));
}
configurationBuilder.filterInputsBy(filterBuilder).setScanners(new SubTypesScanner(), new TypeAnnotationsScanner());
this.reflections = new Reflections(configurationBuilder);
} | class class_name[name] begin[{]
method[createReflections, return_type[void], modifier[private], parameter[scanPackages]] begin[{]
if[binary_operation[member[scanPackages.length], <, literal[1]]] begin[{]
call[LOGGER.warn, parameter[literal["No package defined in configuration (scanPackages)!"]]]
return[None]
else begin[{]
None
end[}]
local_variable[type[ConfigurationBuilder], configurationBuilder]
local_variable[type[FilterBuilder], filterBuilder]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forPackage, postfix_operators=[], prefix_operators=[], qualifier=ClasspathHelper, selectors=[], type_arguments=None)], member=addUrls, postfix_operators=[], prefix_operators=[], qualifier=configurationBuilder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=prefix, postfix_operators=[], prefix_operators=[], qualifier=FilterBuilder, selectors=[], type_arguments=None)], member=include, postfix_operators=[], prefix_operators=[], qualifier=filterBuilder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=scanPackages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=packageName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
call[configurationBuilder.filterInputsBy, parameter[member[.filterBuilder]]]
assign[THIS[member[None.reflections]], ClassCreator(arguments=[MemberReference(member=configurationBuilder, 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=Reflections, sub_type=None))]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[createReflections] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[scanPackages] operator[SEP] {
Keyword[if] operator[SEP] identifier[scanPackages] operator[SEP] identifier[length] operator[<] Other[1] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[ConfigurationBuilder] identifier[configurationBuilder] operator[=] Keyword[new] identifier[ConfigurationBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[FilterBuilder] identifier[filterBuilder] operator[=] Keyword[new] identifier[FilterBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[packageName] operator[:] identifier[scanPackages] operator[SEP] {
identifier[configurationBuilder] operator[SEP] identifier[addUrls] operator[SEP] identifier[ClasspathHelper] operator[SEP] identifier[forPackage] operator[SEP] identifier[packageName] operator[SEP] operator[SEP] operator[SEP] identifier[filterBuilder] operator[SEP] identifier[include] operator[SEP] identifier[FilterBuilder] operator[SEP] identifier[prefix] operator[SEP] identifier[packageName] operator[SEP] operator[SEP] operator[SEP]
}
identifier[configurationBuilder] operator[SEP] identifier[filterInputsBy] operator[SEP] identifier[filterBuilder] operator[SEP] operator[SEP] identifier[setScanners] operator[SEP] Keyword[new] identifier[SubTypesScanner] operator[SEP] operator[SEP] , Keyword[new] identifier[TypeAnnotationsScanner] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[reflections] operator[=] Keyword[new] identifier[Reflections] operator[SEP] identifier[configurationBuilder] operator[SEP] operator[SEP]
}
|
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
LocaleContextHolder.setLocale(request.getLocale());
response = new OutputAwareHttpServletResponse(response);
boolean isIncludeOrForward = WebUtils.isForwardOrInclude(request);
GrailsWebRequest previous = isIncludeOrForward ? GrailsWebRequest.lookup(request) : null;
GrailsWebRequest webRequest = new GrailsWebRequest(request, response, getServletContext());
configureParameterCreationListeners(webRequest);
if (logger.isDebugEnabled()) {
logger.debug("Bound Grails request context to thread: " + request);
}
try {
WebUtils.storeGrailsWebRequest(webRequest);
if(!isIncludeOrForward) {
// Set the flash scope instance to its next state. We do
// this here so that the flash is available from Grails
// filters in a valid state.
FlashScope fs = webRequest.getAttributes().getFlashScope(request);
fs.next();
}
// Pass control on to the next filter (or the servlet if
// there are no more filters in the chain).
filterChain.doFilter(request, response);
}
finally {
webRequest.requestCompleted();
if(isIncludeOrForward) {
if(previous != null) {
WebUtils.storeGrailsWebRequest(previous);
}
}
else {
WebUtils.clearGrailsWebRequest();
LocaleContextHolder.setLocale(null);
}
if (logger.isDebugEnabled()) {
logger.debug("Cleared Grails thread-bound request context: " + request);
}
}
} | class class_name[name] begin[{]
method[doFilterInternal, return_type[void], modifier[protected], parameter[request, response, filterChain]] begin[{]
call[LocaleContextHolder.setLocale, parameter[call[request.getLocale, parameter[]]]]
assign[member[.response], ClassCreator(arguments=[MemberReference(member=response, 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=OutputAwareHttpServletResponse, sub_type=None))]
local_variable[type[boolean], isIncludeOrForward]
local_variable[type[GrailsWebRequest], previous]
local_variable[type[GrailsWebRequest], webRequest]
call[.configureParameterCreationListeners, parameter[member[.webRequest]]]
if[call[logger.isDebugEnabled, parameter[]]] begin[{]
call[logger.debug, parameter[binary_operation[literal["Bound Grails request context to thread: "], +, member[.request]]]]
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=webRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=storeGrailsWebRequest, postfix_operators=[], prefix_operators=[], qualifier=WebUtils, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=isIncludeOrForward, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=webRequest, selectors=[MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFlashScope, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=fs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FlashScope, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=fs, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doFilter, postfix_operators=[], prefix_operators=[], qualifier=filterChain, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=requestCompleted, postfix_operators=[], prefix_operators=[], qualifier=webRequest, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=isIncludeOrForward, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=clearGrailsWebRequest, postfix_operators=[], prefix_operators=[], qualifier=WebUtils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setLocale, postfix_operators=[], prefix_operators=[], qualifier=LocaleContextHolder, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=previous, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=previous, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=storeGrailsWebRequest, postfix_operators=[], prefix_operators=[], qualifier=WebUtils, 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="Cleared Grails thread-bound request context: "), operandr=MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[doFilterInternal] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[HttpServletResponse] identifier[response] , identifier[FilterChain] identifier[filterChain] operator[SEP] Keyword[throws] identifier[ServletException] , identifier[IOException] {
identifier[LocaleContextHolder] operator[SEP] identifier[setLocale] operator[SEP] identifier[request] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[=] Keyword[new] identifier[OutputAwareHttpServletResponse] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[boolean] identifier[isIncludeOrForward] operator[=] identifier[WebUtils] operator[SEP] identifier[isForwardOrInclude] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[GrailsWebRequest] identifier[previous] operator[=] identifier[isIncludeOrForward] operator[?] identifier[GrailsWebRequest] operator[SEP] identifier[lookup] operator[SEP] identifier[request] operator[SEP] operator[:] Other[null] operator[SEP] identifier[GrailsWebRequest] identifier[webRequest] operator[=] Keyword[new] identifier[GrailsWebRequest] operator[SEP] identifier[request] , identifier[response] , identifier[getServletContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[configureParameterCreationListeners] operator[SEP] identifier[webRequest] 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[request] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[WebUtils] operator[SEP] identifier[storeGrailsWebRequest] operator[SEP] identifier[webRequest] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isIncludeOrForward] operator[SEP] {
identifier[FlashScope] identifier[fs] operator[=] identifier[webRequest] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[getFlashScope] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[fs] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP]
}
identifier[filterChain] operator[SEP] identifier[doFilter] operator[SEP] identifier[request] , identifier[response] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[webRequest] operator[SEP] identifier[requestCompleted] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isIncludeOrForward] operator[SEP] {
Keyword[if] operator[SEP] identifier[previous] operator[!=] Other[null] operator[SEP] {
identifier[WebUtils] operator[SEP] identifier[storeGrailsWebRequest] operator[SEP] identifier[previous] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[WebUtils] operator[SEP] identifier[clearGrailsWebRequest] operator[SEP] operator[SEP] operator[SEP] identifier[LocaleContextHolder] operator[SEP] identifier[setLocale] operator[SEP] Other[null] 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[request] operator[SEP] operator[SEP]
}
}
}
|
public String mandatoryParam(String key) {
String value = param(key);
checkArgument(value != null && !value.isEmpty(), format(MSG_PARAMETER_MISSING, key));
return value;
} | class class_name[name] begin[{]
method[mandatoryParam, return_type[type[String]], modifier[public], parameter[key]] begin[{]
local_variable[type[String], value]
call[.checkArgument, parameter[binary_operation[binary_operation[member[.value], !=, literal[null]], &&, call[value.isEmpty, parameter[]]], call[.format, parameter[member[.MSG_PARAMETER_MISSING], member[.key]]]]]
return[member[.value]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[mandatoryParam] operator[SEP] identifier[String] identifier[key] operator[SEP] {
identifier[String] identifier[value] operator[=] identifier[param] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] identifier[value] operator[!=] Other[null] operator[&&] operator[!] identifier[value] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] , identifier[format] operator[SEP] identifier[MSG_PARAMETER_MISSING] , identifier[key] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[SEP]
}
|
public void marshall(ListVoiceConnectorTerminationCredentialsRequest listVoiceConnectorTerminationCredentialsRequest, ProtocolMarshaller protocolMarshaller) {
if (listVoiceConnectorTerminationCredentialsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listVoiceConnectorTerminationCredentialsRequest.getVoiceConnectorId(), VOICECONNECTORID_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[listVoiceConnectorTerminationCredentialsRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.listVoiceConnectorTerminationCredentialsRequest], ==, 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=getVoiceConnectorId, postfix_operators=[], prefix_operators=[], qualifier=listVoiceConnectorTerminationCredentialsRequest, selectors=[], type_arguments=None), MemberReference(member=VOICECONNECTORID_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[ListVoiceConnectorTerminationCredentialsRequest] identifier[listVoiceConnectorTerminationCredentialsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[listVoiceConnectorTerminationCredentialsRequest] 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[listVoiceConnectorTerminationCredentialsRequest] operator[SEP] identifier[getVoiceConnectorId] operator[SEP] operator[SEP] , identifier[VOICECONNECTORID_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 String toCamelUpperCase(String inputParam) {
if(inputParam == null)
{
return null;
}
if(inputParam.isEmpty())
{
return EMPTY;
}
char[] original = inputParam.toCharArray();
StringBuilder titleCase =
new StringBuilder(Character.toString(
Character.toLowerCase(original[0])));
boolean nextTitleCase = false;
for(int index = 1;index < original.length;index++)
{
char c = original[index];
if (Character.isSpaceChar(c)) {
nextTitleCase = true;
continue;
}
//Just add...
else if (nextTitleCase) {
c = Character.toTitleCase(c);
nextTitleCase = false;
}
titleCase.append(c);
}
return titleCase.toString();
} | class class_name[name] begin[{]
method[toCamelUpperCase, return_type[type[String]], modifier[public], parameter[inputParam]] begin[{]
if[binary_operation[member[.inputParam], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[call[inputParam.isEmpty, parameter[]]] begin[{]
return[member[.EMPTY]]
else begin[{]
None
end[}]
local_variable[type[char], original]
local_variable[type[StringBuilder], titleCase]
local_variable[type[boolean], nextTitleCase]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=original, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isSpaceChar, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MemberReference(member=nextTitleCase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toTitleCase, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nextTitleCase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nextTitleCase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=titleCase, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=original, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[call[titleCase.toString, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[toCamelUpperCase] operator[SEP] identifier[String] identifier[inputParam] operator[SEP] {
Keyword[if] operator[SEP] identifier[inputParam] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[inputParam] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[EMPTY] operator[SEP]
}
Keyword[char] operator[SEP] operator[SEP] identifier[original] operator[=] identifier[inputParam] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[titleCase] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[Character] operator[SEP] identifier[toString] operator[SEP] identifier[Character] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[original] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[nextTitleCase] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[index] operator[=] Other[1] operator[SEP] identifier[index] operator[<] identifier[original] operator[SEP] identifier[length] operator[SEP] identifier[index] operator[++] operator[SEP] {
Keyword[char] identifier[c] operator[=] identifier[original] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isSpaceChar] operator[SEP] identifier[c] operator[SEP] operator[SEP] {
identifier[nextTitleCase] operator[=] literal[boolean] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[nextTitleCase] operator[SEP] {
identifier[c] operator[=] identifier[Character] operator[SEP] identifier[toTitleCase] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[nextTitleCase] operator[=] literal[boolean] operator[SEP]
}
identifier[titleCase] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
Keyword[return] identifier[titleCase] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String toColorWithAlpha(String red, String green,
String blue, String alpha) {
validateHexSingle(red);
validateHexSingle(green);
validateHexSingle(blue);
StringBuilder color = new StringBuilder("#");
if (alpha != null) {
color.append(expandShorthandHexSingle(alpha));
}
color.append(expandShorthandHexSingle(red));
color.append(expandShorthandHexSingle(green));
color.append(expandShorthandHexSingle(blue));
return color.toString();
} | class class_name[name] begin[{]
method[toColorWithAlpha, return_type[type[String]], modifier[public static], parameter[red, green, blue, alpha]] begin[{]
call[.validateHexSingle, parameter[member[.red]]]
call[.validateHexSingle, parameter[member[.green]]]
call[.validateHexSingle, parameter[member[.blue]]]
local_variable[type[StringBuilder], color]
if[binary_operation[member[.alpha], !=, literal[null]]] begin[{]
call[color.append, parameter[call[.expandShorthandHexSingle, parameter[member[.alpha]]]]]
else begin[{]
None
end[}]
call[color.append, parameter[call[.expandShorthandHexSingle, parameter[member[.red]]]]]
call[color.append, parameter[call[.expandShorthandHexSingle, parameter[member[.green]]]]]
call[color.append, parameter[call[.expandShorthandHexSingle, parameter[member[.blue]]]]]
return[call[color.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[toColorWithAlpha] operator[SEP] identifier[String] identifier[red] , identifier[String] identifier[green] , identifier[String] identifier[blue] , identifier[String] identifier[alpha] operator[SEP] {
identifier[validateHexSingle] operator[SEP] identifier[red] operator[SEP] operator[SEP] identifier[validateHexSingle] operator[SEP] identifier[green] operator[SEP] operator[SEP] identifier[validateHexSingle] operator[SEP] identifier[blue] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[color] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[alpha] operator[!=] Other[null] operator[SEP] {
identifier[color] operator[SEP] identifier[append] operator[SEP] identifier[expandShorthandHexSingle] operator[SEP] identifier[alpha] operator[SEP] operator[SEP] operator[SEP]
}
identifier[color] operator[SEP] identifier[append] operator[SEP] identifier[expandShorthandHexSingle] operator[SEP] identifier[red] operator[SEP] operator[SEP] operator[SEP] identifier[color] operator[SEP] identifier[append] operator[SEP] identifier[expandShorthandHexSingle] operator[SEP] identifier[green] operator[SEP] operator[SEP] operator[SEP] identifier[color] operator[SEP] identifier[append] operator[SEP] identifier[expandShorthandHexSingle] operator[SEP] identifier[blue] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[color] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public Dataset createDataset(String datasetName) {
// [START bigquery_create_dataset]
Dataset dataset = null;
DatasetInfo datasetInfo = DatasetInfo.newBuilder(datasetName).build();
try {
// the dataset was created
dataset = bigquery.create(datasetInfo);
} catch (BigQueryException e) {
// the dataset was not created
}
// [END bigquery_create_dataset]
return dataset;
} | class class_name[name] begin[{]
method[createDataset, return_type[type[Dataset]], modifier[public], parameter[datasetName]] begin[{]
local_variable[type[Dataset], dataset]
local_variable[type[DatasetInfo], datasetInfo]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dataset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=datasetInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=bigquery, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['BigQueryException']))], finally_block=None, label=None, resources=None)
return[member[.dataset]]
end[}]
END[}] | Keyword[public] identifier[Dataset] identifier[createDataset] operator[SEP] identifier[String] identifier[datasetName] operator[SEP] {
identifier[Dataset] identifier[dataset] operator[=] Other[null] operator[SEP] identifier[DatasetInfo] identifier[datasetInfo] operator[=] identifier[DatasetInfo] operator[SEP] identifier[newBuilder] operator[SEP] identifier[datasetName] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[dataset] operator[=] identifier[bigquery] operator[SEP] identifier[create] operator[SEP] identifier[datasetInfo] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[BigQueryException] identifier[e] operator[SEP] {
}
Keyword[return] identifier[dataset] operator[SEP]
}
|
boolean addNode(Block b, DatanodeDescriptor node, int replication) {
// insert into the map if not there yet
BlockInfo info = checkBlockInfo(b, replication);
// add block to the data-node list and the node to the block info
return node.addBlock(info);
} | class class_name[name] begin[{]
method[addNode, return_type[type[boolean]], modifier[default], parameter[b, node, replication]] begin[{]
local_variable[type[BlockInfo], info]
return[call[node.addBlock, parameter[member[.info]]]]
end[}]
END[}] | Keyword[boolean] identifier[addNode] operator[SEP] identifier[Block] identifier[b] , identifier[DatanodeDescriptor] identifier[node] , Keyword[int] identifier[replication] operator[SEP] {
identifier[BlockInfo] identifier[info] operator[=] identifier[checkBlockInfo] operator[SEP] identifier[b] , identifier[replication] operator[SEP] operator[SEP] Keyword[return] identifier[node] operator[SEP] identifier[addBlock] operator[SEP] identifier[info] operator[SEP] operator[SEP]
}
|
public Double isValidSum(IMolecularFormula formula) {
double result = 1.0;
IMolecularFormula formulaWith = isValid(formula);
Map<Object, Object> properties = formulaWith.getProperties();
Iterator<IRule> iterRules = rules.iterator();
while (iterRules.hasNext()) {
result *= (Double) properties.get(iterRules.next().getClass());
}
return result;
} | class class_name[name] begin[{]
method[isValidSum, return_type[type[Double]], modifier[public], parameter[formula]] begin[{]
local_variable[type[double], result]
local_variable[type[IMolecularFormula], formulaWith]
local_variable[type[Map], properties]
local_variable[type[Iterator], iterRules]
while[call[iterRules.hasNext, parameter[]]] begin[{]
assign[member[.result], Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterRules, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None))]
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[Double] identifier[isValidSum] operator[SEP] identifier[IMolecularFormula] identifier[formula] operator[SEP] {
Keyword[double] identifier[result] operator[=] literal[Float] operator[SEP] identifier[IMolecularFormula] identifier[formulaWith] operator[=] identifier[isValid] operator[SEP] identifier[formula] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[properties] operator[=] identifier[formulaWith] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[IRule] operator[>] identifier[iterRules] operator[=] identifier[rules] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterRules] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[result] operator[*=] operator[SEP] identifier[Double] operator[SEP] identifier[properties] operator[SEP] identifier[get] operator[SEP] identifier[iterRules] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
private String promptForText(ConsoleWrapper stdin, PrintStream stdout,
String enterText, String reenterText,
String readError, String entriesDidNotMatch) {
String read1 = stdin.readMaskedText(getMessage(enterText) + " ");
String read2 = stdin.readMaskedText(getMessage(reenterText) + " ");
if (read1 == null && read2 == null) {
throw new IllegalArgumentException("Unable to read either entry. Aborting prompt.");
} else if (read1 == null || read2 == null) {
stdout.println(getMessage(readError));
return promptForText(stdin, stdout, enterText, reenterText, readError, entriesDidNotMatch);
} else if (read1.equals(read2)) {
return read1;
} else {
stdout.println(getMessage(entriesDidNotMatch));
return promptForText(stdin, stdout, enterText, reenterText, readError, entriesDidNotMatch);
}
} | class class_name[name] begin[{]
method[promptForText, return_type[type[String]], modifier[private], parameter[stdin, stdout, enterText, reenterText, readError, entriesDidNotMatch]] begin[{]
local_variable[type[String], read1]
local_variable[type[String], read2]
if[binary_operation[binary_operation[member[.read1], ==, literal[null]], &&, binary_operation[member[.read2], ==, literal[null]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to read either entry. Aborting prompt.")], 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[{]
if[binary_operation[binary_operation[member[.read1], ==, literal[null]], ||, binary_operation[member[.read2], ==, literal[null]]]] begin[{]
call[stdout.println, parameter[call[.getMessage, parameter[member[.readError]]]]]
return[call[.promptForText, parameter[member[.stdin], member[.stdout], member[.enterText], member[.reenterText], member[.readError], member[.entriesDidNotMatch]]]]
else begin[{]
if[call[read1.equals, parameter[member[.read2]]]] begin[{]
return[member[.read1]]
else begin[{]
call[stdout.println, parameter[call[.getMessage, parameter[member[.entriesDidNotMatch]]]]]
return[call[.promptForText, parameter[member[.stdin], member[.stdout], member[.enterText], member[.reenterText], member[.readError], member[.entriesDidNotMatch]]]]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[private] identifier[String] identifier[promptForText] operator[SEP] identifier[ConsoleWrapper] identifier[stdin] , identifier[PrintStream] identifier[stdout] , identifier[String] identifier[enterText] , identifier[String] identifier[reenterText] , identifier[String] identifier[readError] , identifier[String] identifier[entriesDidNotMatch] operator[SEP] {
identifier[String] identifier[read1] operator[=] identifier[stdin] operator[SEP] identifier[readMaskedText] operator[SEP] identifier[getMessage] operator[SEP] identifier[enterText] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[read2] operator[=] identifier[stdin] operator[SEP] identifier[readMaskedText] operator[SEP] identifier[getMessage] operator[SEP] identifier[reenterText] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[read1] operator[==] Other[null] operator[&&] identifier[read2] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[read1] operator[==] Other[null] operator[||] identifier[read2] operator[==] Other[null] operator[SEP] {
identifier[stdout] operator[SEP] identifier[println] operator[SEP] identifier[getMessage] operator[SEP] identifier[readError] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[promptForText] operator[SEP] identifier[stdin] , identifier[stdout] , identifier[enterText] , identifier[reenterText] , identifier[readError] , identifier[entriesDidNotMatch] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[read1] operator[SEP] identifier[equals] operator[SEP] identifier[read2] operator[SEP] operator[SEP] {
Keyword[return] identifier[read1] operator[SEP]
}
Keyword[else] {
identifier[stdout] operator[SEP] identifier[println] operator[SEP] identifier[getMessage] operator[SEP] identifier[entriesDidNotMatch] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[promptForText] operator[SEP] identifier[stdin] , identifier[stdout] , identifier[enterText] , identifier[reenterText] , identifier[readError] , identifier[entriesDidNotMatch] operator[SEP] operator[SEP]
}
}
|
public String convertIfcStackTerminalTypeEnumToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
} | class class_name[name] begin[{]
method[convertIfcStackTerminalTypeEnumToString, return_type[type[String]], modifier[public], parameter[eDataType, instanceValue]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=instanceValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=instanceValue, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
end[}]
END[}] | Keyword[public] identifier[String] identifier[convertIfcStackTerminalTypeEnumToString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[Object] identifier[instanceValue] operator[SEP] {
Keyword[return] identifier[instanceValue] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[instanceValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public ServiceFuture<FrontendIPConfigurationInner> getAsync(String resourceGroupName, String loadBalancerName, String frontendIPConfigurationName, final ServiceCallback<FrontendIPConfigurationInner> serviceCallback) {
return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, frontendIPConfigurationName), serviceCallback);
} | class class_name[name] begin[{]
method[getAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, loadBalancerName, frontendIPConfigurationName, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.getWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.loadBalancerName], member[.frontendIPConfigurationName]]], member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[FrontendIPConfigurationInner] operator[>] identifier[getAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[loadBalancerName] , identifier[String] identifier[frontendIPConfigurationName] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[FrontendIPConfigurationInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[getWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[loadBalancerName] , identifier[frontendIPConfigurationName] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
public void setWorkDir(String dir) throws IOException
{
File workDir = new File(dir);
if (!workDir.exists() || !workDir.canWrite() || !workDir.canRead())
{
throw new IOException("Cannot access directory "+dir);
}
_workDir = workDir;
} | class class_name[name] begin[{]
method[setWorkDir, return_type[void], modifier[public], parameter[dir]] begin[{]
local_variable[type[File], workDir]
if[binary_operation[binary_operation[call[workDir.exists, parameter[]], ||, call[workDir.canWrite, parameter[]]], ||, call[workDir.canRead, parameter[]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot access directory "), operandr=MemberReference(member=dir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[._workDir], member[.workDir]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setWorkDir] operator[SEP] identifier[String] identifier[dir] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[File] identifier[workDir] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[dir] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[workDir] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[||] operator[!] identifier[workDir] operator[SEP] identifier[canWrite] operator[SEP] operator[SEP] operator[||] operator[!] identifier[workDir] operator[SEP] identifier[canRead] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[dir] operator[SEP] operator[SEP]
}
identifier[_workDir] operator[=] identifier[workDir] operator[SEP]
}
|
protected void mergeError(Object oldValue,
Object newValue,
boolean xml,
String elementName,
boolean property,
String key) throws InjectionConfigurationException {
JNDIEnvironmentRefType refType = getJNDIEnvironmentRefType();
String component = ivNameSpaceConfig.getDisplayName();
String module = ivNameSpaceConfig.getModuleName();
String application = ivNameSpaceConfig.getApplicationName();
String jndiName = getJndiName();
if (xml) {
Tr.error(tc, "CONFLICTING_XML_VALUES_CWNEN0052E",
component,
module,
application,
elementName,
refType.getXMLElementName(),
refType.getNameXMLElementName(),
jndiName,
oldValue,
newValue);
} else {
Tr.error(tc, "CONFLICTING_ANNOTATION_VALUES_CWNEN0054E",
component,
module,
application,
elementName,
'@' + refType.getAnnotationShortName(),
refType.getNameAnnotationElementName(),
jndiName,
oldValue,
newValue);
}
String exMsg;
if (xml) {
exMsg = "The " + component +
" component in the " + module +
" module of the " + application +
" application has conflicting configuration data in the XML" +
" deployment descriptor. Conflicting " + elementName +
" element values exist for multiple " + refType.getXMLElementName() +
" elements with the same " + refType.getNameXMLElementName() +
" element value : " + jndiName +
". The conflicting " + elementName +
" element values are " + oldValue +
" and " + newValue + ".";
} else {
exMsg = "The " + component +
" component in the " + module +
" module of the " + application +
" application has conflicting configuration data" +
" in source code annotations. Conflicting " + elementName +
" attribute values exist for multiple @" + refType.getAnnotationShortName() +
" annotations with the same " + refType.getNameAnnotationElementName() +
" attribute value : " + jndiName +
". The conflicting " + elementName +
" attribute values are " + oldValue +
" and " + newValue + ".";
}
throw new InjectionConfigurationException(exMsg);
} | class class_name[name] begin[{]
method[mergeError, return_type[void], modifier[protected], parameter[oldValue, newValue, xml, elementName, property, key]] begin[{]
local_variable[type[JNDIEnvironmentRefType], refType]
local_variable[type[String], component]
local_variable[type[String], module]
local_variable[type[String], application]
local_variable[type[String], jndiName]
if[member[.xml]] begin[{]
call[Tr.error, parameter[member[.tc], literal["CONFLICTING_XML_VALUES_CWNEN0052E"], member[.component], member[.module], member[.application], member[.elementName], call[refType.getXMLElementName, parameter[]], call[refType.getNameXMLElementName, parameter[]], member[.jndiName], member[.oldValue], member[.newValue]]]
else begin[{]
call[Tr.error, parameter[member[.tc], literal["CONFLICTING_ANNOTATION_VALUES_CWNEN0054E"], member[.component], member[.module], member[.application], member[.elementName], binary_operation[literal['@'], +, call[refType.getAnnotationShortName, parameter[]]], call[refType.getNameAnnotationElementName, parameter[]], member[.jndiName], member[.oldValue], member[.newValue]]]
end[}]
local_variable[type[String], exMsg]
if[member[.xml]] begin[{]
assign[member[.exMsg], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["The "], +, member[.component]], +, literal[" component in the "]], +, member[.module]], +, literal[" module of the "]], +, member[.application]], +, literal[" application has conflicting configuration data in the XML"]], +, literal[" deployment descriptor. Conflicting "]], +, member[.elementName]], +, literal[" element values exist for multiple "]], +, call[refType.getXMLElementName, parameter[]]], +, literal[" elements with the same "]], +, call[refType.getNameXMLElementName, parameter[]]], +, literal[" element value : "]], +, member[.jndiName]], +, literal[". The conflicting "]], +, member[.elementName]], +, literal[" element values are "]], +, member[.oldValue]], +, literal[" and "]], +, member[.newValue]], +, literal["."]]]
else begin[{]
assign[member[.exMsg], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["The "], +, member[.component]], +, literal[" component in the "]], +, member[.module]], +, literal[" module of the "]], +, member[.application]], +, literal[" application has conflicting configuration data"]], +, literal[" in source code annotations. Conflicting "]], +, member[.elementName]], +, literal[" attribute values exist for multiple @"]], +, call[refType.getAnnotationShortName, parameter[]]], +, literal[" annotations with the same "]], +, call[refType.getNameAnnotationElementName, parameter[]]], +, literal[" attribute value : "]], +, member[.jndiName]], +, literal[". The conflicting "]], +, member[.elementName]], +, literal[" attribute values are "]], +, member[.oldValue]], +, literal[" and "]], +, member[.newValue]], +, literal["."]]]
end[}]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=exMsg, 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=InjectionConfigurationException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[mergeError] operator[SEP] identifier[Object] identifier[oldValue] , identifier[Object] identifier[newValue] , Keyword[boolean] identifier[xml] , identifier[String] identifier[elementName] , Keyword[boolean] identifier[property] , identifier[String] identifier[key] operator[SEP] Keyword[throws] identifier[InjectionConfigurationException] {
identifier[JNDIEnvironmentRefType] identifier[refType] operator[=] identifier[getJNDIEnvironmentRefType] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[component] operator[=] identifier[ivNameSpaceConfig] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[module] operator[=] identifier[ivNameSpaceConfig] operator[SEP] identifier[getModuleName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[application] operator[=] identifier[ivNameSpaceConfig] operator[SEP] identifier[getApplicationName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[jndiName] operator[=] identifier[getJndiName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[xml] operator[SEP] {
identifier[Tr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , identifier[component] , identifier[module] , identifier[application] , identifier[elementName] , identifier[refType] operator[SEP] identifier[getXMLElementName] operator[SEP] operator[SEP] , identifier[refType] operator[SEP] identifier[getNameXMLElementName] operator[SEP] operator[SEP] , identifier[jndiName] , identifier[oldValue] , identifier[newValue] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Tr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , identifier[component] , identifier[module] , identifier[application] , identifier[elementName] , literal[String] operator[+] identifier[refType] operator[SEP] identifier[getAnnotationShortName] operator[SEP] operator[SEP] , identifier[refType] operator[SEP] identifier[getNameAnnotationElementName] operator[SEP] operator[SEP] , identifier[jndiName] , identifier[oldValue] , identifier[newValue] operator[SEP] operator[SEP]
}
identifier[String] identifier[exMsg] operator[SEP] Keyword[if] operator[SEP] identifier[xml] operator[SEP] {
identifier[exMsg] operator[=] literal[String] operator[+] identifier[component] operator[+] literal[String] operator[+] identifier[module] operator[+] literal[String] operator[+] identifier[application] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[elementName] operator[+] literal[String] operator[+] identifier[refType] operator[SEP] identifier[getXMLElementName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[refType] operator[SEP] identifier[getNameXMLElementName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[jndiName] operator[+] literal[String] operator[+] identifier[elementName] operator[+] literal[String] operator[+] identifier[oldValue] operator[+] literal[String] operator[+] identifier[newValue] operator[+] literal[String] operator[SEP]
}
Keyword[else] {
identifier[exMsg] operator[=] literal[String] operator[+] identifier[component] operator[+] literal[String] operator[+] identifier[module] operator[+] literal[String] operator[+] identifier[application] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[elementName] operator[+] literal[String] operator[+] identifier[refType] operator[SEP] identifier[getAnnotationShortName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[refType] operator[SEP] identifier[getNameAnnotationElementName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[jndiName] operator[+] literal[String] operator[+] identifier[elementName] operator[+] literal[String] operator[+] identifier[oldValue] operator[+] literal[String] operator[+] identifier[newValue] operator[+] literal[String] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[InjectionConfigurationException] operator[SEP] identifier[exMsg] operator[SEP] operator[SEP]
}
|
protected void setTransferAction(CmsListColumnDefinition transferCol) {
CmsListDirectAction transferAction = new CmsListDirectAction(LIST_ACTION_TRANSFER);
transferAction.setName(Messages.get().container(Messages.GUI_GROUPS_TRANSFER_LIST_ACTION_TRANSFER_NAME_0));
transferAction.setHelpText(Messages.get().container(Messages.GUI_GROUPS_TRANSFER_LIST_ACTION_TRANSFER_HELP_0));
transferAction.setIconPath(A_CmsUsersList.PATH_BUTTONS + "group.png");
transferCol.addDirectAction(transferAction);
} | class class_name[name] begin[{]
method[setTransferAction, return_type[void], modifier[protected], parameter[transferCol]] begin[{]
local_variable[type[CmsListDirectAction], transferAction]
call[transferAction.setName, parameter[call[Messages.get, parameter[]]]]
call[transferAction.setHelpText, parameter[call[Messages.get, parameter[]]]]
call[transferAction.setIconPath, parameter[binary_operation[member[A_CmsUsersList.PATH_BUTTONS], +, literal["group.png"]]]]
call[transferCol.addDirectAction, parameter[member[.transferAction]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[setTransferAction] operator[SEP] identifier[CmsListColumnDefinition] identifier[transferCol] operator[SEP] {
identifier[CmsListDirectAction] identifier[transferAction] operator[=] Keyword[new] identifier[CmsListDirectAction] operator[SEP] identifier[LIST_ACTION_TRANSFER] operator[SEP] operator[SEP] identifier[transferAction] operator[SEP] identifier[setName] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_GROUPS_TRANSFER_LIST_ACTION_TRANSFER_NAME_0] operator[SEP] operator[SEP] operator[SEP] identifier[transferAction] operator[SEP] identifier[setHelpText] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_GROUPS_TRANSFER_LIST_ACTION_TRANSFER_HELP_0] operator[SEP] operator[SEP] operator[SEP] identifier[transferAction] operator[SEP] identifier[setIconPath] operator[SEP] identifier[A_CmsUsersList] operator[SEP] identifier[PATH_BUTTONS] operator[+] literal[String] operator[SEP] operator[SEP] identifier[transferCol] operator[SEP] identifier[addDirectAction] operator[SEP] identifier[transferAction] operator[SEP] operator[SEP]
}
|
public static boolean supports(String mediaType, ResultType expectedType) {
if (mediaType == null) return true; // Assume the server will choose a reasonable media type.
ResponseFormat format = mimeFormats.get(stripParams(mediaType));
return (format != null && (expectedType == null || format.resultTypes.contains(expectedType)));
} | class class_name[name] begin[{]
method[supports, return_type[type[boolean]], modifier[public static], parameter[mediaType, expectedType]] begin[{]
if[binary_operation[member[.mediaType], ==, literal[null]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
local_variable[type[ResponseFormat], format]
return[binary_operation[binary_operation[member[.format], !=, literal[null]], &&, binary_operation[binary_operation[member[.expectedType], ==, literal[null]], ||, call[format.resultTypes.contains, parameter[member[.expectedType]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[supports] operator[SEP] identifier[String] identifier[mediaType] , identifier[ResultType] identifier[expectedType] operator[SEP] {
Keyword[if] operator[SEP] identifier[mediaType] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[ResponseFormat] identifier[format] operator[=] identifier[mimeFormats] operator[SEP] identifier[get] operator[SEP] identifier[stripParams] operator[SEP] identifier[mediaType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[format] operator[!=] Other[null] operator[&&] operator[SEP] identifier[expectedType] operator[==] Other[null] operator[||] identifier[format] operator[SEP] identifier[resultTypes] operator[SEP] identifier[contains] operator[SEP] identifier[expectedType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
protected static int obtainIntConfigParameter(MessageStoreImpl msi, String parameterName, String defaultValue, int minValue, int maxValue)
{
int value = Integer.parseInt(defaultValue);
if (msi != null)
{
String strValue = msi.getProperty(parameterName, defaultValue);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, parameterName + "=" + strValue);
}; // end if
try
{
value = Integer.parseInt(strValue);
if ((value < minValue) || (value > maxValue))
{
value = Integer.parseInt(defaultValue);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "OVERRIDE: " + parameterName + "=" + strValue);
}; // end if
}; // end if
}
catch (NumberFormatException nfexc)
{
//No FFDC Code Needed.
}
}; // end if
return value;
} | class class_name[name] begin[{]
method[obtainIntConfigParameter, return_type[type[int]], modifier[static protected], parameter[msi, parameterName, defaultValue, minValue, maxValue]] begin[{]
local_variable[type[int], value]
if[binary_operation[member[.msi], !=, literal[null]]] begin[{]
local_variable[type[String], strValue]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[SibTr.debug, parameter[member[.tc], binary_operation[binary_operation[member[.parameterName], +, literal["="]], +, member[.strValue]]]]
else begin[{]
None
end[}]
Statement(label=None)
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=strValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=minValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="OVERRIDE: "), operandr=MemberReference(member=parameterName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="="), operator=+), operandr=MemberReference(member=strValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)])), Statement(label=None)])), Statement(label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nfexc, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
Statement(label=None)
return[member[.value]]
end[}]
END[}] | Keyword[protected] Keyword[static] Keyword[int] identifier[obtainIntConfigParameter] operator[SEP] identifier[MessageStoreImpl] identifier[msi] , identifier[String] identifier[parameterName] , identifier[String] identifier[defaultValue] , Keyword[int] identifier[minValue] , Keyword[int] identifier[maxValue] operator[SEP] {
Keyword[int] identifier[value] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[defaultValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[msi] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[strValue] operator[=] identifier[msi] operator[SEP] identifier[getProperty] operator[SEP] identifier[parameterName] , identifier[defaultValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , identifier[parameterName] operator[+] literal[String] operator[+] identifier[strValue] operator[SEP] operator[SEP]
} operator[SEP] Keyword[try] {
identifier[value] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[strValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[value] operator[<] identifier[minValue] operator[SEP] operator[||] operator[SEP] identifier[value] operator[>] identifier[maxValue] operator[SEP] operator[SEP] {
identifier[value] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[defaultValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[parameterName] operator[+] literal[String] operator[+] identifier[strValue] operator[SEP] operator[SEP]
} operator[SEP]
} operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[nfexc] operator[SEP] {
}
} operator[SEP] Keyword[return] identifier[value] operator[SEP]
}
|
public Destination getDestination(String destName)
throws MessagingException {
Destination destination = null;
JMSDestination jmsDest = getJMSDestination(destName);
if(jmsDest != null) {
destination = jmsDest.destination;
}
return destination;
} | class class_name[name] begin[{]
method[getDestination, return_type[type[Destination]], modifier[public], parameter[destName]] begin[{]
local_variable[type[Destination], destination]
local_variable[type[JMSDestination], jmsDest]
if[binary_operation[member[.jmsDest], !=, literal[null]]] begin[{]
assign[member[.destination], member[jmsDest.destination]]
else begin[{]
None
end[}]
return[member[.destination]]
end[}]
END[}] | Keyword[public] identifier[Destination] identifier[getDestination] operator[SEP] identifier[String] identifier[destName] operator[SEP] Keyword[throws] identifier[MessagingException] {
identifier[Destination] identifier[destination] operator[=] Other[null] operator[SEP] identifier[JMSDestination] identifier[jmsDest] operator[=] identifier[getJMSDestination] operator[SEP] identifier[destName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jmsDest] operator[!=] Other[null] operator[SEP] {
identifier[destination] operator[=] identifier[jmsDest] operator[SEP] identifier[destination] operator[SEP]
}
Keyword[return] identifier[destination] operator[SEP]
}
|
@Override
public boolean check(Arg pArg) {
if (pArg.isTypeAllowed()) {
// Its allowed in general, so we only need to check
// the denied section, whether its forbidded
return deny == null || !matches(deny, pArg);
} else {
// Its forbidden by default, so we need to check the
// allowed section
return allow != null && matches(allow, pArg);
}
} | class class_name[name] begin[{]
method[check, return_type[type[boolean]], modifier[public], parameter[pArg]] begin[{]
if[call[pArg.isTypeAllowed, parameter[]]] begin[{]
return[binary_operation[binary_operation[member[.deny], ==, literal[null]], ||, call[.matches, parameter[member[.deny], member[.pArg]]]]]
else begin[{]
return[binary_operation[binary_operation[member[.allow], !=, literal[null]], &&, call[.matches, parameter[member[.allow], member[.pArg]]]]]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[check] operator[SEP] identifier[Arg] identifier[pArg] operator[SEP] {
Keyword[if] operator[SEP] identifier[pArg] operator[SEP] identifier[isTypeAllowed] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[deny] operator[==] Other[null] operator[||] operator[!] identifier[matches] operator[SEP] identifier[deny] , identifier[pArg] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[allow] operator[!=] Other[null] operator[&&] identifier[matches] operator[SEP] identifier[allow] , identifier[pArg] operator[SEP] operator[SEP]
}
}
|
public static void main(String[] args) throws Exception {
BinaryProblem problem = new OneMax(1024) ;
MutationOperator<BinarySolution> mutationOperator =
new BitFlipMutation(1.0 / problem.getNumberOfBits(0)) ;
int improvementRounds = 10000 ;
Comparator<BinarySolution> comparator = new DominanceComparator<>(0) ;
LocalSearchOperator<BinarySolution> localSearch = new BasicLocalSearch<>(
improvementRounds,
mutationOperator,
comparator,
problem) ;
BinarySolution solution = problem.createSolution() ;
BinarySolution newSolution = localSearch.execute(solution) ;
JMetalLogger.logger.info("Fitness: " + newSolution.getObjective(0)) ;
JMetalLogger.logger.info("Solution: " + newSolution.getVariableValueString(0)) ;
} | class class_name[name] begin[{]
method[main, return_type[void], modifier[public static], parameter[args]] begin[{]
local_variable[type[BinaryProblem], problem]
local_variable[type[MutationOperator], mutationOperator]
local_variable[type[int], improvementRounds]
local_variable[type[Comparator], comparator]
local_variable[type[LocalSearchOperator], localSearch]
local_variable[type[BinarySolution], solution]
local_variable[type[BinarySolution], newSolution]
call[JMetalLogger.logger.info, parameter[binary_operation[literal["Fitness: "], +, call[newSolution.getObjective, parameter[literal[0]]]]]]
call[JMetalLogger.logger.info, parameter[binary_operation[literal["Solution: "], +, call[newSolution.getVariableValueString, parameter[literal[0]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[BinaryProblem] identifier[problem] operator[=] Keyword[new] identifier[OneMax] operator[SEP] Other[1024] operator[SEP] operator[SEP] identifier[MutationOperator] operator[<] identifier[BinarySolution] operator[>] identifier[mutationOperator] operator[=] Keyword[new] identifier[BitFlipMutation] operator[SEP] literal[Float] operator[/] identifier[problem] operator[SEP] identifier[getNumberOfBits] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[improvementRounds] operator[=] Other[10000] operator[SEP] identifier[Comparator] operator[<] identifier[BinarySolution] operator[>] identifier[comparator] operator[=] Keyword[new] identifier[DominanceComparator] operator[<] operator[>] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[LocalSearchOperator] operator[<] identifier[BinarySolution] operator[>] identifier[localSearch] operator[=] Keyword[new] identifier[BasicLocalSearch] operator[<] operator[>] operator[SEP] identifier[improvementRounds] , identifier[mutationOperator] , identifier[comparator] , identifier[problem] operator[SEP] operator[SEP] identifier[BinarySolution] identifier[solution] operator[=] identifier[problem] operator[SEP] identifier[createSolution] operator[SEP] operator[SEP] operator[SEP] identifier[BinarySolution] identifier[newSolution] operator[=] identifier[localSearch] operator[SEP] identifier[execute] operator[SEP] identifier[solution] operator[SEP] operator[SEP] identifier[JMetalLogger] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[newSolution] operator[SEP] identifier[getObjective] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[JMetalLogger] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[newSolution] operator[SEP] identifier[getVariableValueString] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
|
public void marshall(UpdateCACertificateRequest updateCACertificateRequest, ProtocolMarshaller protocolMarshaller) {
if (updateCACertificateRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updateCACertificateRequest.getCertificateId(), CERTIFICATEID_BINDING);
protocolMarshaller.marshall(updateCACertificateRequest.getNewStatus(), NEWSTATUS_BINDING);
protocolMarshaller.marshall(updateCACertificateRequest.getNewAutoRegistrationStatus(), NEWAUTOREGISTRATIONSTATUS_BINDING);
protocolMarshaller.marshall(updateCACertificateRequest.getRegistrationConfig(), REGISTRATIONCONFIG_BINDING);
protocolMarshaller.marshall(updateCACertificateRequest.getRemoveAutoRegistration(), REMOVEAUTOREGISTRATION_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[updateCACertificateRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.updateCACertificateRequest], ==, 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=getCertificateId, postfix_operators=[], prefix_operators=[], qualifier=updateCACertificateRequest, selectors=[], type_arguments=None), MemberReference(member=CERTIFICATEID_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=getNewStatus, postfix_operators=[], prefix_operators=[], qualifier=updateCACertificateRequest, selectors=[], type_arguments=None), MemberReference(member=NEWSTATUS_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=getNewAutoRegistrationStatus, postfix_operators=[], prefix_operators=[], qualifier=updateCACertificateRequest, selectors=[], type_arguments=None), MemberReference(member=NEWAUTOREGISTRATIONSTATUS_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=getRegistrationConfig, postfix_operators=[], prefix_operators=[], qualifier=updateCACertificateRequest, selectors=[], type_arguments=None), MemberReference(member=REGISTRATIONCONFIG_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=getRemoveAutoRegistration, postfix_operators=[], prefix_operators=[], qualifier=updateCACertificateRequest, selectors=[], type_arguments=None), MemberReference(member=REMOVEAUTOREGISTRATION_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[UpdateCACertificateRequest] identifier[updateCACertificateRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[updateCACertificateRequest] 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[updateCACertificateRequest] operator[SEP] identifier[getCertificateId] operator[SEP] operator[SEP] , identifier[CERTIFICATEID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateCACertificateRequest] operator[SEP] identifier[getNewStatus] operator[SEP] operator[SEP] , identifier[NEWSTATUS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateCACertificateRequest] operator[SEP] identifier[getNewAutoRegistrationStatus] operator[SEP] operator[SEP] , identifier[NEWAUTOREGISTRATIONSTATUS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateCACertificateRequest] operator[SEP] identifier[getRegistrationConfig] operator[SEP] operator[SEP] , identifier[REGISTRATIONCONFIG_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateCACertificateRequest] operator[SEP] identifier[getRemoveAutoRegistration] operator[SEP] operator[SEP] , identifier[REMOVEAUTOREGISTRATION_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 Point2D getStartAdjusted()
{
final Point2D viewportLoc = new Point2D(getDragStartX(), getDragStartY());
m_vtog.transform(viewportLoc, viewportLoc);
return viewportLoc;
} | class class_name[name] begin[{]
method[getStartAdjusted, return_type[type[Point2D]], modifier[public], parameter[]] begin[{]
local_variable[type[Point2D], viewportLoc]
call[m_vtog.transform, parameter[member[.viewportLoc], member[.viewportLoc]]]
return[member[.viewportLoc]]
end[}]
END[}] | Keyword[public] identifier[Point2D] identifier[getStartAdjusted] operator[SEP] operator[SEP] {
Keyword[final] identifier[Point2D] identifier[viewportLoc] operator[=] Keyword[new] identifier[Point2D] operator[SEP] identifier[getDragStartX] operator[SEP] operator[SEP] , identifier[getDragStartY] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_vtog] operator[SEP] identifier[transform] operator[SEP] identifier[viewportLoc] , identifier[viewportLoc] operator[SEP] operator[SEP] Keyword[return] identifier[viewportLoc] operator[SEP]
}
|
public static <S> List<Class<? extends S>> load(Class<S> service,
ClassLoader loader) {
if (loader == null) {
loader = Thread.currentThread().getContextClassLoader();
}
List<Class<? extends S>> services = new ArrayList<>();
try {
Enumeration<URL> e = loader.getResources("META-INF/services/"
+ service.getName());
while (e.hasMoreElements()) {
URL url = e.nextElement();
InputStream is = url.openStream();
String name = null;
try {
BufferedReader r = new BufferedReader(
new InputStreamReader(is, "UTF-8"));
while (true) {
String line = r.readLine();
if (line == null) {
break;
}
int comment = line.indexOf('#');
if (comment >= 0) {
line = line.substring(0, comment);
}
name = line.trim();
if (name.length() == 0) {
continue;
}
Class<?> clz = Class.forName(name, true, loader);
Class<? extends S> impl = clz.asSubclass(service);
services.add(impl);
}
} catch (ClassNotFoundException cnfe) {
throw new ServiceConfigurationError("Could not load class for service provider " + name, cnfe);
} finally {
is.close();
}
}
} catch (IOException ioe) {
/**
* {@link java.util.ServiceLoader} swallows this exception, so
* will we.
*/
}
return services;
} | class class_name[name] begin[{]
method[load, return_type[type[List]], modifier[public static], parameter[service, loader]] begin[{]
if[binary_operation[member[.loader], ==, literal[null]]] begin[{]
assign[member[.loader], call[Thread.currentThread, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[List], services]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="META-INF/services/"), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=service, selectors=[], type_arguments=None), operator=+)], member=getResources, postfix_operators=[], prefix_operators=[], qualifier=loader, selectors=[], type_arguments=None), name=e)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None))], dimensions=[], name=Enumeration, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=url)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=openStream, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), name=is)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], 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)), name=r)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None), name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=line, 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=[BreakStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='#')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), name=comment)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=comment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=comment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=loader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), name=clz)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=service, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asSubclass, postfix_operators=[], prefix_operators=[], qualifier=clz, selectors=[], type_arguments=None), name=impl)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=S, sub_type=None))], dimensions=[], name=Class, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=impl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=services, selectors=[], type_arguments=None), label=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not load class for service provider "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=cnfe, 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=ServiceConfigurationError, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cnfe, types=['ClassNotFoundException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None), label=None)], label=None, resources=None)]), condition=MethodInvocation(arguments=[], member=hasMoreElements, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None)
return[member[.services]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[S] operator[>] identifier[List] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[S] operator[>] operator[>] identifier[load] operator[SEP] identifier[Class] operator[<] identifier[S] operator[>] identifier[service] , identifier[ClassLoader] identifier[loader] operator[SEP] {
Keyword[if] operator[SEP] identifier[loader] operator[==] Other[null] operator[SEP] {
identifier[loader] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[S] operator[>] operator[>] identifier[services] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[Enumeration] operator[<] identifier[URL] operator[>] identifier[e] operator[=] identifier[loader] operator[SEP] identifier[getResources] operator[SEP] literal[String] operator[+] identifier[service] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[e] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] {
identifier[URL] identifier[url] operator[=] identifier[e] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[InputStream] identifier[is] operator[=] identifier[url] operator[SEP] identifier[openStream] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[BufferedReader] identifier[r] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[is] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
identifier[String] identifier[line] operator[=] identifier[r] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[==] Other[null] operator[SEP] {
Keyword[break] operator[SEP]
}
Keyword[int] identifier[comment] operator[=] identifier[line] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[comment] operator[>=] Other[0] operator[SEP] {
identifier[line] operator[=] identifier[line] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[comment] operator[SEP] operator[SEP]
}
identifier[name] operator[=] identifier[line] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[Class] operator[<] operator[?] operator[>] identifier[clz] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[name] , literal[boolean] , identifier[loader] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[S] operator[>] identifier[impl] operator[=] identifier[clz] operator[SEP] identifier[asSubclass] operator[SEP] identifier[service] operator[SEP] operator[SEP] identifier[services] operator[SEP] identifier[add] operator[SEP] identifier[impl] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[cnfe] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ServiceConfigurationError] operator[SEP] literal[String] operator[+] identifier[name] , identifier[cnfe] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[is] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] {
}
Keyword[return] identifier[services] operator[SEP]
}
|
public static boolean isDepthRenderable(final JCGLTextureFormat f)
{
switch (f) {
case TEXTURE_FORMAT_DEPTH_16_2BPP:
case TEXTURE_FORMAT_DEPTH_24_4BPP:
case TEXTURE_FORMAT_DEPTH_24_STENCIL_8_4BPP:
case TEXTURE_FORMAT_DEPTH_32F_4BPP:
return true;
case TEXTURE_FORMAT_R_16_2BPP:
case TEXTURE_FORMAT_R_16F_2BPP:
case TEXTURE_FORMAT_R_16I_2BPP:
case TEXTURE_FORMAT_R_16U_2BPP:
case TEXTURE_FORMAT_R_32F_4BPP:
case TEXTURE_FORMAT_R_32I_4BPP:
case TEXTURE_FORMAT_R_32U_4BPP:
case TEXTURE_FORMAT_R_8_1BPP:
case TEXTURE_FORMAT_R_8I_1BPP:
case TEXTURE_FORMAT_R_8U_1BPP:
case TEXTURE_FORMAT_RG_16_4BPP:
case TEXTURE_FORMAT_RG_16F_4BPP:
case TEXTURE_FORMAT_RG_16I_4BPP:
case TEXTURE_FORMAT_RG_16U_4BPP:
case TEXTURE_FORMAT_RG_32F_8BPP:
case TEXTURE_FORMAT_RG_32I_8BPP:
case TEXTURE_FORMAT_RG_32U_8BPP:
case TEXTURE_FORMAT_RG_8_2BPP:
case TEXTURE_FORMAT_RG_8I_2BPP:
case TEXTURE_FORMAT_RG_8U_2BPP:
case TEXTURE_FORMAT_RGB_16_6BPP:
case TEXTURE_FORMAT_RGB_16F_6BPP:
case TEXTURE_FORMAT_RGB_16I_6BPP:
case TEXTURE_FORMAT_RGB_16U_6BPP:
case TEXTURE_FORMAT_RGB_32F_12BPP:
case TEXTURE_FORMAT_RGB_32I_12BPP:
case TEXTURE_FORMAT_RGB_32U_12BPP:
case TEXTURE_FORMAT_RGB_8_3BPP:
case TEXTURE_FORMAT_RGB_8I_3BPP:
case TEXTURE_FORMAT_RGB_8U_3BPP:
case TEXTURE_FORMAT_RGBA_1010102_4BPP:
case TEXTURE_FORMAT_RGBA_16_8BPP:
case TEXTURE_FORMAT_RGBA_16F_8BPP:
case TEXTURE_FORMAT_RGBA_16I_8BPP:
case TEXTURE_FORMAT_RGBA_16U_8BPP:
case TEXTURE_FORMAT_RGBA_32F_16BPP:
case TEXTURE_FORMAT_RGBA_32I_16BPP:
case TEXTURE_FORMAT_RGBA_32U_16BPP:
case TEXTURE_FORMAT_RGBA_8_4BPP:
case TEXTURE_FORMAT_RGBA_8I_4BPP:
case TEXTURE_FORMAT_RGBA_8U_4BPP:
return false;
}
throw new UnreachableCodeException();
} | class class_name[name] begin[{]
method[isDepthRenderable, return_type[type[boolean]], modifier[public static], parameter[f]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=['TEXTURE_FORMAT_DEPTH_16_2BPP', 'TEXTURE_FORMAT_DEPTH_24_4BPP', 'TEXTURE_FORMAT_DEPTH_24_STENCIL_8_4BPP', 'TEXTURE_FORMAT_DEPTH_32F_4BPP'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]), SwitchStatementCase(case=['TEXTURE_FORMAT_R_16_2BPP', 'TEXTURE_FORMAT_R_16F_2BPP', 'TEXTURE_FORMAT_R_16I_2BPP', 'TEXTURE_FORMAT_R_16U_2BPP', 'TEXTURE_FORMAT_R_32F_4BPP', 'TEXTURE_FORMAT_R_32I_4BPP', 'TEXTURE_FORMAT_R_32U_4BPP', 'TEXTURE_FORMAT_R_8_1BPP', 'TEXTURE_FORMAT_R_8I_1BPP', 'TEXTURE_FORMAT_R_8U_1BPP', 'TEXTURE_FORMAT_RG_16_4BPP', 'TEXTURE_FORMAT_RG_16F_4BPP', 'TEXTURE_FORMAT_RG_16I_4BPP', 'TEXTURE_FORMAT_RG_16U_4BPP', 'TEXTURE_FORMAT_RG_32F_8BPP', 'TEXTURE_FORMAT_RG_32I_8BPP', 'TEXTURE_FORMAT_RG_32U_8BPP', 'TEXTURE_FORMAT_RG_8_2BPP', 'TEXTURE_FORMAT_RG_8I_2BPP', 'TEXTURE_FORMAT_RG_8U_2BPP', 'TEXTURE_FORMAT_RGB_16_6BPP', 'TEXTURE_FORMAT_RGB_16F_6BPP', 'TEXTURE_FORMAT_RGB_16I_6BPP', 'TEXTURE_FORMAT_RGB_16U_6BPP', 'TEXTURE_FORMAT_RGB_32F_12BPP', 'TEXTURE_FORMAT_RGB_32I_12BPP', 'TEXTURE_FORMAT_RGB_32U_12BPP', 'TEXTURE_FORMAT_RGB_8_3BPP', 'TEXTURE_FORMAT_RGB_8I_3BPP', 'TEXTURE_FORMAT_RGB_8U_3BPP', 'TEXTURE_FORMAT_RGBA_1010102_4BPP', 'TEXTURE_FORMAT_RGBA_16_8BPP', 'TEXTURE_FORMAT_RGBA_16F_8BPP', 'TEXTURE_FORMAT_RGBA_16I_8BPP', 'TEXTURE_FORMAT_RGBA_16U_8BPP', 'TEXTURE_FORMAT_RGBA_32F_16BPP', 'TEXTURE_FORMAT_RGBA_32I_16BPP', 'TEXTURE_FORMAT_RGBA_32U_16BPP', 'TEXTURE_FORMAT_RGBA_8_4BPP', 'TEXTURE_FORMAT_RGBA_8I_4BPP', 'TEXTURE_FORMAT_RGBA_8U_4BPP'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])], expression=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnreachableCodeException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isDepthRenderable] operator[SEP] Keyword[final] identifier[JCGLTextureFormat] identifier[f] operator[SEP] {
Keyword[switch] operator[SEP] identifier[f] operator[SEP] {
Keyword[case] identifier[TEXTURE_FORMAT_DEPTH_16_2BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_DEPTH_24_4BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_DEPTH_24_STENCIL_8_4BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_DEPTH_32F_4BPP] operator[:] Keyword[return] literal[boolean] operator[SEP] Keyword[case] identifier[TEXTURE_FORMAT_R_16_2BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_R_16F_2BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_R_16I_2BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_R_16U_2BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_R_32F_4BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_R_32I_4BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_R_32U_4BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_R_8_1BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_R_8I_1BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_R_8U_1BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RG_16_4BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RG_16F_4BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RG_16I_4BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RG_16U_4BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RG_32F_8BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RG_32I_8BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RG_32U_8BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RG_8_2BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RG_8I_2BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RG_8U_2BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGB_16_6BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGB_16F_6BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGB_16I_6BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGB_16U_6BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGB_32F_12BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGB_32I_12BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGB_32U_12BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGB_8_3BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGB_8I_3BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGB_8U_3BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGBA_1010102_4BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGBA_16_8BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGBA_16F_8BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGBA_16I_8BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGBA_16U_8BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGBA_32F_16BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGBA_32I_16BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGBA_32U_16BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGBA_8_4BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGBA_8I_4BPP] operator[:] Keyword[case] identifier[TEXTURE_FORMAT_RGBA_8U_4BPP] operator[:] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[UnreachableCodeException] operator[SEP] operator[SEP] operator[SEP]
}
|
Delta newDropTable() {
Delta storageDelta = Deltas.mapBuilder()
.put(StorageState.DROPPED.getMarkerAttribute().key(), now())
.build();
MapDeltaBuilder storageMapDelta = Deltas.mapBuilder();
if (_master != null) {
for (Storage storage : _master.getPrimaryAndMirrors()) {
storageMapDelta.update(storage.getUuidString(), storageDelta);
}
}
for (Storage facade : _facades) {
for (Storage storage : facade.getPrimaryAndMirrors()) {
storageMapDelta.update(storage.getUuidString(), storageDelta);
}
}
// Delete most of the information about the table, but leave enough that we can run a job later that
// purges all the data out of Cassandra.
return Deltas.mapBuilder()
.remove(UUID_ATTR.key())
.remove(ATTRIBUTES.key())
.update(STORAGE.key(), storageMapDelta.build())
.removeRest()
.build();
} | class class_name[name] begin[{]
method[newDropTable, return_type[type[Delta]], modifier[default], parameter[]] begin[{]
local_variable[type[Delta], storageDelta]
local_variable[type[MapDeltaBuilder], storageMapDelta]
if[binary_operation[member[._master], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getUuidString, postfix_operators=[], prefix_operators=[], qualifier=storage, selectors=[], type_arguments=None), MemberReference(member=storageDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=update, postfix_operators=[], prefix_operators=[], qualifier=storageMapDelta, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getPrimaryAndMirrors, postfix_operators=[], prefix_operators=[], qualifier=_master, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=storage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Storage, sub_type=None))), label=None)
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getUuidString, postfix_operators=[], prefix_operators=[], qualifier=storage, selectors=[], type_arguments=None), MemberReference(member=storageDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=update, postfix_operators=[], prefix_operators=[], qualifier=storageMapDelta, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getPrimaryAndMirrors, postfix_operators=[], prefix_operators=[], qualifier=facade, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=storage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Storage, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=_facades, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=facade)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Storage, sub_type=None))), label=None)
return[call[Deltas.mapBuilder, parameter[]]]
end[}]
END[}] | identifier[Delta] identifier[newDropTable] operator[SEP] operator[SEP] {
identifier[Delta] identifier[storageDelta] operator[=] identifier[Deltas] operator[SEP] identifier[mapBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[StorageState] operator[SEP] identifier[DROPPED] operator[SEP] identifier[getMarkerAttribute] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] operator[SEP] , identifier[now] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[MapDeltaBuilder] identifier[storageMapDelta] operator[=] identifier[Deltas] operator[SEP] identifier[mapBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_master] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Storage] identifier[storage] operator[:] identifier[_master] operator[SEP] identifier[getPrimaryAndMirrors] operator[SEP] operator[SEP] operator[SEP] {
identifier[storageMapDelta] operator[SEP] identifier[update] operator[SEP] identifier[storage] operator[SEP] identifier[getUuidString] operator[SEP] operator[SEP] , identifier[storageDelta] operator[SEP] operator[SEP]
}
}
Keyword[for] operator[SEP] identifier[Storage] identifier[facade] operator[:] identifier[_facades] operator[SEP] {
Keyword[for] operator[SEP] identifier[Storage] identifier[storage] operator[:] identifier[facade] operator[SEP] identifier[getPrimaryAndMirrors] operator[SEP] operator[SEP] operator[SEP] {
identifier[storageMapDelta] operator[SEP] identifier[update] operator[SEP] identifier[storage] operator[SEP] identifier[getUuidString] operator[SEP] operator[SEP] , identifier[storageDelta] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[Deltas] operator[SEP] identifier[mapBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[UUID_ATTR] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[ATTRIBUTES] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[update] operator[SEP] identifier[STORAGE] operator[SEP] identifier[key] operator[SEP] operator[SEP] , identifier[storageMapDelta] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[removeRest] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void setPreferredRoadBorderSize(Integer size) {
final Preferences prefs = Preferences.userNodeForPackage(RoadNetworkLayerConstants.class);
if (prefs != null) {
if (size == null || size.intValue() == DEFAULT_BORDER_SIZE) {
prefs.remove("ROAD_BORDER_SIZE"); //$NON-NLS-1$
} else {
prefs.putInt("ROAD_BORDER_SIZE", size.intValue()); //$NON-NLS-1$
}
try {
prefs.flush();
} catch (BackingStoreException exception) {
//
}
}
} | class class_name[name] begin[{]
method[setPreferredRoadBorderSize, return_type[void], modifier[public static], parameter[size]] begin[{]
local_variable[type[Preferences], prefs]
if[binary_operation[member[.prefs], !=, literal[null]]] begin[{]
if[binary_operation[binary_operation[member[.size], ==, literal[null]], ||, binary_operation[call[size.intValue, parameter[]], ==, member[.DEFAULT_BORDER_SIZE]]]] begin[{]
call[prefs.remove, parameter[literal["ROAD_BORDER_SIZE"]]]
else begin[{]
call[prefs.putInt, parameter[literal["ROAD_BORDER_SIZE"], call[size.intValue, parameter[]]]]
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=prefs, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['BackingStoreException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[setPreferredRoadBorderSize] operator[SEP] identifier[Integer] identifier[size] operator[SEP] {
Keyword[final] identifier[Preferences] identifier[prefs] operator[=] identifier[Preferences] operator[SEP] identifier[userNodeForPackage] operator[SEP] identifier[RoadNetworkLayerConstants] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prefs] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[size] operator[==] Other[null] operator[||] identifier[size] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[==] identifier[DEFAULT_BORDER_SIZE] operator[SEP] {
identifier[prefs] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[prefs] operator[SEP] identifier[putInt] operator[SEP] literal[String] , identifier[size] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[prefs] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[BackingStoreException] identifier[exception] operator[SEP] {
}
}
}
|
@Bean
@ConditionalOnProperty(prefix = JavaMelodyConfigurationProperties.PREFIX, name = "scheduled-monitoring-enabled", matchIfMissing = true)
@ConditionalOnMissingBean(DefaultAdvisorAutoProxyCreator.class)
public MonitoringSpringAdvisor monitoringSpringScheduledAdvisor() {
// scheduled-monitoring-enabled was false by default because of #643,
// pending https://jira.spring.io/browse/SPR-15562,
// but true by default since 1.76 after adding dependency spring-boot-starter-aop
return new MonitoringSpringAdvisor(
Pointcuts.union(new AnnotationMatchingPointcut(null, Scheduled.class),
new AnnotationMatchingPointcut(null, Schedules.class)));
} | class class_name[name] begin[{]
method[monitoringSpringScheduledAdvisor, return_type[type[MonitoringSpringAdvisor]], modifier[public], parameter[]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Scheduled, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AnnotationMatchingPointcut, sub_type=None)), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Schedules, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AnnotationMatchingPointcut, sub_type=None))], member=union, postfix_operators=[], prefix_operators=[], qualifier=Pointcuts, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MonitoringSpringAdvisor, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Bean] annotation[@] identifier[ConditionalOnProperty] operator[SEP] identifier[prefix] operator[=] identifier[JavaMelodyConfigurationProperties] operator[SEP] identifier[PREFIX] , identifier[name] operator[=] literal[String] , identifier[matchIfMissing] operator[=] literal[boolean] operator[SEP] annotation[@] identifier[ConditionalOnMissingBean] operator[SEP] identifier[DefaultAdvisorAutoProxyCreator] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[MonitoringSpringAdvisor] identifier[monitoringSpringScheduledAdvisor] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[MonitoringSpringAdvisor] operator[SEP] identifier[Pointcuts] operator[SEP] identifier[union] operator[SEP] Keyword[new] identifier[AnnotationMatchingPointcut] operator[SEP] Other[null] , identifier[Scheduled] operator[SEP] Keyword[class] operator[SEP] , Keyword[new] identifier[AnnotationMatchingPointcut] operator[SEP] Other[null] , identifier[Schedules] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
Cursor result = null;
if (!controller.hasPreinitialized()) {
throw new IllegalStateException("Controller has not been initialized.");
}
int patternCode = controller.getUriMatcher().match(uri);
MatcherPattern pattern = controller.findMatcherPattern(patternCode);
if (pattern == null) {
throw new IllegalArgumentException("unknown uri : " + uri.toString());
}
Parameter parameter = new Parameter(uri, projection, selection, selectionArgs, sortOrder);
SQLiteDatabase db = this.getHelper().getReadableDatabase();
result = onQuery(this.getHelper(), db, pattern, parameter);
if (result != null) {
this.onQueryCompleted(result, uri, pattern, parameter);
}
return result;
} | class class_name[name] begin[{]
method[query, return_type[type[Cursor]], modifier[public], parameter[uri, projection, selection, selectionArgs, sortOrder]] begin[{]
local_variable[type[Cursor], result]
if[call[controller.hasPreinitialized, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Controller has not been initialized.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], patternCode]
local_variable[type[MatcherPattern], pattern]
if[binary_operation[member[.pattern], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unknown uri : "), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=uri, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[Parameter], parameter]
local_variable[type[SQLiteDatabase], db]
assign[member[.result], call[.onQuery, parameter[THIS[call[None.getHelper, parameter[]]], member[.db], member[.pattern], member[.parameter]]]]
if[binary_operation[member[.result], !=, literal[null]]] begin[{]
THIS[call[None.onQueryCompleted, parameter[member[.result], member[.uri], member[.pattern], member[.parameter]]]]
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Cursor] identifier[query] operator[SEP] identifier[Uri] identifier[uri] , identifier[String] operator[SEP] operator[SEP] identifier[projection] , identifier[String] identifier[selection] , identifier[String] operator[SEP] operator[SEP] identifier[selectionArgs] , identifier[String] identifier[sortOrder] operator[SEP] {
identifier[Cursor] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[controller] operator[SEP] identifier[hasPreinitialized] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[int] identifier[patternCode] operator[=] identifier[controller] operator[SEP] identifier[getUriMatcher] operator[SEP] operator[SEP] operator[SEP] identifier[match] operator[SEP] identifier[uri] operator[SEP] operator[SEP] identifier[MatcherPattern] identifier[pattern] operator[=] identifier[controller] operator[SEP] identifier[findMatcherPattern] operator[SEP] identifier[patternCode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pattern] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[uri] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Parameter] identifier[parameter] operator[=] Keyword[new] identifier[Parameter] operator[SEP] identifier[uri] , identifier[projection] , identifier[selection] , identifier[selectionArgs] , identifier[sortOrder] operator[SEP] operator[SEP] identifier[SQLiteDatabase] identifier[db] operator[=] Keyword[this] operator[SEP] identifier[getHelper] operator[SEP] operator[SEP] operator[SEP] identifier[getReadableDatabase] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[onQuery] operator[SEP] Keyword[this] operator[SEP] identifier[getHelper] operator[SEP] operator[SEP] , identifier[db] , identifier[pattern] , identifier[parameter] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[onQueryCompleted] operator[SEP] identifier[result] , identifier[uri] , identifier[pattern] , identifier[parameter] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
private void executeScript(String script) {
try {
final StatementSplitter statementSplitter =
new StatementSplitterResolver(scriptConfigurationInstance.get()).resolve();
final ScriptExecutor scriptExecutor =
new ScriptExecutor(databaseConnection.get().getConnection(), scriptConfigurationInstance.get(),
statementSplitter);
scriptExecutor.execute(script);
} catch (SQLException e) {
throw new DBUnitConnectionException("Unable to execute script.", e);
}
} | class class_name[name] begin[{]
method[executeScript, return_type[void], modifier[private], parameter[script]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=scriptConfigurationInstance, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=resolve, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StatementSplitterResolver, sub_type=None)), name=statementSplitter)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=StatementSplitter, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=databaseConnection, selectors=[MethodInvocation(arguments=[], member=getConnection, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=scriptConfigurationInstance, selectors=[], type_arguments=None), MemberReference(member=statementSplitter, 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=ScriptExecutor, sub_type=None)), name=scriptExecutor)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ScriptExecutor, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=script, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=scriptExecutor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to execute script."), 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=DBUnitConnectionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[executeScript] operator[SEP] identifier[String] identifier[script] operator[SEP] {
Keyword[try] {
Keyword[final] identifier[StatementSplitter] identifier[statementSplitter] operator[=] Keyword[new] identifier[StatementSplitterResolver] operator[SEP] identifier[scriptConfigurationInstance] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[resolve] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ScriptExecutor] identifier[scriptExecutor] operator[=] Keyword[new] identifier[ScriptExecutor] operator[SEP] identifier[databaseConnection] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] , identifier[scriptConfigurationInstance] operator[SEP] identifier[get] operator[SEP] operator[SEP] , identifier[statementSplitter] operator[SEP] operator[SEP] identifier[scriptExecutor] operator[SEP] identifier[execute] operator[SEP] identifier[script] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DBUnitConnectionException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public static Object findByTextIgnoreCase(Collection<?> aCollection,
String aText)
{
if (aText == null)
throw new RequiredException("aName in Organizer.findIgnoreCase");
if (aCollection == null)
throw new RequiredException(
"aCollection in Organizer.findIgnoreCase");
Object element = null;
for (Iterator<?> i = aCollection.iterator(); i.hasNext();)
{
element = i.next();
if (element == null)
continue;
if (aText.equalsIgnoreCase(element.toString()))
return element;
}
throw new SystemException("Text=" + aText + " in collection "
+ aCollection);
} | class class_name[name] begin[{]
method[findByTextIgnoreCase, return_type[type[Object]], modifier[public static], parameter[aCollection, aText]] begin[{]
if[binary_operation[member[.aText], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="aName in Organizer.findIgnoreCase")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RequiredException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.aCollection], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="aCollection in Organizer.findIgnoreCase")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RequiredException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[Object], element]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=element, 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=ContinueStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None)], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=aText, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=aCollection, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Text="), operandr=MemberReference(member=aText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" in collection "), operator=+), operandr=MemberReference(member=aCollection, 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=SystemException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Object] identifier[findByTextIgnoreCase] operator[SEP] identifier[Collection] operator[<] operator[?] operator[>] identifier[aCollection] , identifier[String] identifier[aText] operator[SEP] {
Keyword[if] operator[SEP] identifier[aText] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[RequiredException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aCollection] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[RequiredException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Object] identifier[element] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] operator[?] operator[>] identifier[i] operator[=] identifier[aCollection] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[element] operator[=] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[element] operator[==] Other[null] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[aText] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[element] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[element] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[SystemException] operator[SEP] literal[String] operator[+] identifier[aText] operator[+] literal[String] operator[+] identifier[aCollection] operator[SEP] operator[SEP]
}
|
public INDArray inferVector(String text, double learningRate, double minLearningRate, int iterations) {
if (tokenizerFactory == null)
throw new IllegalStateException("TokenizerFactory should be defined, prior to predict() call");
if (this.vocab == null || this.vocab.numWords() == 0)
reassignExistingModel();
List<String> tokens = tokenizerFactory.create(text).getTokens();
List<VocabWord> document = new ArrayList<>();
for (String token : tokens) {
if (vocab.containsWord(token)) {
document.add(vocab.wordFor(token));
}
}
if (document.isEmpty())
throw new ND4JIllegalStateException("Text passed for inference has no matches in model vocabulary.");
return inferVector(document, learningRate, minLearningRate, iterations);
} | class class_name[name] begin[{]
method[inferVector, return_type[type[INDArray]], modifier[public], parameter[text, learningRate, minLearningRate, iterations]] begin[{]
if[binary_operation[member[.tokenizerFactory], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TokenizerFactory should be defined, prior to predict() call")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[THIS[member[None.vocab]], ==, literal[null]], ||, binary_operation[THIS[member[None.vocab]call[None.numWords, parameter[]]], ==, literal[0]]]] begin[{]
call[.reassignExistingModel, parameter[]]
else begin[{]
None
end[}]
local_variable[type[List], tokens]
local_variable[type[List], document]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsWord, postfix_operators=[], prefix_operators=[], qualifier=vocab, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wordFor, postfix_operators=[], prefix_operators=[], qualifier=vocab, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=document, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=tokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=token)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
if[call[document.isEmpty, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Text passed for inference has no matches in model vocabulary.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ND4JIllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[.inferVector, parameter[member[.document], member[.learningRate], member[.minLearningRate], member[.iterations]]]]
end[}]
END[}] | Keyword[public] identifier[INDArray] identifier[inferVector] operator[SEP] identifier[String] identifier[text] , Keyword[double] identifier[learningRate] , Keyword[double] identifier[minLearningRate] , Keyword[int] identifier[iterations] operator[SEP] {
Keyword[if] operator[SEP] identifier[tokenizerFactory] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[vocab] operator[==] Other[null] operator[||] Keyword[this] operator[SEP] identifier[vocab] operator[SEP] identifier[numWords] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] identifier[reassignExistingModel] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[tokens] operator[=] identifier[tokenizerFactory] operator[SEP] identifier[create] operator[SEP] identifier[text] operator[SEP] operator[SEP] identifier[getTokens] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[VocabWord] operator[>] identifier[document] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[token] operator[:] identifier[tokens] operator[SEP] {
Keyword[if] operator[SEP] identifier[vocab] operator[SEP] identifier[containsWord] operator[SEP] identifier[token] operator[SEP] operator[SEP] {
identifier[document] operator[SEP] identifier[add] operator[SEP] identifier[vocab] operator[SEP] identifier[wordFor] operator[SEP] identifier[token] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[document] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ND4JIllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[inferVector] operator[SEP] identifier[document] , identifier[learningRate] , identifier[minLearningRate] , identifier[iterations] operator[SEP] operator[SEP]
}
|
public ScatterPlot points(double[][] data, char legend, Color color) {
return points(null, data, legend, color);
} | class class_name[name] begin[{]
method[points, return_type[type[ScatterPlot]], modifier[public], parameter[data, legend, color]] begin[{]
return[call[.points, parameter[literal[null], member[.data], member[.legend], member[.color]]]]
end[}]
END[}] | Keyword[public] identifier[ScatterPlot] identifier[points] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[data] , Keyword[char] identifier[legend] , identifier[Color] identifier[color] operator[SEP] {
Keyword[return] identifier[points] operator[SEP] Other[null] , identifier[data] , identifier[legend] , identifier[color] operator[SEP] operator[SEP]
}
|
private void write(MultiPoint points, JsonGenerator gen) throws IOException {
gen.writeStringField("type", "MultiPoint");
gen.writeFieldName("coordinates");
writeCoordinates(points.getCoordinates(), gen);
} | class class_name[name] begin[{]
method[write, return_type[void], modifier[private], parameter[points, gen]] begin[{]
call[gen.writeStringField, parameter[literal["type"], literal["MultiPoint"]]]
call[gen.writeFieldName, parameter[literal["coordinates"]]]
call[.writeCoordinates, parameter[call[points.getCoordinates, parameter[]], member[.gen]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[write] operator[SEP] identifier[MultiPoint] identifier[points] , identifier[JsonGenerator] identifier[gen] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[gen] operator[SEP] identifier[writeStringField] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[gen] operator[SEP] identifier[writeFieldName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[writeCoordinates] operator[SEP] identifier[points] operator[SEP] identifier[getCoordinates] operator[SEP] operator[SEP] , identifier[gen] operator[SEP] operator[SEP]
}
|
public boolean eq(final Matrix B)
{
final Matrix A = this;
if ((B.m_rows != A.m_rows) || (B.m_columns != A.m_columns))
{
return false;
}
for (int i = 0; i < m_rows; i++)
{
for (int j = 0; j < m_columns; j++)
{
if (A.m_data[i][j] != B.m_data[i][j])
{
return false;
}
}
}
return true;
} | class class_name[name] begin[{]
method[eq, return_type[type[boolean]], modifier[public], parameter[B]] begin[{]
local_variable[type[Matrix], A]
if[binary_operation[binary_operation[member[B.m_rows], !=, member[A.m_rows]], ||, binary_operation[member[B.m_columns], !=, member[A.m_columns]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m_data, postfix_operators=[], prefix_operators=[], qualifier=A, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=m_data, postfix_operators=[], prefix_operators=[], qualifier=B, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=m_columns, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=m_rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[eq] operator[SEP] Keyword[final] identifier[Matrix] identifier[B] operator[SEP] {
Keyword[final] identifier[Matrix] identifier[A] operator[=] Keyword[this] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[B] operator[SEP] identifier[m_rows] operator[!=] identifier[A] operator[SEP] identifier[m_rows] operator[SEP] operator[||] operator[SEP] identifier[B] operator[SEP] identifier[m_columns] operator[!=] identifier[A] operator[SEP] identifier[m_columns] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[m_rows] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[m_columns] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[A] operator[SEP] identifier[m_data] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[!=] identifier[B] operator[SEP] identifier[m_data] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static boolean inodeUfsIsContentSynced(Inode inode, Fingerprint inodeFingerprint,
Fingerprint ufsFingerprint) {
boolean isSyncedUnpersisted =
!inode.isPersisted() && !ufsFingerprint.isValid();
boolean isSyncedPersisted;
isSyncedPersisted = inode.isPersisted()
&& inodeFingerprint.matchContent(ufsFingerprint)
&& inodeFingerprint.isValid();
return isSyncedPersisted || isSyncedUnpersisted;
} | class class_name[name] begin[{]
method[inodeUfsIsContentSynced, return_type[type[boolean]], modifier[public static], parameter[inode, inodeFingerprint, ufsFingerprint]] begin[{]
local_variable[type[boolean], isSyncedUnpersisted]
local_variable[type[boolean], isSyncedPersisted]
assign[member[.isSyncedPersisted], binary_operation[binary_operation[call[inode.isPersisted, parameter[]], &&, call[inodeFingerprint.matchContent, parameter[member[.ufsFingerprint]]]], &&, call[inodeFingerprint.isValid, parameter[]]]]
return[binary_operation[member[.isSyncedPersisted], ||, member[.isSyncedUnpersisted]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[inodeUfsIsContentSynced] operator[SEP] identifier[Inode] identifier[inode] , identifier[Fingerprint] identifier[inodeFingerprint] , identifier[Fingerprint] identifier[ufsFingerprint] operator[SEP] {
Keyword[boolean] identifier[isSyncedUnpersisted] operator[=] operator[!] identifier[inode] operator[SEP] identifier[isPersisted] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[ufsFingerprint] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[isSyncedPersisted] operator[SEP] identifier[isSyncedPersisted] operator[=] identifier[inode] operator[SEP] identifier[isPersisted] operator[SEP] operator[SEP] operator[&&] identifier[inodeFingerprint] operator[SEP] identifier[matchContent] operator[SEP] identifier[ufsFingerprint] operator[SEP] operator[&&] identifier[inodeFingerprint] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[isSyncedPersisted] operator[||] identifier[isSyncedUnpersisted] operator[SEP]
}
|
@Override
public void writeMap(Collection<?> array) {
writeAMF3();
buf.put(AMF3.TYPE_ARRAY);
if (hasReference(array)) {
putInteger(getReferenceId(array) << 1);
return;
}
storeReference(array);
// TODO: we could optimize this by storing the first integer
// keys after the key-value pairs
amf3_mode += 1;
putInteger(1);
int idx = 0;
for (Object item : array) {
if (item != null) {
putString(String.valueOf(idx));
Serializer.serialize(this, item);
}
idx++;
}
amf3_mode -= 1;
putString("");
} | class class_name[name] begin[{]
method[writeMap, return_type[void], modifier[public], parameter[array]] begin[{]
call[.writeAMF3, parameter[]]
call[buf.put, parameter[member[AMF3.TYPE_ARRAY]]]
if[call[.hasReference, parameter[member[.array]]]] begin[{]
call[.putInteger, parameter[binary_operation[call[.getReferenceId, parameter[member[.array]]], <<, literal[1]]]]
return[None]
else begin[{]
None
end[}]
call[.storeReference, parameter[member[.array]]]
assign[member[.amf3_mode], literal[1]]
call[.putInteger, parameter[literal[1]]]
local_variable[type[int], idx]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=item, 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=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=putString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=serialize, postfix_operators=[], prefix_operators=[], qualifier=Serializer, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MemberReference(member=idx, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
assign[member[.amf3_mode], literal[1]]
call[.putString, parameter[literal[""]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[writeMap] operator[SEP] identifier[Collection] operator[<] operator[?] operator[>] identifier[array] operator[SEP] {
identifier[writeAMF3] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[put] operator[SEP] identifier[AMF3] operator[SEP] identifier[TYPE_ARRAY] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasReference] operator[SEP] identifier[array] operator[SEP] operator[SEP] {
identifier[putInteger] operator[SEP] identifier[getReferenceId] operator[SEP] identifier[array] operator[SEP] operator[<<] Other[1] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[storeReference] operator[SEP] identifier[array] operator[SEP] operator[SEP] identifier[amf3_mode] operator[+=] Other[1] operator[SEP] identifier[putInteger] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[idx] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[item] operator[:] identifier[array] operator[SEP] {
Keyword[if] operator[SEP] identifier[item] operator[!=] Other[null] operator[SEP] {
identifier[putString] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[idx] operator[SEP] operator[SEP] operator[SEP] identifier[Serializer] operator[SEP] identifier[serialize] operator[SEP] Keyword[this] , identifier[item] operator[SEP] operator[SEP]
}
identifier[idx] operator[++] operator[SEP]
}
identifier[amf3_mode] operator[-=] Other[1] operator[SEP] identifier[putString] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
public Response executeMessage(Message message, Builder<?> builder) {
return executeMessage(message, builder,
OperaIntervals.RESPONSE_TIMEOUT.getMs());
} | class class_name[name] begin[{]
method[executeMessage, return_type[type[Response]], modifier[public], parameter[message, builder]] begin[{]
return[call[.executeMessage, parameter[member[.message], member[.builder], call[OperaIntervals.RESPONSE_TIMEOUT.getMs, parameter[]]]]]
end[}]
END[}] | Keyword[public] identifier[Response] identifier[executeMessage] operator[SEP] identifier[Message] identifier[message] , identifier[Builder] operator[<] operator[?] operator[>] identifier[builder] operator[SEP] {
Keyword[return] identifier[executeMessage] operator[SEP] identifier[message] , identifier[builder] , identifier[OperaIntervals] operator[SEP] identifier[RESPONSE_TIMEOUT] operator[SEP] identifier[getMs] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public Object invoke(Object p_proxy, Method m, Object[] args) throws Throwable {
Debug.logVerbose("<################################>Action: JdonFramework core entrance", module);
Debug.logVerbose("[JdonFramework]<################>execute method=" + m.getDeclaringClass().getName() + "." + m.getName(), module);
Object result = null;
try {
result = aopClient.invoke(targetMetaRequest, m, args);
Debug.logVerbose("[JdonFramework]<################>finish executing method=" + m.getDeclaringClass().getName() + "." + m.getName()
+ " successfully!", module);
Debug.logVerbose("<################################><end:", module);
} catch (Exception ex) {
Debug.logError(ex, module);
} catch (Throwable ex) {
throw new Throwable(ex);
}
return result;
} | class class_name[name] begin[{]
method[invoke, return_type[type[Object]], modifier[public], parameter[p_proxy, m, args]] begin[{]
call[Debug.logVerbose, parameter[literal["<################################>Action: JdonFramework core entrance"], member[.module]]]
call[Debug.logVerbose, parameter[binary_operation[binary_operation[binary_operation[literal["[JdonFramework]<################>execute method="], +, call[m.getDeclaringClass, parameter[]]], +, literal["."]], +, call[m.getName, parameter[]]], member[.module]]]
local_variable[type[Object], result]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=targetMetaRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=aopClient, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[JdonFramework]<################>finish executing method="), operandr=MethodInvocation(arguments=[], member=getDeclaringClass, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" successfully!"), operator=+), MemberReference(member=module, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logVerbose, postfix_operators=[], prefix_operators=[], qualifier=Debug, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<################################><end:"), MemberReference(member=module, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logVerbose, postfix_operators=[], prefix_operators=[], qualifier=Debug, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=module, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logError, postfix_operators=[], prefix_operators=[], qualifier=Debug, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Throwable, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Throwable']))], finally_block=None, label=None, resources=None)
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[invoke] operator[SEP] identifier[Object] identifier[p_proxy] , identifier[Method] identifier[m] , identifier[Object] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[Throwable] {
identifier[Debug] operator[SEP] identifier[logVerbose] operator[SEP] literal[String] , identifier[module] operator[SEP] operator[SEP] identifier[Debug] operator[SEP] identifier[logVerbose] operator[SEP] literal[String] operator[+] identifier[m] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[m] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[module] operator[SEP] operator[SEP] identifier[Object] identifier[result] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[result] operator[=] identifier[aopClient] operator[SEP] identifier[invoke] operator[SEP] identifier[targetMetaRequest] , identifier[m] , identifier[args] operator[SEP] operator[SEP] identifier[Debug] operator[SEP] identifier[logVerbose] operator[SEP] literal[String] operator[+] identifier[m] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[m] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[module] operator[SEP] operator[SEP] identifier[Debug] operator[SEP] identifier[logVerbose] operator[SEP] literal[String] , identifier[module] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[Debug] operator[SEP] identifier[logError] operator[SEP] identifier[ex] , identifier[module] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[Throwable] operator[SEP] identifier[ex] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public double add(int index, double delta) {
updated = true;
int newIndex = getIndex(index);
return (newIndex == -1) ? 0 : doubleVector.add(newIndex, delta);
} | class class_name[name] begin[{]
method[add, return_type[type[double]], modifier[public], parameter[index, delta]] begin[{]
assign[member[.updated], literal[true]]
local_variable[type[int], newIndex]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=newIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=newIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=delta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=doubleVector, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]
end[}]
END[}] | Keyword[public] Keyword[double] identifier[add] operator[SEP] Keyword[int] identifier[index] , Keyword[double] identifier[delta] operator[SEP] {
identifier[updated] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[newIndex] operator[=] identifier[getIndex] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[newIndex] operator[==] operator[-] Other[1] operator[SEP] operator[?] Other[0] operator[:] identifier[doubleVector] operator[SEP] identifier[add] operator[SEP] identifier[newIndex] , identifier[delta] operator[SEP] operator[SEP]
}
|
public static Map<String, FieldAccess> getFieldsFromObject( Object object ) {
try {
Map<String, FieldAccess> fields;
if ( object instanceof Map ) {
fields = getFieldsFromMap( ( Map<String, Object> ) object );
} else {
fields = getPropertyFieldAccessMap( object.getClass() );
}
return fields;
} catch (Exception ex) {
requireNonNull(object, "Item cannot be null" );
return handle(Map.class, ex, "Unable to get fields from object", className(object));
}
} | class class_name[name] begin[{]
method[getFieldsFromObject, return_type[type[Map]], modifier[public static], parameter[object]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=fields)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=FieldAccess, sub_type=None))], dimensions=[], name=Map, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None)], member=getPropertyFieldAccessMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None))], member=getFieldsFromMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), ReturnStatement(expression=MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Item cannot be null")], member=requireNonNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Map, sub_type=None)), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to get fields from object"), MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=handle, postfix_operators=[], prefix_operators=[], qualifier=, 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)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[FieldAccess] operator[>] identifier[getFieldsFromObject] operator[SEP] identifier[Object] identifier[object] operator[SEP] {
Keyword[try] {
identifier[Map] operator[<] identifier[String] , identifier[FieldAccess] operator[>] identifier[fields] operator[SEP] Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[Map] operator[SEP] {
identifier[fields] operator[=] identifier[getFieldsFromMap] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] identifier[object] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[fields] operator[=] identifier[getPropertyFieldAccessMap] operator[SEP] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[fields] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[requireNonNull] operator[SEP] identifier[object] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[handle] operator[SEP] identifier[Map] operator[SEP] Keyword[class] , identifier[ex] , literal[String] , identifier[className] operator[SEP] identifier[object] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static Object find(PageContext pc, String name) {
Object ret = get(pc, name, PageContext.PAGE_SCOPE);
if (ret == null) {
ret = get(pc, name, PageContext.REQUEST_SCOPE);
if (ret == null) {
if (pc.getSession() != null) {
// check session only if a session is present
ret = get(pc, name, PageContext.SESSION_SCOPE);
}
if (ret == null) {
ret = get(pc, name, PageContext.APPLICATION_SCOPE);
if (ret == null) {
ret = pc.getServletContext().getInitParameter(name);
}
}
}
}
return ret;
} | class class_name[name] begin[{]
method[find, return_type[type[Object]], modifier[public static], parameter[pc, name]] begin[{]
local_variable[type[Object], ret]
if[binary_operation[member[.ret], ==, literal[null]]] begin[{]
assign[member[.ret], call[.get, parameter[member[.pc], member[.name], member[PageContext.REQUEST_SCOPE]]]]
if[binary_operation[member[.ret], ==, literal[null]]] begin[{]
if[binary_operation[call[pc.getSession, parameter[]], !=, literal[null]]] begin[{]
assign[member[.ret], call[.get, parameter[member[.pc], member[.name], member[PageContext.SESSION_SCOPE]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.ret], ==, literal[null]]] begin[{]
assign[member[.ret], call[.get, parameter[member[.pc], member[.name], member[PageContext.APPLICATION_SCOPE]]]]
if[binary_operation[member[.ret], ==, literal[null]]] begin[{]
assign[member[.ret], call[pc.getServletContext, parameter[]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.ret]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Object] identifier[find] operator[SEP] identifier[PageContext] identifier[pc] , identifier[String] identifier[name] operator[SEP] {
identifier[Object] identifier[ret] operator[=] identifier[get] operator[SEP] identifier[pc] , identifier[name] , identifier[PageContext] operator[SEP] identifier[PAGE_SCOPE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ret] operator[==] Other[null] operator[SEP] {
identifier[ret] operator[=] identifier[get] operator[SEP] identifier[pc] , identifier[name] , identifier[PageContext] operator[SEP] identifier[REQUEST_SCOPE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ret] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[pc] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[ret] operator[=] identifier[get] operator[SEP] identifier[pc] , identifier[name] , identifier[PageContext] operator[SEP] identifier[SESSION_SCOPE] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ret] operator[==] Other[null] operator[SEP] {
identifier[ret] operator[=] identifier[get] operator[SEP] identifier[pc] , identifier[name] , identifier[PageContext] operator[SEP] identifier[APPLICATION_SCOPE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ret] operator[==] Other[null] operator[SEP] {
identifier[ret] operator[=] identifier[pc] operator[SEP] identifier[getServletContext] operator[SEP] operator[SEP] operator[SEP] identifier[getInitParameter] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
}
}
}
Keyword[return] identifier[ret] operator[SEP]
}
|
static HttpResponseFactory resolveDefaultResponseFactory() {
Optional<ServiceDefinition<HttpResponseFactory>> definition = SoftServiceLoader.load(HttpResponseFactory.class)
.firstOr("io.micronaut.http.server.netty.NettyHttpResponseFactory", HttpResponseFactory.class.getClassLoader());
if (definition.isPresent()) {
ServiceDefinition<HttpResponseFactory> sd = definition.get();
try {
return sd.load();
} catch (Throwable e) {
LOG.warn("Unable to load default response factory for definition [" + definition + "]: " + e.getMessage(), e);
}
}
return new SimpleHttpResponseFactory();
} | class class_name[name] begin[{]
method[resolveDefaultResponseFactory, return_type[type[HttpResponseFactory]], modifier[static], parameter[]] begin[{]
local_variable[type[Optional], definition]
if[call[definition.isPresent, parameter[]]] begin[{]
local_variable[type[ServiceDefinition], sd]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=load, postfix_operators=[], prefix_operators=[], qualifier=sd, selectors=[], type_arguments=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="Unable to load default response factory for definition ["), operandr=MemberReference(member=definition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]: "), operator=+), 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=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SimpleHttpResponseFactory, sub_type=None))]
end[}]
END[}] | Keyword[static] identifier[HttpResponseFactory] identifier[resolveDefaultResponseFactory] operator[SEP] operator[SEP] {
identifier[Optional] operator[<] identifier[ServiceDefinition] operator[<] identifier[HttpResponseFactory] operator[>] operator[>] identifier[definition] operator[=] identifier[SoftServiceLoader] operator[SEP] identifier[load] operator[SEP] identifier[HttpResponseFactory] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[firstOr] operator[SEP] literal[String] , identifier[HttpResponseFactory] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[definition] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
identifier[ServiceDefinition] operator[<] identifier[HttpResponseFactory] operator[>] identifier[sd] operator[=] identifier[definition] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] identifier[sd] operator[SEP] identifier[load] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[definition] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[new] identifier[SimpleHttpResponseFactory] operator[SEP] operator[SEP] operator[SEP]
}
|
@SuppressWarnings({ "unchecked", "PMD.ShortVariable",
"PMD.AvoidDuplicateLiterals" })
public <C> C[] channels(Class<C> type) {
return Arrays.stream(channels)
.filter(c -> type.isAssignableFrom(c.getClass())).toArray(
size -> (C[]) Array.newInstance(type, size));
} | class class_name[name] begin[{]
method[channels, return_type[type[C]], modifier[public], parameter[type]] begin[{]
return[call[Arrays.stream, parameter[member[.channels]]]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String] , literal[String] , literal[String]
} operator[SEP] Keyword[public] operator[<] identifier[C] operator[>] identifier[C] operator[SEP] operator[SEP] identifier[channels] operator[SEP] identifier[Class] operator[<] identifier[C] operator[>] identifier[type] operator[SEP] {
Keyword[return] identifier[Arrays] operator[SEP] identifier[stream] operator[SEP] identifier[channels] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[c] operator[->] identifier[type] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[c] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] identifier[size] operator[->] operator[SEP] identifier[C] operator[SEP] operator[SEP] operator[SEP] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[type] , identifier[size] operator[SEP] operator[SEP] operator[SEP]
}
|
@CanIgnoreReturnValue
@GwtIncompatible // reflection
public static <V, X extends Exception> V getChecked(Future<V> future, Class<X> exceptionClass)
throws X {
return FuturesGetChecked.getChecked(future, exceptionClass);
} | class class_name[name] begin[{]
method[getChecked, return_type[type[V]], modifier[public static], parameter[future, exceptionClass]] begin[{]
return[call[FuturesGetChecked.getChecked, parameter[member[.future], member[.exceptionClass]]]]
end[}]
END[}] | annotation[@] identifier[CanIgnoreReturnValue] annotation[@] identifier[GwtIncompatible] Keyword[public] Keyword[static] operator[<] identifier[V] , identifier[X] Keyword[extends] identifier[Exception] operator[>] identifier[V] identifier[getChecked] operator[SEP] identifier[Future] operator[<] identifier[V] operator[>] identifier[future] , identifier[Class] operator[<] identifier[X] operator[>] identifier[exceptionClass] operator[SEP] Keyword[throws] identifier[X] {
Keyword[return] identifier[FuturesGetChecked] operator[SEP] identifier[getChecked] operator[SEP] identifier[future] , identifier[exceptionClass] operator[SEP] operator[SEP]
}
|
public void closeStaleConnections() {
logger.debug("closeStaleConnections() count before expiring: {}", getConnectionCount());
Set<ConnectionKey> stale = getStaleConnectionKeys();
for (ConnectionKey connectionKey : stale) {
connectionProvider.close(connectionKey);
}
logger.debug("closeStaleConnections() count after expiring: {}", getConnectionCount());
} | class class_name[name] begin[{]
method[closeStaleConnections, return_type[void], modifier[public], parameter[]] begin[{]
call[logger.debug, parameter[literal["closeStaleConnections() count before expiring: {}"], call[.getConnectionCount, parameter[]]]]
local_variable[type[Set], stale]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=connectionKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=connectionProvider, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=stale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=connectionKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConnectionKey, sub_type=None))), label=None)
call[logger.debug, parameter[literal["closeStaleConnections() count after expiring: {}"], call[.getConnectionCount, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[closeStaleConnections] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[getConnectionCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[ConnectionKey] operator[>] identifier[stale] operator[=] identifier[getStaleConnectionKeys] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ConnectionKey] identifier[connectionKey] operator[:] identifier[stale] operator[SEP] {
identifier[connectionProvider] operator[SEP] identifier[close] operator[SEP] identifier[connectionKey] operator[SEP] operator[SEP]
}
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[getConnectionCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static double getRmsdAtOrigin(Point3d[] fixed, Point3d[] moved) {
superposer.setCentered(true);
return superposer.getRmsd(fixed, moved);
} | class class_name[name] begin[{]
method[getRmsdAtOrigin, return_type[type[double]], modifier[public static], parameter[fixed, moved]] begin[{]
call[superposer.setCentered, parameter[literal[true]]]
return[call[superposer.getRmsd, parameter[member[.fixed], member[.moved]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[double] identifier[getRmsdAtOrigin] operator[SEP] identifier[Point3d] operator[SEP] operator[SEP] identifier[fixed] , identifier[Point3d] operator[SEP] operator[SEP] identifier[moved] operator[SEP] {
identifier[superposer] operator[SEP] identifier[setCentered] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[superposer] operator[SEP] identifier[getRmsd] operator[SEP] identifier[fixed] , identifier[moved] operator[SEP] operator[SEP]
}
|
public void setPlatformApplications(java.util.Collection<PlatformApplication> platformApplications) {
if (platformApplications == null) {
this.platformApplications = null;
return;
}
this.platformApplications = new com.amazonaws.internal.SdkInternalList<PlatformApplication>(platformApplications);
} | class class_name[name] begin[{]
method[setPlatformApplications, return_type[void], modifier[public], parameter[platformApplications]] begin[{]
if[binary_operation[member[.platformApplications], ==, literal[null]]] begin[{]
assign[THIS[member[None.platformApplications]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.platformApplications]], ClassCreator(arguments=[MemberReference(member=platformApplications, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PlatformApplication, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setPlatformApplications] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[PlatformApplication] operator[>] identifier[platformApplications] operator[SEP] {
Keyword[if] operator[SEP] identifier[platformApplications] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[platformApplications] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[platformApplications] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[PlatformApplication] operator[>] operator[SEP] identifier[platformApplications] operator[SEP] operator[SEP]
}
|
static void init(int slotId, Codec codec, org.omg.PortableInterceptor.Current piCurrent) {
TxServerInterceptor.slotId = slotId;
TxServerInterceptor.codec = codec;
TxServerInterceptor.piCurrent = piCurrent;
} | class class_name[name] begin[{]
method[init, return_type[void], modifier[static], parameter[slotId, codec, piCurrent]] begin[{]
assign[member[TxServerInterceptor.slotId], member[.slotId]]
assign[member[TxServerInterceptor.codec], member[.codec]]
assign[member[TxServerInterceptor.piCurrent], member[.piCurrent]]
end[}]
END[}] | Keyword[static] Keyword[void] identifier[init] operator[SEP] Keyword[int] identifier[slotId] , identifier[Codec] identifier[codec] , identifier[org] operator[SEP] identifier[omg] operator[SEP] identifier[PortableInterceptor] operator[SEP] identifier[Current] identifier[piCurrent] operator[SEP] {
identifier[TxServerInterceptor] operator[SEP] identifier[slotId] operator[=] identifier[slotId] operator[SEP] identifier[TxServerInterceptor] operator[SEP] identifier[codec] operator[=] identifier[codec] operator[SEP] identifier[TxServerInterceptor] operator[SEP] identifier[piCurrent] operator[=] identifier[piCurrent] operator[SEP]
}
|
public static <T> Collector<T, ?, List<T>> maxAll(Comparator<? super T> comparator) {
return maxAll(comparator, Integer.MAX_VALUE);
} | class class_name[name] begin[{]
method[maxAll, return_type[type[Collector]], modifier[public static], parameter[comparator]] begin[{]
return[call[.maxAll, parameter[member[.comparator], member[Integer.MAX_VALUE]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Collector] operator[<] identifier[T] , operator[?] , identifier[List] operator[<] identifier[T] operator[>] operator[>] identifier[maxAll] operator[SEP] identifier[Comparator] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[comparator] operator[SEP] {
Keyword[return] identifier[maxAll] operator[SEP] identifier[comparator] , identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP]
}
|
public static int executeUpdate(PreparedStatement ps, Object... params) throws SQLException {
StatementUtil.fillParams(ps, params);
return ps.executeUpdate();
} | class class_name[name] begin[{]
method[executeUpdate, return_type[type[int]], modifier[public static], parameter[ps, params]] begin[{]
call[StatementUtil.fillParams, parameter[member[.ps], member[.params]]]
return[call[ps.executeUpdate, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[executeUpdate] operator[SEP] identifier[PreparedStatement] identifier[ps] , identifier[Object] operator[...] identifier[params] operator[SEP] Keyword[throws] identifier[SQLException] {
identifier[StatementUtil] operator[SEP] identifier[fillParams] operator[SEP] identifier[ps] , identifier[params] operator[SEP] operator[SEP] Keyword[return] identifier[ps] operator[SEP] identifier[executeUpdate] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public final boolean filter() {
// supporting attributes here is difficult, because treetank
// does not provide a way to acces the name and namespace of
// the current attribute (attribute index is not known here)
checkState(mRtx.getNode().getKind() != IConstants.ATTRIBUTE,
"Wildcards are not supported in attribute names yet.");
if (mRtx.getNode().getKind() == IConstants.ELEMENT) {
if (mIsName) { // local name is given
final String localname =
mRtx.nameForKey(((ITreeNameData)mRtx.getNode()).getNameKey()).replaceFirst(".*:", "");
final int localnameKey = NamePageHash.generateHashForString(localname);
return localnameKey == mKnownPartKey;
} else { // namespace prefix is given
try {
final int nsCount = ((ElementNode)mRtx.getNode()).getNamespaceCount();
for (int i = 0; i < nsCount; i++) {
mRtx.moveTo(((ElementNode)mRtx.getNode()).getNamespaceKey(i));
final int prefixKey = mKnownPartKey;
if (((ITreeNameData)mRtx.getNode()).getNameKey() == prefixKey) {
mRtx.moveTo(mRtx.getNode().getParentKey());
return true;
}
mRtx.moveTo(mRtx.getNode().getParentKey());
}
} catch (TTIOException exc) {
throw new RuntimeException(exc);
}
}
}
return false;
} | class class_name[name] begin[{]
method[filter, return_type[type[boolean]], modifier[final public], parameter[]] begin[{]
call[.checkState, parameter[binary_operation[call[mRtx.getNode, parameter[]], !=, member[IConstants.ATTRIBUTE]], literal["Wildcards are not supported in attribute names yet."]]]
if[binary_operation[call[mRtx.getNode, parameter[]], ==, member[IConstants.ELEMENT]]] begin[{]
if[member[.mIsName]] begin[{]
local_variable[type[String], localname]
local_variable[type[int], localnameKey]
return[binary_operation[member[.localnameKey], ==, member[.mKnownPartKey]]]
else begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=mRtx, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ElementNode, sub_type=None)), name=nsCount)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=mRtx, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ElementNode, sub_type=None))], member=moveTo, postfix_operators=[], prefix_operators=[], qualifier=mRtx, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=mKnownPartKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=prefixKey)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=Cast(expression=MethodInvocation(arguments=[], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=mRtx, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ITreeNameData, sub_type=None)), operandr=MemberReference(member=prefixKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=mRtx, selectors=[MethodInvocation(arguments=[], member=getParentKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=moveTo, postfix_operators=[], prefix_operators=[], qualifier=mRtx, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=mRtx, selectors=[MethodInvocation(arguments=[], member=getParentKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=moveTo, postfix_operators=[], prefix_operators=[], qualifier=mRtx, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nsCount, 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)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=exc, 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=exc, types=['TTIOException']))], finally_block=None, label=None, resources=None)
end[}]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[boolean] identifier[filter] operator[SEP] operator[SEP] {
identifier[checkState] operator[SEP] identifier[mRtx] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] identifier[getKind] operator[SEP] operator[SEP] operator[!=] identifier[IConstants] operator[SEP] identifier[ATTRIBUTE] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mRtx] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] identifier[getKind] operator[SEP] operator[SEP] operator[==] identifier[IConstants] operator[SEP] identifier[ELEMENT] operator[SEP] {
Keyword[if] operator[SEP] identifier[mIsName] operator[SEP] {
Keyword[final] identifier[String] identifier[localname] operator[=] identifier[mRtx] operator[SEP] identifier[nameForKey] operator[SEP] operator[SEP] operator[SEP] identifier[ITreeNameData] operator[SEP] identifier[mRtx] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getNameKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[replaceFirst] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[localnameKey] operator[=] identifier[NamePageHash] operator[SEP] identifier[generateHashForString] operator[SEP] identifier[localname] operator[SEP] operator[SEP] Keyword[return] identifier[localnameKey] operator[==] identifier[mKnownPartKey] operator[SEP]
}
Keyword[else] {
Keyword[try] {
Keyword[final] Keyword[int] identifier[nsCount] operator[=] operator[SEP] operator[SEP] identifier[ElementNode] operator[SEP] identifier[mRtx] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getNamespaceCount] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[nsCount] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[mRtx] operator[SEP] identifier[moveTo] operator[SEP] operator[SEP] operator[SEP] identifier[ElementNode] operator[SEP] identifier[mRtx] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getNamespaceKey] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[prefixKey] operator[=] identifier[mKnownPartKey] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[ITreeNameData] operator[SEP] identifier[mRtx] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getNameKey] operator[SEP] operator[SEP] operator[==] identifier[prefixKey] operator[SEP] {
identifier[mRtx] operator[SEP] identifier[moveTo] operator[SEP] identifier[mRtx] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] identifier[getParentKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
identifier[mRtx] operator[SEP] identifier[moveTo] operator[SEP] identifier[mRtx] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] identifier[getParentKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[TTIOException] identifier[exc] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[exc] operator[SEP] operator[SEP]
}
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private boolean beginBlocking() {
begin();
synchronized (blockingThreads) {
if (isOpen()) {
blockingThreads.add(Thread.currentThread());
return true;
}
return false;
}
} | class class_name[name] begin[{]
method[beginBlocking, return_type[type[boolean]], modifier[private], parameter[]] begin[{]
call[.begin, parameter[]]
SYNCHRONIZED[member[.blockingThreads]] BEGIN[{]
if[call[.isOpen, parameter[]]] begin[{]
call[blockingThreads.add, parameter[call[Thread.currentThread, parameter[]]]]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
END[}]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[beginBlocking] operator[SEP] operator[SEP] {
identifier[begin] operator[SEP] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[blockingThreads] operator[SEP] {
Keyword[if] operator[SEP] identifier[isOpen] operator[SEP] operator[SEP] operator[SEP] {
identifier[blockingThreads] operator[SEP] identifier[add] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
}
|
public static Class<?> getPropertyClass(Class<?> clazz, List<String> propertyPath) {
Class<?> current = clazz;
for (String propertyName : propertyPath) {
current = getPropertyClass(current, propertyName);
}
return current;
} | class class_name[name] begin[{]
method[getPropertyClass, return_type[type[Class]], modifier[public static], parameter[clazz, propertyPath]] begin[{]
local_variable[type[Class], current]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPropertyClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=propertyPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=propertyName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.current]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Class] operator[<] operator[?] operator[>] identifier[getPropertyClass] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[List] operator[<] identifier[String] operator[>] identifier[propertyPath] operator[SEP] {
identifier[Class] operator[<] operator[?] operator[>] identifier[current] operator[=] identifier[clazz] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[propertyName] operator[:] identifier[propertyPath] operator[SEP] {
identifier[current] operator[=] identifier[getPropertyClass] operator[SEP] identifier[current] , identifier[propertyName] operator[SEP] operator[SEP]
}
Keyword[return] identifier[current] operator[SEP]
}
|
public void setPointFeatureData(List<PointFeature> obsData) throws IOException {
dataModel = new PointFeatureDataModel(obsData);
initTable(dataModel);
} | class class_name[name] begin[{]
method[setPointFeatureData, return_type[void], modifier[public], parameter[obsData]] begin[{]
assign[member[.dataModel], ClassCreator(arguments=[MemberReference(member=obsData, 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=PointFeatureDataModel, sub_type=None))]
call[.initTable, parameter[member[.dataModel]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setPointFeatureData] operator[SEP] identifier[List] operator[<] identifier[PointFeature] operator[>] identifier[obsData] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[dataModel] operator[=] Keyword[new] identifier[PointFeatureDataModel] operator[SEP] identifier[obsData] operator[SEP] operator[SEP] identifier[initTable] operator[SEP] identifier[dataModel] operator[SEP] operator[SEP]
}
|
public static Predicates<Object> equal(Object object)
{
if (object == null)
{
return Predicates.isNull();
}
return new EqualPredicate(object);
} | class class_name[name] begin[{]
method[equal, return_type[type[Predicates]], modifier[public static], parameter[object]] begin[{]
if[binary_operation[member[.object], ==, literal[null]]] begin[{]
return[call[Predicates.isNull, parameter[]]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=object, 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=EqualPredicate, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Predicates] operator[<] identifier[Object] operator[>] identifier[equal] operator[SEP] identifier[Object] identifier[object] operator[SEP] {
Keyword[if] operator[SEP] identifier[object] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[Predicates] operator[SEP] identifier[isNull] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[EqualPredicate] operator[SEP] identifier[object] operator[SEP] operator[SEP]
}
|
public void performRecovery(ObjectManagerState objectManagerState)
throws ObjectManagerException {
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
trace.entry(this,
cclass,
"performRecovery",
new Object[] { objectManagerState, logicalUnitOfWork, new Integer(transactionState), token });
// Delete the ManagedObject again using its original Transaction.
Transaction transactionForRecovery = objectManagerState.getTransaction(logicalUnitOfWork);
ManagedObject existingManagedObject = token.getManagedObject();
if (existingManagedObject == null)
{
// The object may have already been deleted from the ObjectStore,
// so create a dummy object to keep the transaction happy.
// The Token will have the ObjecStore and storedObjectIdentifier so the the correct delete in the
// ObjectStore can take place.
DummyManagedObject dummyManagedObject = new DummyManagedObject("Created by TransactionDeleteLogRecord.performRecovery()");
existingManagedObject = token.setManagedObject(dummyManagedObject);
existingManagedObject.state = ManagedObject.stateReady;
} // if (existingManagedObject == null).
// Redo the delete.
transactionForRecovery.delete(existingManagedObject);
// No need to reset the transaction state because Delete can only be executed before
// the transaction is prepared.
// transactionForRecovery.internalTransaction.resetState(transactionState);
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
trace.exit(this, cclass, "performRecovery");
} | class class_name[name] begin[{]
method[performRecovery, return_type[void], modifier[public], parameter[objectManagerState]] begin[{]
if[binary_operation[call[Tracing.isAnyTracingEnabled, parameter[]], &&, call[trace.isEntryEnabled, parameter[]]]] begin[{]
call[trace.entry, parameter[THIS[], member[.cclass], literal["performRecovery"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=objectManagerState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=logicalUnitOfWork, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=transactionState, 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=Integer, sub_type=None)), MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
else begin[{]
None
end[}]
local_variable[type[Transaction], transactionForRecovery]
local_variable[type[ManagedObject], existingManagedObject]
if[binary_operation[member[.existingManagedObject], ==, literal[null]]] begin[{]
local_variable[type[DummyManagedObject], dummyManagedObject]
assign[member[.existingManagedObject], call[token.setManagedObject, parameter[member[.dummyManagedObject]]]]
assign[member[existingManagedObject.state], member[ManagedObject.stateReady]]
else begin[{]
None
end[}]
call[transactionForRecovery.delete, parameter[member[.existingManagedObject]]]
if[binary_operation[call[Tracing.isAnyTracingEnabled, parameter[]], &&, call[trace.isEntryEnabled, parameter[]]]] begin[{]
call[trace.exit, parameter[THIS[], member[.cclass], literal["performRecovery"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[performRecovery] operator[SEP] identifier[ObjectManagerState] identifier[objectManagerState] operator[SEP] Keyword[throws] identifier[ObjectManagerException] {
Keyword[if] operator[SEP] identifier[Tracing] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[trace] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[objectManagerState] , identifier[logicalUnitOfWork] , Keyword[new] identifier[Integer] operator[SEP] identifier[transactionState] operator[SEP] , identifier[token]
} operator[SEP] operator[SEP] identifier[Transaction] identifier[transactionForRecovery] operator[=] identifier[objectManagerState] operator[SEP] identifier[getTransaction] operator[SEP] identifier[logicalUnitOfWork] operator[SEP] operator[SEP] identifier[ManagedObject] identifier[existingManagedObject] operator[=] identifier[token] operator[SEP] identifier[getManagedObject] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[existingManagedObject] operator[==] Other[null] operator[SEP] {
identifier[DummyManagedObject] identifier[dummyManagedObject] operator[=] Keyword[new] identifier[DummyManagedObject] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[existingManagedObject] operator[=] identifier[token] operator[SEP] identifier[setManagedObject] operator[SEP] identifier[dummyManagedObject] operator[SEP] operator[SEP] identifier[existingManagedObject] operator[SEP] identifier[state] operator[=] identifier[ManagedObject] operator[SEP] identifier[stateReady] operator[SEP]
}
identifier[transactionForRecovery] operator[SEP] identifier[delete] operator[SEP] identifier[existingManagedObject] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Tracing] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[trace] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] operator[SEP] operator[SEP]
}
|
public static void setInputFormatClass(Class<?> clazz, Job job) {
job.setInputFormatClass(MultiInputFormat.class);
setClassConf(clazz, HadoopCompat.getConfiguration(job));
} | class class_name[name] begin[{]
method[setInputFormatClass, return_type[void], modifier[public static], parameter[clazz, job]] begin[{]
call[job.setInputFormatClass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MultiInputFormat, sub_type=None))]]
call[.setClassConf, parameter[member[.clazz], call[HadoopCompat.getConfiguration, parameter[member[.job]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[setInputFormatClass] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[Job] identifier[job] operator[SEP] {
identifier[job] operator[SEP] identifier[setInputFormatClass] operator[SEP] identifier[MultiInputFormat] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[setClassConf] operator[SEP] identifier[clazz] , identifier[HadoopCompat] operator[SEP] identifier[getConfiguration] operator[SEP] identifier[job] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public EquPart morph() throws Exception
{
final EquPart part = Equ.getInstance().operator(this);
if (part == null)
return this;
return part;
} | class class_name[name] begin[{]
method[morph, return_type[type[EquPart]], modifier[public], parameter[]] begin[{]
local_variable[type[EquPart], part]
if[binary_operation[member[.part], ==, literal[null]]] begin[{]
return[THIS[]]
else begin[{]
None
end[}]
return[member[.part]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[EquPart] identifier[morph] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[final] identifier[EquPart] identifier[part] operator[=] identifier[Equ] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[operator] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[part] operator[==] Other[null] operator[SEP] Keyword[return] Keyword[this] operator[SEP] Keyword[return] identifier[part] operator[SEP]
}
|
@SuppressWarnings("unchecked") public Map<String, Object> getCustomProperties()
{
return (Map<String, Object>) getCachedValue(ProjectField.CUSTOM_PROPERTIES);
} | class class_name[name] begin[{]
method[getCustomProperties, return_type[type[Map]], modifier[public], parameter[]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=CUSTOM_PROPERTIES, postfix_operators=[], prefix_operators=[], qualifier=ProjectField, selectors=[])], member=getCachedValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[getCustomProperties] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] identifier[getCachedValue] operator[SEP] identifier[ProjectField] operator[SEP] identifier[CUSTOM_PROPERTIES] operator[SEP] operator[SEP]
}
|
public void push(int value) {
if (value > 0 && value <= 5) {
visitInsn(Constants.ICONST_0 + value);
} else {
visitLdcInsn(value);
}
} | class class_name[name] begin[{]
method[push, return_type[void], modifier[public], parameter[value]] begin[{]
if[binary_operation[binary_operation[member[.value], >, literal[0]], &&, binary_operation[member[.value], <=, literal[5]]]] begin[{]
call[.visitInsn, parameter[binary_operation[member[Constants.ICONST_0], +, member[.value]]]]
else begin[{]
call[.visitLdcInsn, parameter[member[.value]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[push] operator[SEP] Keyword[int] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[>] Other[0] operator[&&] identifier[value] operator[<=] Other[5] operator[SEP] {
identifier[visitInsn] operator[SEP] identifier[Constants] operator[SEP] identifier[ICONST_0] operator[+] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[visitLdcInsn] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
|
protected void growAndCopy() {
if (textLen == text.length) {
int newSize = text.length << 1;
char[] newText = new char[newSize];
if (textLen > 0) {
System.arraycopy(text, 0, newText, 0, textLen);
}
text = newText;
}
} | class class_name[name] begin[{]
method[growAndCopy, return_type[void], modifier[protected], parameter[]] begin[{]
if[binary_operation[member[.textLen], ==, member[text.length]]] begin[{]
local_variable[type[int], newSize]
local_variable[type[char], newText]
if[binary_operation[member[.textLen], >, literal[0]]] begin[{]
call[System.arraycopy, parameter[member[.text], literal[0], member[.newText], literal[0], member[.textLen]]]
else begin[{]
None
end[}]
assign[member[.text], member[.newText]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[growAndCopy] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[textLen] operator[==] identifier[text] operator[SEP] identifier[length] operator[SEP] {
Keyword[int] identifier[newSize] operator[=] identifier[text] operator[SEP] identifier[length] operator[<<] Other[1] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[newText] operator[=] Keyword[new] Keyword[char] operator[SEP] identifier[newSize] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[textLen] operator[>] Other[0] operator[SEP] {
identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[text] , Other[0] , identifier[newText] , Other[0] , identifier[textLen] operator[SEP] operator[SEP]
}
identifier[text] operator[=] identifier[newText] operator[SEP]
}
}
|
public synchronized void scaleTextSize(float scaleFactor, byte zoomLevel) {
if (!textScales.containsKey(zoomLevel) || scaleFactor != textScales.get(zoomLevel)) {
for (int i = 0, n = this.rulesList.size(); i < n; ++i) {
Rule rule = this.rulesList.get(i);
if (rule.zoomMin <= zoomLevel && rule.zoomMax >= zoomLevel) {
rule.scaleTextSize(scaleFactor * this.baseTextSize, zoomLevel);
}
}
textScales.put(zoomLevel, scaleFactor);
}
} | class class_name[name] begin[{]
method[scaleTextSize, return_type[void], modifier[synchronized public], parameter[scaleFactor, zoomLevel]] begin[{]
if[binary_operation[call[textScales.containsKey, parameter[member[.zoomLevel]]], ||, binary_operation[member[.scaleFactor], !=, call[textScales.get, parameter[member[.zoomLevel]]]]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=rulesList, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=rule)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Rule, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=zoomMin, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[]), operandr=MemberReference(member=zoomLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operandr=BinaryOperation(operandl=MemberReference(member=zoomMax, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[]), operandr=MemberReference(member=zoomLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=scaleFactor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=baseTextSize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=*), MemberReference(member=zoomLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=scaleTextSize, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, 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), VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=rulesList, 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)]), name=n)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
call[textScales.put, parameter[member[.zoomLevel], member[.scaleFactor]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[void] identifier[scaleTextSize] operator[SEP] Keyword[float] identifier[scaleFactor] , Keyword[byte] identifier[zoomLevel] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[textScales] operator[SEP] identifier[containsKey] operator[SEP] identifier[zoomLevel] operator[SEP] operator[||] identifier[scaleFactor] operator[!=] identifier[textScales] operator[SEP] identifier[get] operator[SEP] identifier[zoomLevel] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[n] operator[=] Keyword[this] operator[SEP] identifier[rulesList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[Rule] identifier[rule] operator[=] Keyword[this] operator[SEP] identifier[rulesList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rule] operator[SEP] identifier[zoomMin] operator[<=] identifier[zoomLevel] operator[&&] identifier[rule] operator[SEP] identifier[zoomMax] operator[>=] identifier[zoomLevel] operator[SEP] {
identifier[rule] operator[SEP] identifier[scaleTextSize] operator[SEP] identifier[scaleFactor] operator[*] Keyword[this] operator[SEP] identifier[baseTextSize] , identifier[zoomLevel] operator[SEP] operator[SEP]
}
}
identifier[textScales] operator[SEP] identifier[put] operator[SEP] identifier[zoomLevel] , identifier[scaleFactor] operator[SEP] operator[SEP]
}
}
|
private void touchFixed() {
assert this.dense;
assert this.level == 0;
assert this.schedule;
while (this.touched < this.trail.size()) {
final int lit = this.trail.get(this.touched++);
assert val(lit) > 0;
assert var(lit).level() == 0;
final CLOccs os = occs(lit);
for (final CLClause c : os) {
for (int i = 0; i < c.lits().size(); i++) {
final int other = c.lits().get(i);
if (val(other) == VALUE_TRUE) { continue; }
assert other != lit;
touch(other);
}
}
}
} | class class_name[name] begin[{]
method[touchFixed, return_type[void], modifier[private], parameter[]] begin[{]
AssertStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=dense, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), label=None, value=None)
AssertStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=level, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), label=None, value=None)
AssertStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=schedule, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), label=None, value=None)
while[binary_operation[THIS[member[None.touched]], <, THIS[member[None.trail]call[None.size, parameter[]]]]] begin[{]
local_variable[type[int], lit]
AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=lit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None, value=None)
AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=lit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=var, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=level, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), label=None, value=None)
local_variable[type[CLOccs], os]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=lits, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=other)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MemberReference(member=VALUE_TRUE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=lit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), label=None, value=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=touch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=lits, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=os, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=CLClause, sub_type=None))), label=None)
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[touchFixed] operator[SEP] operator[SEP] {
Keyword[assert] Keyword[this] operator[SEP] identifier[dense] operator[SEP] Keyword[assert] Keyword[this] operator[SEP] identifier[level] operator[==] Other[0] operator[SEP] Keyword[assert] Keyword[this] operator[SEP] identifier[schedule] operator[SEP] Keyword[while] operator[SEP] Keyword[this] operator[SEP] identifier[touched] operator[<] Keyword[this] operator[SEP] identifier[trail] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] Keyword[int] identifier[lit] operator[=] Keyword[this] operator[SEP] identifier[trail] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] identifier[touched] operator[++] operator[SEP] operator[SEP] Keyword[assert] identifier[val] operator[SEP] identifier[lit] operator[SEP] operator[>] Other[0] operator[SEP] Keyword[assert] identifier[var] operator[SEP] identifier[lit] operator[SEP] operator[SEP] identifier[level] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[final] identifier[CLOccs] identifier[os] operator[=] identifier[occs] operator[SEP] identifier[lit] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[CLClause] identifier[c] operator[:] identifier[os] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[c] operator[SEP] identifier[lits] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[final] Keyword[int] identifier[other] operator[=] identifier[c] operator[SEP] identifier[lits] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[val] operator[SEP] identifier[other] operator[SEP] operator[==] identifier[VALUE_TRUE] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[assert] identifier[other] operator[!=] identifier[lit] operator[SEP] identifier[touch] operator[SEP] identifier[other] operator[SEP] operator[SEP]
}
}
}
}
|
public final void setMaxValue(final int maxValue) {
Condition.INSTANCE.ensureGreater(maxValue, getMinValue(),
"The maximum value must be greater than the minimum value");
this.maxValue = maxValue;
setValue(Math.min(getValue(), maxValue));
} | class class_name[name] begin[{]
method[setMaxValue, return_type[void], modifier[final public], parameter[maxValue]] begin[{]
call[Condition.INSTANCE.ensureGreater, parameter[member[.maxValue], call[.getMinValue, parameter[]], literal["The maximum value must be greater than the minimum value"]]]
assign[THIS[member[None.maxValue]], member[.maxValue]]
call[.setValue, parameter[call[Math.min, parameter[call[.getValue, parameter[]], member[.maxValue]]]]]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[setMaxValue] operator[SEP] Keyword[final] Keyword[int] identifier[maxValue] operator[SEP] {
identifier[Condition] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[ensureGreater] operator[SEP] identifier[maxValue] , identifier[getMinValue] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[maxValue] operator[=] identifier[maxValue] operator[SEP] identifier[setValue] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[maxValue] operator[SEP] operator[SEP] operator[SEP]
}
|
private List<String> getBusinessServiceList(String firstName, String lastName){
List<String> businessServiceList = new ArrayList<>();
List<Cmdb> cmdbs = cmdbService.getAllBusServices();
/**
Defining search parameters
*/
Predicate<Cmdb> supportOwnerLn = p -> p.getSupportOwner() != null ? p.getSupportOwner().toLowerCase().contains(lastName) : false;
Predicate<Cmdb> serviceOwnerLn = p -> p.getAppServiceOwner() != null ? p.getAppServiceOwner().toLowerCase().contains(lastName) : false;
Predicate<Cmdb> developmentOwnerLn = p -> p.getDevelopmentOwner() != null ? p.getDevelopmentOwner().toLowerCase().contains(lastName) : false;
Predicate<Cmdb> businessOwnerLn = p -> p.getBusinessOwner() != null ? p.getBusinessOwner().toLowerCase().contains(lastName) : false;
/**
* Combining search parameters into one predicate OR search
*/
Predicate<Cmdb> fullPredicate = supportOwnerLn.or(serviceOwnerLn).or(developmentOwnerLn).or(businessOwnerLn);
/**
* Executes search based on parameters created above and returns matching list
*/
List<Cmdb> matching = cmdbs.stream().filter(fullPredicate).collect(Collectors.toList());
for(Cmdb cmdb: matching){
String businessServiceApp = cmdb.getConfigurationItem();
boolean serviceOwnerMatch = doesMatchFullName(firstName, cmdb.getAppServiceOwner());
boolean businessOwnerMatch = doesMatchFullName(firstName, cmdb.getBusinessOwner());
boolean supportOwnerMatch = doesMatchFullName(firstName, cmdb.getSupportOwner());
boolean developmentOwnerMatch = doesMatchFullName(firstName, cmdb.getDevelopmentOwner());
if((serviceOwnerMatch || businessOwnerMatch || supportOwnerMatch || developmentOwnerMatch)
&& !businessServiceList.contains(businessServiceApp)){
businessServiceList.add(businessServiceApp);
}
}
return businessServiceList;
} | class class_name[name] begin[{]
method[getBusinessServiceList, return_type[type[List]], modifier[private], parameter[firstName, lastName]] begin[{]
local_variable[type[List], businessServiceList]
local_variable[type[List], cmdbs]
local_variable[type[Predicate], supportOwnerLn]
local_variable[type[Predicate], serviceOwnerLn]
local_variable[type[Predicate], developmentOwnerLn]
local_variable[type[Predicate], businessOwnerLn]
local_variable[type[Predicate], fullPredicate]
local_variable[type[List], matching]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getConfigurationItem, postfix_operators=[], prefix_operators=[], qualifier=cmdb, selectors=[], type_arguments=None), name=businessServiceApp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=firstName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getAppServiceOwner, postfix_operators=[], prefix_operators=[], qualifier=cmdb, selectors=[], type_arguments=None)], member=doesMatchFullName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=serviceOwnerMatch)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=firstName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getBusinessOwner, postfix_operators=[], prefix_operators=[], qualifier=cmdb, selectors=[], type_arguments=None)], member=doesMatchFullName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=businessOwnerMatch)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=firstName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getSupportOwner, postfix_operators=[], prefix_operators=[], qualifier=cmdb, selectors=[], type_arguments=None)], member=doesMatchFullName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=supportOwnerMatch)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=firstName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getDevelopmentOwner, postfix_operators=[], prefix_operators=[], qualifier=cmdb, selectors=[], type_arguments=None)], member=doesMatchFullName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=developmentOwnerMatch)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=serviceOwnerMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=businessOwnerMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), operandr=MemberReference(member=supportOwnerMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), operandr=MemberReference(member=developmentOwnerMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), operandr=MethodInvocation(arguments=[MemberReference(member=businessServiceApp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=businessServiceList, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=businessServiceApp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=businessServiceList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=matching, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cmdb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Cmdb, sub_type=None))), label=None)
return[member[.businessServiceList]]
end[}]
END[}] | Keyword[private] identifier[List] operator[<] identifier[String] operator[>] identifier[getBusinessServiceList] operator[SEP] identifier[String] identifier[firstName] , identifier[String] identifier[lastName] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[businessServiceList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Cmdb] operator[>] identifier[cmdbs] operator[=] identifier[cmdbService] operator[SEP] identifier[getAllBusServices] operator[SEP] operator[SEP] operator[SEP] identifier[Predicate] operator[<] identifier[Cmdb] operator[>] identifier[supportOwnerLn] operator[=] identifier[p] operator[->] identifier[p] operator[SEP] identifier[getSupportOwner] operator[SEP] operator[SEP] operator[!=] Other[null] operator[?] identifier[p] operator[SEP] identifier[getSupportOwner] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[lastName] operator[SEP] operator[:] literal[boolean] operator[SEP] identifier[Predicate] operator[<] identifier[Cmdb] operator[>] identifier[serviceOwnerLn] operator[=] identifier[p] operator[->] identifier[p] operator[SEP] identifier[getAppServiceOwner] operator[SEP] operator[SEP] operator[!=] Other[null] operator[?] identifier[p] operator[SEP] identifier[getAppServiceOwner] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[lastName] operator[SEP] operator[:] literal[boolean] operator[SEP] identifier[Predicate] operator[<] identifier[Cmdb] operator[>] identifier[developmentOwnerLn] operator[=] identifier[p] operator[->] identifier[p] operator[SEP] identifier[getDevelopmentOwner] operator[SEP] operator[SEP] operator[!=] Other[null] operator[?] identifier[p] operator[SEP] identifier[getDevelopmentOwner] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[lastName] operator[SEP] operator[:] literal[boolean] operator[SEP] identifier[Predicate] operator[<] identifier[Cmdb] operator[>] identifier[businessOwnerLn] operator[=] identifier[p] operator[->] identifier[p] operator[SEP] identifier[getBusinessOwner] operator[SEP] operator[SEP] operator[!=] Other[null] operator[?] identifier[p] operator[SEP] identifier[getBusinessOwner] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[lastName] operator[SEP] operator[:] literal[boolean] operator[SEP] identifier[Predicate] operator[<] identifier[Cmdb] operator[>] identifier[fullPredicate] operator[=] identifier[supportOwnerLn] operator[SEP] identifier[or] operator[SEP] identifier[serviceOwnerLn] operator[SEP] operator[SEP] identifier[or] operator[SEP] identifier[developmentOwnerLn] operator[SEP] operator[SEP] identifier[or] operator[SEP] identifier[businessOwnerLn] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Cmdb] operator[>] identifier[matching] operator[=] identifier[cmdbs] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[fullPredicate] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Cmdb] identifier[cmdb] operator[:] identifier[matching] operator[SEP] {
identifier[String] identifier[businessServiceApp] operator[=] identifier[cmdb] operator[SEP] identifier[getConfigurationItem] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[serviceOwnerMatch] operator[=] identifier[doesMatchFullName] operator[SEP] identifier[firstName] , identifier[cmdb] operator[SEP] identifier[getAppServiceOwner] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[businessOwnerMatch] operator[=] identifier[doesMatchFullName] operator[SEP] identifier[firstName] , identifier[cmdb] operator[SEP] identifier[getBusinessOwner] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[supportOwnerMatch] operator[=] identifier[doesMatchFullName] operator[SEP] identifier[firstName] , identifier[cmdb] operator[SEP] identifier[getSupportOwner] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[developmentOwnerMatch] operator[=] identifier[doesMatchFullName] operator[SEP] identifier[firstName] , identifier[cmdb] operator[SEP] identifier[getDevelopmentOwner] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[serviceOwnerMatch] operator[||] identifier[businessOwnerMatch] operator[||] identifier[supportOwnerMatch] operator[||] identifier[developmentOwnerMatch] operator[SEP] operator[&&] operator[!] identifier[businessServiceList] operator[SEP] identifier[contains] operator[SEP] identifier[businessServiceApp] operator[SEP] operator[SEP] {
identifier[businessServiceList] operator[SEP] identifier[add] operator[SEP] identifier[businessServiceApp] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[businessServiceList] operator[SEP]
}
|
private void expectedByte(int position, int count)
throws UTFDataFormatException {
String msg = JspCoreException.getMsg("jsp.error.xml.expectedByte", new Object[] {Integer.toString(position), Integer.toString(count)});
throw new UTFDataFormatException(msg);
} | class class_name[name] begin[{]
method[expectedByte, return_type[void], modifier[private], parameter[position, count]] begin[{]
local_variable[type[String], msg]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=msg, 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=UTFDataFormatException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[expectedByte] operator[SEP] Keyword[int] identifier[position] , Keyword[int] identifier[count] operator[SEP] Keyword[throws] identifier[UTFDataFormatException] {
identifier[String] identifier[msg] operator[=] identifier[JspCoreException] operator[SEP] identifier[getMsg] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[position] operator[SEP] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[count] operator[SEP]
} operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[UTFDataFormatException] operator[SEP] identifier[msg] operator[SEP] operator[SEP]
}
|
@Override
public AttachPolicyResult attachPolicy(AttachPolicyRequest request) {
request = beforeClientExecution(request);
return executeAttachPolicy(request);
} | class class_name[name] begin[{]
method[attachPolicy, return_type[type[AttachPolicyResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeAttachPolicy, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[AttachPolicyResult] identifier[attachPolicy] operator[SEP] identifier[AttachPolicyRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeAttachPolicy] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public void addMatch(String name, PseudoClassType pseudoClass)
{
if (names == null)
names = new HashMap<String, Set<PseudoClassType>>();
Set<PseudoClassType> classes = names.get(name);
if (classes == null)
{
classes = new HashSet<PseudoClassType>(2);
names.put(name, classes);
}
classes.add(pseudoClass);
} | class class_name[name] begin[{]
method[addMatch, return_type[void], modifier[public], parameter[name, pseudoClass]] begin[{]
if[binary_operation[member[.names], ==, literal[null]]] begin[{]
assign[member[.names], 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=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PseudoClassType, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[Set], classes]
if[binary_operation[member[.classes], ==, literal[null]]] begin[{]
assign[member[.classes], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], 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=PseudoClassType, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))]
call[names.put, parameter[member[.name], member[.classes]]]
else begin[{]
None
end[}]
call[classes.add, parameter[member[.pseudoClass]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addMatch] operator[SEP] identifier[String] identifier[name] , identifier[PseudoClassType] identifier[pseudoClass] operator[SEP] {
Keyword[if] operator[SEP] identifier[names] operator[==] Other[null] operator[SEP] identifier[names] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Set] operator[<] identifier[PseudoClassType] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[PseudoClassType] operator[>] identifier[classes] operator[=] identifier[names] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[classes] operator[==] Other[null] operator[SEP] {
identifier[classes] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[PseudoClassType] operator[>] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[names] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[classes] operator[SEP] operator[SEP]
}
identifier[classes] operator[SEP] identifier[add] operator[SEP] identifier[pseudoClass] operator[SEP] operator[SEP]
}
|
public static <T, U> ToLongBiFunction<T, U> toLongBiFunction(CheckedToLongBiFunction<T, U> function) {
return Unchecked.toLongBiFunction(function, Unchecked.RETHROW_ALL);
} | class class_name[name] begin[{]
method[toLongBiFunction, return_type[type[ToLongBiFunction]], modifier[public static], parameter[function]] begin[{]
return[call[Unchecked.toLongBiFunction, parameter[member[.function], member[Unchecked.RETHROW_ALL]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[U] operator[>] identifier[ToLongBiFunction] operator[<] identifier[T] , identifier[U] operator[>] identifier[toLongBiFunction] operator[SEP] identifier[CheckedToLongBiFunction] operator[<] identifier[T] , identifier[U] operator[>] identifier[function] operator[SEP] {
Keyword[return] identifier[Unchecked] operator[SEP] identifier[toLongBiFunction] operator[SEP] identifier[function] , identifier[Unchecked] operator[SEP] identifier[RETHROW_ALL] operator[SEP] operator[SEP]
}
|
public AVIMConversationsQuery whereNear(String key, AVGeoPoint point) {
conditions.whereNear(key, point);
return this;
} | class class_name[name] begin[{]
method[whereNear, return_type[type[AVIMConversationsQuery]], modifier[public], parameter[key, point]] begin[{]
call[conditions.whereNear, parameter[member[.key], member[.point]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[AVIMConversationsQuery] identifier[whereNear] operator[SEP] identifier[String] identifier[key] , identifier[AVGeoPoint] identifier[point] operator[SEP] {
identifier[conditions] operator[SEP] identifier[whereNear] operator[SEP] identifier[key] , identifier[point] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
private void checkViewSources(ArrayList<Table> tableList) throws VoltCompilerException {
HashSet<String> tableSet = new HashSet<>();
for (Table tbl : tableList) {
if (! tableSet.add(tbl.getTypeName())) {
String errMsg = "Table " + tbl.getTypeName() + " appeared in the table list more than once: " +
"materialized view does not support self-join.";
throw m_compiler.new VoltCompilerException(errMsg);
}
}
} | class class_name[name] begin[{]
method[checkViewSources, return_type[void], modifier[private], parameter[tableList]] begin[{]
local_variable[type[HashSet], tableSet]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTypeName, postfix_operators=[], prefix_operators=[], qualifier=tbl, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=['!'], qualifier=tableSet, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Table "), operandr=MethodInvocation(arguments=[], member=getTypeName, postfix_operators=[], prefix_operators=[], qualifier=tbl, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" appeared in the table list more than once: "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="materialized view does not support self-join."), operator=+), name=errMsg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=InnerClassCreator(arguments=[MemberReference(member=errMsg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=m_compiler, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VoltCompilerException, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=tableList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tbl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Table, sub_type=None))), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[checkViewSources] operator[SEP] identifier[ArrayList] operator[<] identifier[Table] operator[>] identifier[tableList] operator[SEP] Keyword[throws] identifier[VoltCompilerException] {
identifier[HashSet] operator[<] identifier[String] operator[>] identifier[tableSet] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Table] identifier[tbl] operator[:] identifier[tableList] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[tableSet] operator[SEP] identifier[add] operator[SEP] identifier[tbl] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[errMsg] operator[=] literal[String] operator[+] identifier[tbl] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] Keyword[throw] identifier[m_compiler] operator[SEP] Keyword[new] identifier[VoltCompilerException] operator[SEP] identifier[errMsg] operator[SEP] operator[SEP]
}
}
}
|
private X509Certificate createCACert(PublicKey publicKey, PrivateKey privateKey) throws Exception {
// signers name
X500Name issuerName = new X500Name("CN=www.mockserver.com, O=MockServer, L=London, ST=England, C=UK");
// subjects name - the same as we are self signed.
X500Name subjectName = issuerName;
// serial
BigInteger serial = BigInteger.valueOf(new Random().nextInt(Integer.MAX_VALUE));
// create the certificate - version 3
X509v3CertificateBuilder builder = new JcaX509v3CertificateBuilder(issuerName, serial, NOT_BEFORE, NOT_AFTER, subjectName, publicKey);
builder.addExtension(Extension.subjectKeyIdentifier, false, createSubjectKeyIdentifier(publicKey));
builder.addExtension(Extension.basicConstraints, true, new BasicConstraints(true));
KeyUsage usage = new KeyUsage(KeyUsage.keyCertSign | KeyUsage.digitalSignature | KeyUsage.keyEncipherment | KeyUsage.dataEncipherment | KeyUsage.cRLSign);
builder.addExtension(Extension.keyUsage, false, usage);
ASN1EncodableVector purposes = new ASN1EncodableVector();
purposes.add(KeyPurposeId.id_kp_serverAuth);
purposes.add(KeyPurposeId.id_kp_clientAuth);
purposes.add(KeyPurposeId.anyExtendedKeyUsage);
builder.addExtension(Extension.extendedKeyUsage, false, new DERSequence(purposes));
X509Certificate cert = signCertificate(builder, privateKey);
cert.checkValidity(new Date());
cert.verify(publicKey);
return cert;
} | class class_name[name] begin[{]
method[createCACert, return_type[type[X509Certificate]], modifier[private], parameter[publicKey, privateKey]] begin[{]
local_variable[type[X500Name], issuerName]
local_variable[type[X500Name], subjectName]
local_variable[type[BigInteger], serial]
local_variable[type[X509v3CertificateBuilder], builder]
call[builder.addExtension, parameter[member[Extension.subjectKeyIdentifier], literal[false], call[.createSubjectKeyIdentifier, parameter[member[.publicKey]]]]]
call[builder.addExtension, parameter[member[Extension.basicConstraints], literal[true], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BasicConstraints, sub_type=None))]]
local_variable[type[KeyUsage], usage]
call[builder.addExtension, parameter[member[Extension.keyUsage], literal[false], member[.usage]]]
local_variable[type[ASN1EncodableVector], purposes]
call[purposes.add, parameter[member[KeyPurposeId.id_kp_serverAuth]]]
call[purposes.add, parameter[member[KeyPurposeId.id_kp_clientAuth]]]
call[purposes.add, parameter[member[KeyPurposeId.anyExtendedKeyUsage]]]
call[builder.addExtension, parameter[member[Extension.extendedKeyUsage], literal[false], ClassCreator(arguments=[MemberReference(member=purposes, 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=DERSequence, sub_type=None))]]
local_variable[type[X509Certificate], cert]
call[cert.checkValidity, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]]
call[cert.verify, parameter[member[.publicKey]]]
return[member[.cert]]
end[}]
END[}] | Keyword[private] identifier[X509Certificate] identifier[createCACert] operator[SEP] identifier[PublicKey] identifier[publicKey] , identifier[PrivateKey] identifier[privateKey] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[X500Name] identifier[issuerName] operator[=] Keyword[new] identifier[X500Name] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[X500Name] identifier[subjectName] operator[=] identifier[issuerName] operator[SEP] identifier[BigInteger] identifier[serial] operator[=] identifier[BigInteger] operator[SEP] identifier[valueOf] operator[SEP] Keyword[new] identifier[Random] operator[SEP] operator[SEP] operator[SEP] identifier[nextInt] operator[SEP] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] operator[SEP] identifier[X509v3CertificateBuilder] identifier[builder] operator[=] Keyword[new] identifier[JcaX509v3CertificateBuilder] operator[SEP] identifier[issuerName] , identifier[serial] , identifier[NOT_BEFORE] , identifier[NOT_AFTER] , identifier[subjectName] , identifier[publicKey] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[addExtension] operator[SEP] identifier[Extension] operator[SEP] identifier[subjectKeyIdentifier] , literal[boolean] , identifier[createSubjectKeyIdentifier] operator[SEP] identifier[publicKey] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[addExtension] operator[SEP] identifier[Extension] operator[SEP] identifier[basicConstraints] , literal[boolean] , Keyword[new] identifier[BasicConstraints] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[KeyUsage] identifier[usage] operator[=] Keyword[new] identifier[KeyUsage] operator[SEP] identifier[KeyUsage] operator[SEP] identifier[keyCertSign] operator[|] identifier[KeyUsage] operator[SEP] identifier[digitalSignature] operator[|] identifier[KeyUsage] operator[SEP] identifier[keyEncipherment] operator[|] identifier[KeyUsage] operator[SEP] identifier[dataEncipherment] operator[|] identifier[KeyUsage] operator[SEP] identifier[cRLSign] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[addExtension] operator[SEP] identifier[Extension] operator[SEP] identifier[keyUsage] , literal[boolean] , identifier[usage] operator[SEP] operator[SEP] identifier[ASN1EncodableVector] identifier[purposes] operator[=] Keyword[new] identifier[ASN1EncodableVector] operator[SEP] operator[SEP] operator[SEP] identifier[purposes] operator[SEP] identifier[add] operator[SEP] identifier[KeyPurposeId] operator[SEP] identifier[id_kp_serverAuth] operator[SEP] operator[SEP] identifier[purposes] operator[SEP] identifier[add] operator[SEP] identifier[KeyPurposeId] operator[SEP] identifier[id_kp_clientAuth] operator[SEP] operator[SEP] identifier[purposes] operator[SEP] identifier[add] operator[SEP] identifier[KeyPurposeId] operator[SEP] identifier[anyExtendedKeyUsage] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[addExtension] operator[SEP] identifier[Extension] operator[SEP] identifier[extendedKeyUsage] , literal[boolean] , Keyword[new] identifier[DERSequence] operator[SEP] identifier[purposes] operator[SEP] operator[SEP] operator[SEP] identifier[X509Certificate] identifier[cert] operator[=] identifier[signCertificate] operator[SEP] identifier[builder] , identifier[privateKey] operator[SEP] operator[SEP] identifier[cert] operator[SEP] identifier[checkValidity] operator[SEP] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cert] operator[SEP] identifier[verify] operator[SEP] identifier[publicKey] operator[SEP] operator[SEP] Keyword[return] identifier[cert] operator[SEP]
}
|
public boolean all(Object... targets) {
if (null == targets) { return null == this.delegate; }
for (Object target : targets) {
if (null == target) { if (null != this.delegate) { return false; } continue; }
if (target != this.delegate) { return false; }
}
return true;
} | class class_name[name] begin[{]
method[all, return_type[type[boolean]], modifier[public], parameter[targets]] begin[{]
if[binary_operation[literal[null], ==, member[.targets]]] begin[{]
return[binary_operation[literal[null], ==, THIS[member[None.delegate]]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=delegate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), ContinueStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=delegate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=target)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[all] operator[SEP] identifier[Object] operator[...] identifier[targets] operator[SEP] {
Keyword[if] operator[SEP] Other[null] operator[==] identifier[targets] operator[SEP] {
Keyword[return] Other[null] operator[==] Keyword[this] operator[SEP] identifier[delegate] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Object] identifier[target] operator[:] identifier[targets] operator[SEP] {
Keyword[if] operator[SEP] Other[null] operator[==] identifier[target] operator[SEP] {
Keyword[if] operator[SEP] Other[null] operator[!=] Keyword[this] operator[SEP] identifier[delegate] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[target] operator[!=] Keyword[this] operator[SEP] identifier[delegate] operator[SEP] {
Keyword[return] literal[boolean] 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.