code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
@Override
public void uncheckedSetDeliveryDelay(long value) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "uncheckedSetDeliveryDelay", Long.valueOf(value));
getHdr2().setLongField(JsHdr2Access.DELIVERYDELAY_DATA, value);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "uncheckedSetDeliveryDelay");
} | class class_name[name] begin[{]
method[uncheckedSetDeliveryDelay, return_type[void], modifier[public], parameter[value]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[THIS[], member[.tc], literal["uncheckedSetDeliveryDelay"], call[Long.valueOf, parameter[member[.value]]]]]
else begin[{]
None
end[}]
call[.getHdr2, parameter[]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[THIS[], member[.tc], literal["uncheckedSetDeliveryDelay"]]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[uncheckedSetDeliveryDelay] operator[SEP] Keyword[long] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] identifier[getHdr2] operator[SEP] operator[SEP] operator[SEP] identifier[setLongField] operator[SEP] identifier[JsHdr2Access] operator[SEP] identifier[DELIVERYDELAY_DATA] , identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
public static Pair<Bitmap, Bitmap> splitVertically(@NonNull final Bitmap bitmap,
final int splitPoint) {
Condition.INSTANCE.ensureNotNull(bitmap, "The bitmap may not be null");
Condition.INSTANCE.ensureGreater(splitPoint, 0, "The split point must be greater than 0");
Condition.INSTANCE.ensureSmaller(splitPoint, bitmap.getWidth(),
"The split point must be smaller than " + bitmap.getWidth());
Bitmap leftBitmap = Bitmap.createBitmap(bitmap, 0, 0, splitPoint, bitmap.getHeight());
Bitmap rightBitmap =
Bitmap.createBitmap(bitmap, splitPoint, 0, bitmap.getWidth() - splitPoint,
bitmap.getHeight());
return new Pair<>(leftBitmap, rightBitmap);
} | class class_name[name] begin[{]
method[splitVertically, return_type[type[Pair]], modifier[public static], parameter[bitmap, splitPoint]] begin[{]
call[Condition.INSTANCE.ensureNotNull, parameter[member[.bitmap], literal["The bitmap may not be null"]]]
call[Condition.INSTANCE.ensureGreater, parameter[member[.splitPoint], literal[0], literal["The split point must be greater than 0"]]]
call[Condition.INSTANCE.ensureSmaller, parameter[member[.splitPoint], call[bitmap.getWidth, parameter[]], binary_operation[literal["The split point must be smaller than "], +, call[bitmap.getWidth, parameter[]]]]]
local_variable[type[Bitmap], leftBitmap]
local_variable[type[Bitmap], rightBitmap]
return[ClassCreator(arguments=[MemberReference(member=leftBitmap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rightBitmap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=Pair, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Pair] operator[<] identifier[Bitmap] , identifier[Bitmap] operator[>] identifier[splitVertically] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[Bitmap] identifier[bitmap] , Keyword[final] Keyword[int] identifier[splitPoint] operator[SEP] {
identifier[Condition] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[ensureNotNull] operator[SEP] identifier[bitmap] , literal[String] operator[SEP] operator[SEP] identifier[Condition] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[ensureGreater] operator[SEP] identifier[splitPoint] , Other[0] , literal[String] operator[SEP] operator[SEP] identifier[Condition] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[ensureSmaller] operator[SEP] identifier[splitPoint] , identifier[bitmap] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] , literal[String] operator[+] identifier[bitmap] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Bitmap] identifier[leftBitmap] operator[=] identifier[Bitmap] operator[SEP] identifier[createBitmap] operator[SEP] identifier[bitmap] , Other[0] , Other[0] , identifier[splitPoint] , identifier[bitmap] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Bitmap] identifier[rightBitmap] operator[=] identifier[Bitmap] operator[SEP] identifier[createBitmap] operator[SEP] identifier[bitmap] , identifier[splitPoint] , Other[0] , identifier[bitmap] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[-] identifier[splitPoint] , identifier[bitmap] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Pair] operator[<] operator[>] operator[SEP] identifier[leftBitmap] , identifier[rightBitmap] operator[SEP] operator[SEP]
}
|
@Override
public void execute(Runnable runnable) {
TaskInfo taskInfo = new TaskInfo(false);
taskInfo.initForOneShotTask(0l); // run immediately
newTask(runnable, taskInfo, null, null);
} | class class_name[name] begin[{]
method[execute, return_type[void], modifier[public], parameter[runnable]] begin[{]
local_variable[type[TaskInfo], taskInfo]
call[taskInfo.initForOneShotTask, parameter[literal[0l]]]
call[.newTask, parameter[member[.runnable], member[.taskInfo], literal[null], literal[null]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[Runnable] identifier[runnable] operator[SEP] {
identifier[TaskInfo] identifier[taskInfo] operator[=] Keyword[new] identifier[TaskInfo] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[taskInfo] operator[SEP] identifier[initForOneShotTask] operator[SEP] Other[0l] operator[SEP] operator[SEP] identifier[newTask] operator[SEP] identifier[runnable] , identifier[taskInfo] , Other[null] , Other[null] operator[SEP] operator[SEP]
}
|
public static Pattern compilePattern(final String queryString) {
final StringBuilder queryBuilder = new StringBuilder();
final Matcher queryMatcher = IPersonAttributeDao.WILDCARD_PATTERN.matcher(queryString);
if (!queryMatcher.find()) {
return Pattern.compile(Pattern.quote(queryString));
}
int start = queryMatcher.start();
int previousEnd = -1;
if (start > 0) {
final String queryPart = queryString.substring(0, start);
final String quotedQueryPart = Pattern.quote(queryPart);
queryBuilder.append(quotedQueryPart);
}
queryBuilder.append(".*");
do {
start = queryMatcher.start();
if (previousEnd != -1) {
final String queryPart = queryString.substring(previousEnd, start);
final String quotedQueryPart = Pattern.quote(queryPart);
queryBuilder.append(quotedQueryPart);
queryBuilder.append(".*");
}
previousEnd = queryMatcher.end();
} while (queryMatcher.find());
if (previousEnd < queryString.length()) {
final String queryPart = queryString.substring(previousEnd);
final String quotedQueryPart = Pattern.quote(queryPart);
queryBuilder.append(quotedQueryPart);
}
return Pattern.compile(queryBuilder.toString());
} | class class_name[name] begin[{]
method[compilePattern, return_type[type[Pattern]], modifier[public static], parameter[queryString]] begin[{]
local_variable[type[StringBuilder], queryBuilder]
local_variable[type[Matcher], queryMatcher]
if[call[queryMatcher.find, parameter[]]] begin[{]
return[call[Pattern.compile, parameter[call[Pattern.quote, parameter[member[.queryString]]]]]]
else begin[{]
None
end[}]
local_variable[type[int], start]
local_variable[type[int], previousEnd]
if[binary_operation[member[.start], >, literal[0]]] begin[{]
local_variable[type[String], queryPart]
local_variable[type[String], quotedQueryPart]
call[queryBuilder.append, parameter[member[.quotedQueryPart]]]
else begin[{]
None
end[}]
call[queryBuilder.append, parameter[literal[".*"]]]
do[call[queryMatcher.find, parameter[]]] begin[{]
assign[member[.start], call[queryMatcher.start, parameter[]]]
if[binary_operation[member[.previousEnd], !=, literal[1]]] begin[{]
local_variable[type[String], queryPart]
local_variable[type[String], quotedQueryPart]
call[queryBuilder.append, parameter[member[.quotedQueryPart]]]
call[queryBuilder.append, parameter[literal[".*"]]]
else begin[{]
None
end[}]
assign[member[.previousEnd], call[queryMatcher.end, parameter[]]]
end[}]
if[binary_operation[member[.previousEnd], <, call[queryString.length, parameter[]]]] begin[{]
local_variable[type[String], queryPart]
local_variable[type[String], quotedQueryPart]
call[queryBuilder.append, parameter[member[.quotedQueryPart]]]
else begin[{]
None
end[}]
return[call[Pattern.compile, parameter[call[queryBuilder.toString, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Pattern] identifier[compilePattern] operator[SEP] Keyword[final] identifier[String] identifier[queryString] operator[SEP] {
Keyword[final] identifier[StringBuilder] identifier[queryBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Matcher] identifier[queryMatcher] operator[=] identifier[IPersonAttributeDao] operator[SEP] identifier[WILDCARD_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[queryString] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[queryMatcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[queryString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[int] identifier[start] operator[=] identifier[queryMatcher] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[previousEnd] operator[=] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[start] operator[>] Other[0] operator[SEP] {
Keyword[final] identifier[String] identifier[queryPart] operator[=] identifier[queryString] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[start] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[quotedQueryPart] operator[=] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[queryPart] operator[SEP] operator[SEP] identifier[queryBuilder] operator[SEP] identifier[append] operator[SEP] identifier[quotedQueryPart] operator[SEP] operator[SEP]
}
identifier[queryBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[do] {
identifier[start] operator[=] identifier[queryMatcher] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[previousEnd] operator[!=] operator[-] Other[1] operator[SEP] {
Keyword[final] identifier[String] identifier[queryPart] operator[=] identifier[queryString] operator[SEP] identifier[substring] operator[SEP] identifier[previousEnd] , identifier[start] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[quotedQueryPart] operator[=] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[queryPart] operator[SEP] operator[SEP] identifier[queryBuilder] operator[SEP] identifier[append] operator[SEP] identifier[quotedQueryPart] operator[SEP] operator[SEP] identifier[queryBuilder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[previousEnd] operator[=] identifier[queryMatcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[while] operator[SEP] identifier[queryMatcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[previousEnd] operator[<] identifier[queryString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[queryPart] operator[=] identifier[queryString] operator[SEP] identifier[substring] operator[SEP] identifier[previousEnd] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[quotedQueryPart] operator[=] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[queryPart] operator[SEP] operator[SEP] identifier[queryBuilder] operator[SEP] identifier[append] operator[SEP] identifier[quotedQueryPart] operator[SEP] operator[SEP]
}
Keyword[return] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[queryBuilder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public boolean isEnriched(HttpRequest request, HttpResponse response) {
Long serialId = getSerialId(request);
return serialId != null;
} | class class_name[name] begin[{]
method[isEnriched, return_type[type[boolean]], modifier[public], parameter[request, response]] begin[{]
local_variable[type[Long], serialId]
return[binary_operation[member[.serialId], !=, literal[null]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isEnriched] operator[SEP] identifier[HttpRequest] identifier[request] , identifier[HttpResponse] identifier[response] operator[SEP] {
identifier[Long] identifier[serialId] operator[=] identifier[getSerialId] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[serialId] operator[!=] Other[null] operator[SEP]
}
|
public void marshall(DescribeLoaRequest describeLoaRequest, ProtocolMarshaller protocolMarshaller) {
if (describeLoaRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(describeLoaRequest.getConnectionId(), CONNECTIONID_BINDING);
protocolMarshaller.marshall(describeLoaRequest.getProviderName(), PROVIDERNAME_BINDING);
protocolMarshaller.marshall(describeLoaRequest.getLoaContentType(), LOACONTENTTYPE_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} | class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[describeLoaRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.describeLoaRequest], ==, 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=getConnectionId, postfix_operators=[], prefix_operators=[], qualifier=describeLoaRequest, selectors=[], type_arguments=None), MemberReference(member=CONNECTIONID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProviderName, postfix_operators=[], prefix_operators=[], qualifier=describeLoaRequest, selectors=[], type_arguments=None), MemberReference(member=PROVIDERNAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLoaContentType, postfix_operators=[], prefix_operators=[], qualifier=describeLoaRequest, selectors=[], type_arguments=None), MemberReference(member=LOACONTENTTYPE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[DescribeLoaRequest] identifier[describeLoaRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[describeLoaRequest] 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[describeLoaRequest] operator[SEP] identifier[getConnectionId] operator[SEP] operator[SEP] , identifier[CONNECTIONID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeLoaRequest] operator[SEP] identifier[getProviderName] operator[SEP] operator[SEP] , identifier[PROVIDERNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeLoaRequest] operator[SEP] identifier[getLoaContentType] operator[SEP] operator[SEP] , identifier[LOACONTENTTYPE_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public HppRequest addOfferSaveCard(boolean offerSaveCard) {
this.offerSaveCard = offerSaveCard ? Flag.TRUE.getFlag() : Flag.FALSE.getFlag();
return this;
} | class class_name[name] begin[{]
method[addOfferSaveCard, return_type[type[HppRequest]], modifier[public], parameter[offerSaveCard]] begin[{]
assign[THIS[member[None.offerSaveCard]], TernaryExpression(condition=MemberReference(member=offerSaveCard, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=getFlag, postfix_operators=[], prefix_operators=[], qualifier=Flag.FALSE, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=getFlag, postfix_operators=[], prefix_operators=[], qualifier=Flag.TRUE, selectors=[], type_arguments=None))]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[HppRequest] identifier[addOfferSaveCard] operator[SEP] Keyword[boolean] identifier[offerSaveCard] operator[SEP] {
Keyword[this] operator[SEP] identifier[offerSaveCard] operator[=] identifier[offerSaveCard] operator[?] identifier[Flag] operator[SEP] identifier[TRUE] operator[SEP] identifier[getFlag] operator[SEP] operator[SEP] operator[:] identifier[Flag] operator[SEP] identifier[FALSE] operator[SEP] identifier[getFlag] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public static CloseableHttpClient initHttpClient(boolean insecureMode, File ocspCacheFile)
{
if (httpClient == null)
{
synchronized (HttpUtil.class)
{
if (httpClient == null)
{
httpClient = buildHttpClient(
insecureMode,
ocspCacheFile,
enableOcspResponseCacheServer());
}
}
}
return httpClient;
} | class class_name[name] begin[{]
method[initHttpClient, return_type[type[CloseableHttpClient]], modifier[public static], parameter[insecureMode, ocspCacheFile]] begin[{]
if[binary_operation[member[.httpClient], ==, literal[null]]] begin[{]
SYNCHRONIZED[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpUtil, sub_type=None))] BEGIN[{]
if[binary_operation[member[.httpClient], ==, literal[null]]] begin[{]
assign[member[.httpClient], call[.buildHttpClient, parameter[member[.insecureMode], member[.ocspCacheFile], call[.enableOcspResponseCacheServer, parameter[]]]]]
else begin[{]
None
end[}]
END[}]
else begin[{]
None
end[}]
return[member[.httpClient]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[CloseableHttpClient] identifier[initHttpClient] operator[SEP] Keyword[boolean] identifier[insecureMode] , identifier[File] identifier[ocspCacheFile] operator[SEP] {
Keyword[if] operator[SEP] identifier[httpClient] operator[==] Other[null] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[HttpUtil] operator[SEP] Keyword[class] operator[SEP] {
Keyword[if] operator[SEP] identifier[httpClient] operator[==] Other[null] operator[SEP] {
identifier[httpClient] operator[=] identifier[buildHttpClient] operator[SEP] identifier[insecureMode] , identifier[ocspCacheFile] , identifier[enableOcspResponseCacheServer] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[httpClient] operator[SEP]
}
|
private Map<URI, URI> filterConflictingCopyTo( final Map<URI, URI> copyTo, final Collection<FileInfo> fileInfos) {
final Set<URI> fileinfoTargets = fileInfos.stream()
.filter(fi -> fi.src.equals(fi.result))
.map(fi -> fi.result)
.collect(Collectors.toSet());
return copyTo.entrySet().stream()
.filter(e -> !fileinfoTargets.contains(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
} | class class_name[name] begin[{]
method[filterConflictingCopyTo, return_type[type[Map]], modifier[private], parameter[copyTo, fileInfos]] begin[{]
local_variable[type[Set], fileinfoTargets]
return[call[copyTo.entrySet, parameter[]]]
end[}]
END[}] | Keyword[private] identifier[Map] operator[<] identifier[URI] , identifier[URI] operator[>] identifier[filterConflictingCopyTo] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[URI] , identifier[URI] operator[>] identifier[copyTo] , Keyword[final] identifier[Collection] operator[<] identifier[FileInfo] operator[>] identifier[fileInfos] operator[SEP] {
Keyword[final] identifier[Set] operator[<] identifier[URI] operator[>] identifier[fileinfoTargets] operator[=] identifier[fileInfos] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[fi] operator[->] identifier[fi] operator[SEP] identifier[src] operator[SEP] identifier[equals] operator[SEP] identifier[fi] operator[SEP] identifier[result] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[fi] operator[->] identifier[fi] operator[SEP] identifier[result] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toSet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[copyTo] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[e] operator[->] operator[!] identifier[fileinfoTargets] operator[SEP] identifier[contains] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toMap] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[::] identifier[getKey] , identifier[Map] operator[SEP] identifier[Entry] operator[::] identifier[getValue] operator[SEP] operator[SEP] operator[SEP]
}
|
public static ByteBuffer allocateDirectAligned(final int capacity, final int alignment)
{
if (!isPowerOfTwo(alignment))
{
throw new IllegalArgumentException("Must be a power of 2: alignment=" + alignment);
}
final ByteBuffer buffer = ByteBuffer.allocateDirect(capacity + alignment);
final long address = address(buffer);
final int remainder = (int)(address & (alignment - 1));
final int offset = alignment - remainder;
buffer.limit(capacity + offset);
buffer.position(offset);
return buffer.slice();
} | class class_name[name] begin[{]
method[allocateDirectAligned, return_type[type[ByteBuffer]], modifier[public static], parameter[capacity, alignment]] begin[{]
if[call[.isPowerOfTwo, parameter[member[.alignment]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Must be a power of 2: alignment="), operandr=MemberReference(member=alignment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[ByteBuffer], buffer]
local_variable[type[long], address]
local_variable[type[int], remainder]
local_variable[type[int], offset]
call[buffer.limit, parameter[binary_operation[member[.capacity], +, member[.offset]]]]
call[buffer.position, parameter[member[.offset]]]
return[call[buffer.slice, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ByteBuffer] identifier[allocateDirectAligned] operator[SEP] Keyword[final] Keyword[int] identifier[capacity] , Keyword[final] Keyword[int] identifier[alignment] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isPowerOfTwo] operator[SEP] identifier[alignment] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[alignment] operator[SEP] operator[SEP]
}
Keyword[final] identifier[ByteBuffer] identifier[buffer] operator[=] identifier[ByteBuffer] operator[SEP] identifier[allocateDirect] operator[SEP] identifier[capacity] operator[+] identifier[alignment] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[address] operator[=] identifier[address] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[remainder] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[address] operator[&] operator[SEP] identifier[alignment] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[offset] operator[=] identifier[alignment] operator[-] identifier[remainder] operator[SEP] identifier[buffer] operator[SEP] identifier[limit] operator[SEP] identifier[capacity] operator[+] identifier[offset] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[position] operator[SEP] identifier[offset] operator[SEP] operator[SEP] Keyword[return] identifier[buffer] operator[SEP] identifier[slice] operator[SEP] operator[SEP] operator[SEP]
}
|
private List<Map<String, Object>> sortArguments(final List<Map<String, Object>> unsorted) {
Collections.sort(unsorted, new CompareArgumentsByName());
return unsorted;
} | class class_name[name] begin[{]
method[sortArguments, return_type[type[List]], modifier[private], parameter[unsorted]] begin[{]
call[Collections.sort, parameter[member[.unsorted], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CompareArgumentsByName, sub_type=None))]]
return[member[.unsorted]]
end[}]
END[}] | Keyword[private] identifier[List] operator[<] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] identifier[sortArguments] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] identifier[unsorted] operator[SEP] {
identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[unsorted] , Keyword[new] identifier[CompareArgumentsByName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[unsorted] operator[SEP]
}
|
private static void removeMapping(String domainName, String ip) {
synchronized (LOCK) {
if (DOMAIN_NAME_TO_IP.containsKey(domainName))
DOMAIN_NAME_TO_IP.get(domainName).remove(ip);
}
} | class class_name[name] begin[{]
method[removeMapping, return_type[void], modifier[private static], parameter[domainName, ip]] begin[{]
SYNCHRONIZED[member[.LOCK]] BEGIN[{]
if[call[DOMAIN_NAME_TO_IP.containsKey, parameter[member[.domainName]]]] begin[{]
call[DOMAIN_NAME_TO_IP.get, parameter[member[.domainName]]]
else begin[{]
None
end[}]
END[}]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[removeMapping] operator[SEP] identifier[String] identifier[domainName] , identifier[String] identifier[ip] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[LOCK] operator[SEP] {
Keyword[if] operator[SEP] identifier[DOMAIN_NAME_TO_IP] operator[SEP] identifier[containsKey] operator[SEP] identifier[domainName] operator[SEP] operator[SEP] identifier[DOMAIN_NAME_TO_IP] operator[SEP] identifier[get] operator[SEP] identifier[domainName] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[ip] operator[SEP] operator[SEP]
}
}
|
public static Object stringToSqlValue(String value, int sqlType, boolean isRequired, boolean isEmptyStringNulled) {
// 设置变量
String sourceValue = value;
if (SqlUtils.isTextType(sqlType)) {
if ((sourceValue == null) || (true == StringUtils.isEmpty(sourceValue) && isEmptyStringNulled)) {
return isRequired ? REQUIRED_FIELD_NULL_SUBSTITUTE : null;
} else {
return sourceValue;
}
} else {
if (StringUtils.isEmpty(sourceValue)) {
return isEmptyStringNulled ? null : sourceValue;// oracle的返回null,保持兼容
} else {
Class<?> requiredType = sqlTypeToJavaTypeMap.get(sqlType);
if (requiredType == null) {
throw new IllegalArgumentException("unknow java.sql.Types - " + sqlType);
} else if (requiredType.equals(String.class)) {
return sourceValue;
} else if (true == isNumeric(sqlType)) {
return convertUtilsBean.convert(sourceValue.trim(), requiredType);
} else {
return convertUtilsBean.convert(sourceValue, requiredType);
}
}
}
} | class class_name[name] begin[{]
method[stringToSqlValue, return_type[type[Object]], modifier[public static], parameter[value, sqlType, isRequired, isEmptyStringNulled]] begin[{]
local_variable[type[String], sourceValue]
if[call[SqlUtils.isTextType, parameter[member[.sqlType]]]] begin[{]
if[binary_operation[binary_operation[member[.sourceValue], ==, literal[null]], ||, binary_operation[binary_operation[literal[true], ==, call[StringUtils.isEmpty, parameter[member[.sourceValue]]]], &&, member[.isEmptyStringNulled]]]] begin[{]
return[TernaryExpression(condition=MemberReference(member=isRequired, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MemberReference(member=REQUIRED_FIELD_NULL_SUBSTITUTE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
else begin[{]
return[member[.sourceValue]]
end[}]
else begin[{]
if[call[StringUtils.isEmpty, parameter[member[.sourceValue]]]] begin[{]
return[TernaryExpression(condition=MemberReference(member=isEmptyStringNulled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=sourceValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
else begin[{]
local_variable[type[Class], requiredType]
if[binary_operation[member[.requiredType], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unknow java.sql.Types - "), operandr=MemberReference(member=sqlType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
if[call[requiredType.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]] begin[{]
return[member[.sourceValue]]
else begin[{]
if[binary_operation[literal[true], ==, call[.isNumeric, parameter[member[.sqlType]]]]] begin[{]
return[call[convertUtilsBean.convert, parameter[call[sourceValue.trim, parameter[]], member[.requiredType]]]]
else begin[{]
return[call[convertUtilsBean.convert, parameter[member[.sourceValue], member[.requiredType]]]]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Object] identifier[stringToSqlValue] operator[SEP] identifier[String] identifier[value] , Keyword[int] identifier[sqlType] , Keyword[boolean] identifier[isRequired] , Keyword[boolean] identifier[isEmptyStringNulled] operator[SEP] {
identifier[String] identifier[sourceValue] operator[=] identifier[value] operator[SEP] Keyword[if] operator[SEP] identifier[SqlUtils] operator[SEP] identifier[isTextType] operator[SEP] identifier[sqlType] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[sourceValue] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] literal[boolean] operator[==] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[sourceValue] operator[SEP] operator[&&] identifier[isEmptyStringNulled] operator[SEP] operator[SEP] {
Keyword[return] identifier[isRequired] operator[?] identifier[REQUIRED_FIELD_NULL_SUBSTITUTE] operator[:] Other[null] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[sourceValue] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[sourceValue] operator[SEP] operator[SEP] {
Keyword[return] identifier[isEmptyStringNulled] operator[?] Other[null] operator[:] identifier[sourceValue] operator[SEP]
}
Keyword[else] {
identifier[Class] operator[<] operator[?] operator[>] identifier[requiredType] operator[=] identifier[sqlTypeToJavaTypeMap] operator[SEP] identifier[get] operator[SEP] identifier[sqlType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[requiredType] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[sqlType] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[requiredType] operator[SEP] identifier[equals] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] identifier[sourceValue] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] literal[boolean] operator[==] identifier[isNumeric] operator[SEP] identifier[sqlType] operator[SEP] operator[SEP] {
Keyword[return] identifier[convertUtilsBean] operator[SEP] identifier[convert] operator[SEP] identifier[sourceValue] operator[SEP] identifier[trim] operator[SEP] operator[SEP] , identifier[requiredType] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[convertUtilsBean] operator[SEP] identifier[convert] operator[SEP] identifier[sourceValue] , identifier[requiredType] operator[SEP] operator[SEP]
}
}
}
}
|
public CyclicYear roll(int amount) {
if (amount == 0) {
return this;
}
return CyclicYear.of(MathUtils.floorModulo(MathUtils.safeAdd(this.year - 1, amount), 60) + 1);
} | class class_name[name] begin[{]
method[roll, return_type[type[CyclicYear]], modifier[public], parameter[amount]] begin[{]
if[binary_operation[member[.amount], ==, literal[0]]] begin[{]
return[THIS[]]
else begin[{]
None
end[}]
return[call[CyclicYear.of, parameter[binary_operation[call[MathUtils.floorModulo, parameter[call[MathUtils.safeAdd, parameter[binary_operation[THIS[member[None.year]], -, literal[1]], member[.amount]]], literal[60]]], +, literal[1]]]]]
end[}]
END[}] | Keyword[public] identifier[CyclicYear] identifier[roll] operator[SEP] Keyword[int] identifier[amount] operator[SEP] {
Keyword[if] operator[SEP] identifier[amount] operator[==] Other[0] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP]
}
Keyword[return] identifier[CyclicYear] operator[SEP] identifier[of] operator[SEP] identifier[MathUtils] operator[SEP] identifier[floorModulo] operator[SEP] identifier[MathUtils] operator[SEP] identifier[safeAdd] operator[SEP] Keyword[this] operator[SEP] identifier[year] operator[-] Other[1] , identifier[amount] operator[SEP] , Other[60] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP]
}
|
public void setFidelity(String key, boolean decision)
throws UnsupportedOption {
if (key.equals(FEATURE_STRICT)) {
if (decision) {
// no other features allowed
// (LEXICAL_VALUE is an exception)
boolean prevContainedLexVal = options
.contains(FEATURE_LEXICAL_VALUE);
options.clear();
isComment = false;
isPI = false;
isDTD = false;
isPrefix = false;
isLexicalValue = false;
isSC = false;
if (prevContainedLexVal) {
options.add(FEATURE_LEXICAL_VALUE);
isLexicalValue = true;
}
options.add(FEATURE_STRICT);
isStrict = true;
} else {
// remove strict (if present)
options.remove(key);
isStrict = false;
}
} else if (key.equals(FEATURE_LEXICAL_VALUE)) {
// LEXICAL_VALUE is special --> does affect grammars
if (decision) {
options.add(key);
isLexicalValue = true;
} else {
// remove option (if present)
options.remove(key);
isLexicalValue = false;
}
} else if (key.equals(FEATURE_COMMENT) || key.equals(FEATURE_PI)
|| key.equals(FEATURE_DTD) || key.equals(FEATURE_PREFIX)
|| key.equals(FEATURE_SC)) {
if (decision) {
if (isStrict()) {
options.remove(FEATURE_STRICT);
this.isStrict = false;
// TODO inform user that STRICT mode is de-activated
// throw new UnsupportedOption(
// "StrictMode is exclusive and does not allow any other option.");
}
options.add(key);
if (key.equals(FEATURE_COMMENT)) {
isComment = true;
}
if (key.equals(FEATURE_PI)) {
isPI = true;
}
if (key.equals(FEATURE_DTD)) {
isDTD = true;
}
if (key.equals(FEATURE_PREFIX)) {
isPrefix = true;
}
if (key.equals(FEATURE_SC)) {
isSC = true;
}
} else {
// remove option (if present)
options.remove(key);
if (key.equals(FEATURE_COMMENT)) {
isComment = false;
}
if (key.equals(FEATURE_PI)) {
isPI = false;
}
if (key.equals(FEATURE_DTD)) {
isDTD = false;
}
if (key.equals(FEATURE_PREFIX)) {
isPrefix = false;
}
if (key.equals(FEATURE_SC)) {
isSC = false;
}
}
} else {
throw new UnsupportedOption("FidelityOption '" + key
+ "' is unknown!");
}
} | class class_name[name] begin[{]
method[setFidelity, return_type[void], modifier[public], parameter[key, decision]] begin[{]
if[call[key.equals, parameter[member[.FEATURE_STRICT]]]] begin[{]
if[member[.decision]] begin[{]
local_variable[type[boolean], prevContainedLexVal]
call[options.clear, parameter[]]
assign[member[.isComment], literal[false]]
assign[member[.isPI], literal[false]]
assign[member[.isDTD], literal[false]]
assign[member[.isPrefix], literal[false]]
assign[member[.isLexicalValue], literal[false]]
assign[member[.isSC], literal[false]]
if[member[.prevContainedLexVal]] begin[{]
call[options.add, parameter[member[.FEATURE_LEXICAL_VALUE]]]
assign[member[.isLexicalValue], literal[true]]
else begin[{]
None
end[}]
call[options.add, parameter[member[.FEATURE_STRICT]]]
assign[member[.isStrict], literal[true]]
else begin[{]
call[options.remove, parameter[member[.key]]]
assign[member[.isStrict], literal[false]]
end[}]
else begin[{]
if[call[key.equals, parameter[member[.FEATURE_LEXICAL_VALUE]]]] begin[{]
if[member[.decision]] begin[{]
call[options.add, parameter[member[.key]]]
assign[member[.isLexicalValue], literal[true]]
else begin[{]
call[options.remove, parameter[member[.key]]]
assign[member[.isLexicalValue], literal[false]]
end[}]
else begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[call[key.equals, parameter[member[.FEATURE_COMMENT]]], ||, call[key.equals, parameter[member[.FEATURE_PI]]]], ||, call[key.equals, parameter[member[.FEATURE_DTD]]]], ||, call[key.equals, parameter[member[.FEATURE_PREFIX]]]], ||, call[key.equals, parameter[member[.FEATURE_SC]]]]] begin[{]
if[member[.decision]] begin[{]
if[call[.isStrict, parameter[]]] begin[{]
call[options.remove, parameter[member[.FEATURE_STRICT]]]
assign[THIS[member[None.isStrict]], literal[false]]
else begin[{]
None
end[}]
call[options.add, parameter[member[.key]]]
if[call[key.equals, parameter[member[.FEATURE_COMMENT]]]] begin[{]
assign[member[.isComment], literal[true]]
else begin[{]
None
end[}]
if[call[key.equals, parameter[member[.FEATURE_PI]]]] begin[{]
assign[member[.isPI], literal[true]]
else begin[{]
None
end[}]
if[call[key.equals, parameter[member[.FEATURE_DTD]]]] begin[{]
assign[member[.isDTD], literal[true]]
else begin[{]
None
end[}]
if[call[key.equals, parameter[member[.FEATURE_PREFIX]]]] begin[{]
assign[member[.isPrefix], literal[true]]
else begin[{]
None
end[}]
if[call[key.equals, parameter[member[.FEATURE_SC]]]] begin[{]
assign[member[.isSC], literal[true]]
else begin[{]
None
end[}]
else begin[{]
call[options.remove, parameter[member[.key]]]
if[call[key.equals, parameter[member[.FEATURE_COMMENT]]]] begin[{]
assign[member[.isComment], literal[false]]
else begin[{]
None
end[}]
if[call[key.equals, parameter[member[.FEATURE_PI]]]] begin[{]
assign[member[.isPI], literal[false]]
else begin[{]
None
end[}]
if[call[key.equals, parameter[member[.FEATURE_DTD]]]] begin[{]
assign[member[.isDTD], literal[false]]
else begin[{]
None
end[}]
if[call[key.equals, parameter[member[.FEATURE_PREFIX]]]] begin[{]
assign[member[.isPrefix], literal[false]]
else begin[{]
None
end[}]
if[call[key.equals, parameter[member[.FEATURE_SC]]]] begin[{]
assign[member[.isSC], literal[false]]
else begin[{]
None
end[}]
end[}]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="FidelityOption '"), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is unknown!"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOption, sub_type=None)), label=None)
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setFidelity] operator[SEP] identifier[String] identifier[key] , Keyword[boolean] identifier[decision] operator[SEP] Keyword[throws] identifier[UnsupportedOption] {
Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_STRICT] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[decision] operator[SEP] {
Keyword[boolean] identifier[prevContainedLexVal] operator[=] identifier[options] operator[SEP] identifier[contains] operator[SEP] identifier[FEATURE_LEXICAL_VALUE] operator[SEP] operator[SEP] identifier[options] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[isComment] operator[=] literal[boolean] operator[SEP] identifier[isPI] operator[=] literal[boolean] operator[SEP] identifier[isDTD] operator[=] literal[boolean] operator[SEP] identifier[isPrefix] operator[=] literal[boolean] operator[SEP] identifier[isLexicalValue] operator[=] literal[boolean] operator[SEP] identifier[isSC] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[prevContainedLexVal] operator[SEP] {
identifier[options] operator[SEP] identifier[add] operator[SEP] identifier[FEATURE_LEXICAL_VALUE] operator[SEP] operator[SEP] identifier[isLexicalValue] operator[=] literal[boolean] operator[SEP]
}
identifier[options] operator[SEP] identifier[add] operator[SEP] identifier[FEATURE_STRICT] operator[SEP] operator[SEP] identifier[isStrict] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[options] operator[SEP] identifier[remove] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[isStrict] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_LEXICAL_VALUE] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[decision] operator[SEP] {
identifier[options] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[isLexicalValue] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[options] operator[SEP] identifier[remove] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[isLexicalValue] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_COMMENT] operator[SEP] operator[||] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_PI] operator[SEP] operator[||] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_DTD] operator[SEP] operator[||] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_PREFIX] operator[SEP] operator[||] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_SC] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[decision] operator[SEP] {
Keyword[if] operator[SEP] identifier[isStrict] operator[SEP] operator[SEP] operator[SEP] {
identifier[options] operator[SEP] identifier[remove] operator[SEP] identifier[FEATURE_STRICT] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[isStrict] operator[=] literal[boolean] operator[SEP]
}
identifier[options] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_COMMENT] operator[SEP] operator[SEP] {
identifier[isComment] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_PI] operator[SEP] operator[SEP] {
identifier[isPI] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_DTD] operator[SEP] operator[SEP] {
identifier[isDTD] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_PREFIX] operator[SEP] operator[SEP] {
identifier[isPrefix] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_SC] operator[SEP] operator[SEP] {
identifier[isSC] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[else] {
identifier[options] operator[SEP] identifier[remove] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_COMMENT] operator[SEP] operator[SEP] {
identifier[isComment] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_PI] operator[SEP] operator[SEP] {
identifier[isPI] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_DTD] operator[SEP] operator[SEP] {
identifier[isDTD] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_PREFIX] operator[SEP] operator[SEP] {
identifier[isPrefix] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] identifier[FEATURE_SC] operator[SEP] operator[SEP] {
identifier[isSC] operator[=] literal[boolean] operator[SEP]
}
}
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[UnsupportedOption] operator[SEP] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
|
protected static void initEndpointInfo(List<EndpointInfo> endpoints) {
for (int i = 0; i < endpoints.size(); i++) {
initEndpointInfo(endpoints.get(i));
}
} | class class_name[name] begin[{]
method[initEndpointInfo, return_type[void], modifier[static protected], parameter[endpoints]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=endpoints, selectors=[], type_arguments=None)], member=initEndpointInfo, 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=size, postfix_operators=[], prefix_operators=[], qualifier=endpoints, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[protected] Keyword[static] Keyword[void] identifier[initEndpointInfo] operator[SEP] identifier[List] operator[<] identifier[EndpointInfo] operator[>] identifier[endpoints] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[endpoints] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[initEndpointInfo] operator[SEP] identifier[endpoints] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private void removeRequestUnprotected(ResourceRequest req) {
Integer requestId = req.getId();
removeGrantedResourceUnprotected(requestId);
requestMap.remove(requestId);
} | class class_name[name] begin[{]
method[removeRequestUnprotected, return_type[void], modifier[private], parameter[req]] begin[{]
local_variable[type[Integer], requestId]
call[.removeGrantedResourceUnprotected, parameter[member[.requestId]]]
call[requestMap.remove, parameter[member[.requestId]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[removeRequestUnprotected] operator[SEP] identifier[ResourceRequest] identifier[req] operator[SEP] {
identifier[Integer] identifier[requestId] operator[=] identifier[req] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[removeGrantedResourceUnprotected] operator[SEP] identifier[requestId] operator[SEP] operator[SEP] identifier[requestMap] operator[SEP] identifier[remove] operator[SEP] identifier[requestId] operator[SEP] operator[SEP]
}
|
@Override
public boolean isReconciled()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "isReconciled");
SibTr.exit(tc, "isReconciled", Boolean.valueOf(_reconciled));
}
return _reconciled;
} | class class_name[name] begin[{]
method[isReconciled, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["isReconciled"]]]
call[SibTr.exit, parameter[member[.tc], literal["isReconciled"], call[Boolean.valueOf, parameter[member[._reconciled]]]]]
else begin[{]
None
end[}]
return[member[._reconciled]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isReconciled] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[_reconciled] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[_reconciled] operator[SEP]
}
|
public final void setProfileId(String profileId) {
boolean force = false;
if (Utility.isNullOrEmpty(this.profileId) || !this.profileId.equalsIgnoreCase(profileId)) {
// Clear out the old profilePicture before requesting for the new one.
setBlankProfilePicture();
force = true;
}
this.profileId = profileId;
refreshImage(force);
} | class class_name[name] begin[{]
method[setProfileId, return_type[void], modifier[final public], parameter[profileId]] begin[{]
local_variable[type[boolean], force]
if[binary_operation[call[Utility.isNullOrEmpty, parameter[THIS[member[None.profileId]]]], ||, THIS[member[None.profileId]call[None.equalsIgnoreCase, parameter[member[.profileId]]]]]] begin[{]
call[.setBlankProfilePicture, parameter[]]
assign[member[.force], literal[true]]
else begin[{]
None
end[}]
assign[THIS[member[None.profileId]], member[.profileId]]
call[.refreshImage, parameter[member[.force]]]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[setProfileId] operator[SEP] identifier[String] identifier[profileId] operator[SEP] {
Keyword[boolean] identifier[force] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[Utility] operator[SEP] identifier[isNullOrEmpty] operator[SEP] Keyword[this] operator[SEP] identifier[profileId] operator[SEP] operator[||] operator[!] Keyword[this] operator[SEP] identifier[profileId] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[profileId] operator[SEP] operator[SEP] {
identifier[setBlankProfilePicture] operator[SEP] operator[SEP] operator[SEP] identifier[force] operator[=] literal[boolean] operator[SEP]
}
Keyword[this] operator[SEP] identifier[profileId] operator[=] identifier[profileId] operator[SEP] identifier[refreshImage] operator[SEP] identifier[force] operator[SEP] operator[SEP]
}
|
public static Location getMax(List<Location> locations) {
return scanLocations(locations, new LocationPredicate() {
@Override
public boolean accept(Location previous, Location current) {
int res = current.getEnd().compareTo(previous.getEnd());
return res > 0;
}
});
} | class class_name[name] begin[{]
method[getMax, return_type[type[Location]], modifier[public static], parameter[locations]] begin[{]
return[call[.scanLocations, parameter[member[.locations], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEnd, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEnd, postfix_operators=[], prefix_operators=[], qualifier=previous, selectors=[], type_arguments=None)], member=compareTo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=res)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None)], documentation=None, modifiers={'public'}, name=accept, parameters=[FormalParameter(annotations=[], modifiers=set(), name=previous, type=ReferenceType(arguments=None, dimensions=[], name=Location, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=current, type=ReferenceType(arguments=None, dimensions=[], name=Location, 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=LocationPredicate, sub_type=None))]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Location] identifier[getMax] operator[SEP] identifier[List] operator[<] identifier[Location] operator[>] identifier[locations] operator[SEP] {
Keyword[return] identifier[scanLocations] operator[SEP] identifier[locations] , Keyword[new] identifier[LocationPredicate] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[accept] operator[SEP] identifier[Location] identifier[previous] , identifier[Location] identifier[current] operator[SEP] {
Keyword[int] identifier[res] operator[=] identifier[current] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] identifier[compareTo] operator[SEP] identifier[previous] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[res] operator[>] Other[0] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
private void addPostParams(final Request request) {
if (name != null) {
request.addPostParam("Name", name);
}
if (codeLength != null) {
request.addPostParam("CodeLength", codeLength.toString());
}
} | class class_name[name] begin[{]
method[addPostParams, return_type[void], modifier[private], parameter[request]] begin[{]
if[binary_operation[member[.name], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["Name"], member[.name]]]
else begin[{]
None
end[}]
if[binary_operation[member[.codeLength], !=, literal[null]]] begin[{]
call[request.addPostParam, parameter[literal["CodeLength"], call[codeLength.toString, parameter[]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[addPostParams] operator[SEP] Keyword[final] identifier[Request] identifier[request] operator[SEP] {
Keyword[if] operator[SEP] identifier[name] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[name] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[codeLength] operator[!=] Other[null] operator[SEP] {
identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[codeLength] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Deprecated
public <T> Response<T> execute(Request<?> request,
HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler,
HttpResponseHandler<AmazonServiceException> errorResponseHandler,
ExecutionContext executionContext) {
HttpResponseHandler<T> adaptedRespHandler = new AwsResponseHandlerAdapter<T>(
getNonNullResponseHandler(responseHandler),
request,
executionContext.getAwsRequestMetrics(),
responseMetadataCache);
return requestExecutionBuilder()
.request(request)
.requestConfig(new AmazonWebServiceRequestAdapter(request.getOriginalRequest()))
.errorResponseHandler(new AwsErrorResponseHandler(errorResponseHandler, executionContext.getAwsRequestMetrics()))
.executionContext(executionContext)
.execute(adaptedRespHandler);
} | class class_name[name] begin[{]
method[execute, return_type[type[Response]], modifier[public], parameter[request, responseHandler, errorResponseHandler, executionContext]] begin[{]
local_variable[type[HttpResponseHandler], adaptedRespHandler]
return[call[.requestExecutionBuilder, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] operator[<] identifier[T] operator[>] identifier[Response] operator[<] identifier[T] operator[>] identifier[execute] operator[SEP] identifier[Request] operator[<] operator[?] operator[>] identifier[request] , identifier[HttpResponseHandler] operator[<] identifier[AmazonWebServiceResponse] operator[<] identifier[T] operator[>] operator[>] identifier[responseHandler] , identifier[HttpResponseHandler] operator[<] identifier[AmazonServiceException] operator[>] identifier[errorResponseHandler] , identifier[ExecutionContext] identifier[executionContext] operator[SEP] {
identifier[HttpResponseHandler] operator[<] identifier[T] operator[>] identifier[adaptedRespHandler] operator[=] Keyword[new] identifier[AwsResponseHandlerAdapter] operator[<] identifier[T] operator[>] operator[SEP] identifier[getNonNullResponseHandler] operator[SEP] identifier[responseHandler] operator[SEP] , identifier[request] , identifier[executionContext] operator[SEP] identifier[getAwsRequestMetrics] operator[SEP] operator[SEP] , identifier[responseMetadataCache] operator[SEP] operator[SEP] Keyword[return] identifier[requestExecutionBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[requestConfig] operator[SEP] Keyword[new] identifier[AmazonWebServiceRequestAdapter] operator[SEP] identifier[request] operator[SEP] identifier[getOriginalRequest] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[errorResponseHandler] operator[SEP] Keyword[new] identifier[AwsErrorResponseHandler] operator[SEP] identifier[errorResponseHandler] , identifier[executionContext] operator[SEP] identifier[getAwsRequestMetrics] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[executionContext] operator[SEP] identifier[executionContext] operator[SEP] operator[SEP] identifier[execute] operator[SEP] identifier[adaptedRespHandler] operator[SEP] operator[SEP]
}
|
public void fireEntryCriteria(CmmnActivityExecution execution) {
boolean manualActivation = evaluateManualActivationRule(execution);
if (manualActivation) {
execution.enable();
} else {
execution.start();
}
} | class class_name[name] begin[{]
method[fireEntryCriteria, return_type[void], modifier[public], parameter[execution]] begin[{]
local_variable[type[boolean], manualActivation]
if[member[.manualActivation]] begin[{]
call[execution.enable, parameter[]]
else begin[{]
call[execution.start, parameter[]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[fireEntryCriteria] operator[SEP] identifier[CmmnActivityExecution] identifier[execution] operator[SEP] {
Keyword[boolean] identifier[manualActivation] operator[=] identifier[evaluateManualActivationRule] operator[SEP] identifier[execution] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[manualActivation] operator[SEP] {
identifier[execution] operator[SEP] identifier[enable] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[execution] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void changeLogger(final String name, final String levelStr, boolean parent) throws IllegalArgumentException
{
Level level = getLevel(levelStr);
changeLogger(name, level, parent);
} | class class_name[name] begin[{]
method[changeLogger, return_type[void], modifier[public], parameter[name, levelStr, parent]] begin[{]
local_variable[type[Level], level]
call[.changeLogger, parameter[member[.name], member[.level], member[.parent]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[changeLogger] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[String] identifier[levelStr] , Keyword[boolean] identifier[parent] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] {
identifier[Level] identifier[level] operator[=] identifier[getLevel] operator[SEP] identifier[levelStr] operator[SEP] operator[SEP] identifier[changeLogger] operator[SEP] identifier[name] , identifier[level] , identifier[parent] operator[SEP] operator[SEP]
}
|
@Deprecated
public static boolean onCharacterBoundary(CharSequence s, int i) {
return i <= 0
|| i >= s.length()
|| !Character.isHighSurrogate(s.charAt(i-1))
|| !Character.isLowSurrogate(s.charAt(i));
} | class class_name[name] begin[{]
method[onCharacterBoundary, return_type[type[boolean]], modifier[public static], parameter[s, i]] begin[{]
return[binary_operation[binary_operation[binary_operation[binary_operation[member[.i], <=, literal[0]], ||, binary_operation[member[.i], >=, call[s.length, parameter[]]]], ||, call[Character.isHighSurrogate, parameter[call[s.charAt, parameter[binary_operation[member[.i], -, literal[1]]]]]]], ||, call[Character.isLowSurrogate, parameter[call[s.charAt, parameter[member[.i]]]]]]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] Keyword[boolean] identifier[onCharacterBoundary] operator[SEP] identifier[CharSequence] identifier[s] , Keyword[int] identifier[i] operator[SEP] {
Keyword[return] identifier[i] operator[<=] Other[0] operator[||] identifier[i] operator[>=] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[||] operator[!] identifier[Character] operator[SEP] identifier[isHighSurrogate] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[-] Other[1] operator[SEP] operator[SEP] operator[||] operator[!] identifier[Character] operator[SEP] identifier[isLowSurrogate] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
|
private static Boolean hasMembershipProps(final Map<IRI, Long> data) {
return data.containsKey(LDP.membershipResource) &&
data.getOrDefault(LDP.hasMemberRelation, 0L) + data.getOrDefault(LDP.isMemberOfRelation, 0L) == 1L;
} | class class_name[name] begin[{]
method[hasMembershipProps, return_type[type[Boolean]], modifier[private static], parameter[data]] begin[{]
return[binary_operation[call[data.containsKey, parameter[member[LDP.membershipResource]]], &&, binary_operation[binary_operation[call[data.getOrDefault, parameter[member[LDP.hasMemberRelation], literal[0L]]], +, call[data.getOrDefault, parameter[member[LDP.isMemberOfRelation], literal[0L]]]], ==, literal[1L]]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Boolean] identifier[hasMembershipProps] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[IRI] , identifier[Long] operator[>] identifier[data] operator[SEP] {
Keyword[return] identifier[data] operator[SEP] identifier[containsKey] operator[SEP] identifier[LDP] operator[SEP] identifier[membershipResource] operator[SEP] operator[&&] identifier[data] operator[SEP] identifier[getOrDefault] operator[SEP] identifier[LDP] operator[SEP] identifier[hasMemberRelation] , Other[0L] operator[SEP] operator[+] identifier[data] operator[SEP] identifier[getOrDefault] operator[SEP] identifier[LDP] operator[SEP] identifier[isMemberOfRelation] , Other[0L] operator[SEP] operator[==] Other[1L] operator[SEP]
}
|
public void setInvokeTimeout(long v) throws Exception {
if (!this.started)
throw new Exception("InvokeTimeout parameter can be updated only when TCAP stack is running");
if (v < 0) {
throw new IllegalArgumentException("InvokeTimeout value must be greater or equal to zero.");
}
if (v > this.dialogTimeout) {
throw new IllegalArgumentException("InvokeTimeout value must be smaller or equal to dialog timeout.");
}
this.invokeTimeout = v;
this.store();
} | class class_name[name] begin[{]
method[setInvokeTimeout, return_type[void], modifier[public], parameter[v]] begin[{]
if[THIS[member[None.started]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="InvokeTimeout parameter can be updated only when TCAP stack is running")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.v], <, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="InvokeTimeout value must be greater or equal to zero.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.v], >, THIS[member[None.dialogTimeout]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="InvokeTimeout value must be smaller or equal to dialog timeout.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[THIS[member[None.invokeTimeout]], member[.v]]
THIS[call[None.store, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setInvokeTimeout] operator[SEP] Keyword[long] identifier[v] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[started] operator[SEP] Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[<] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[v] operator[>] Keyword[this] operator[SEP] identifier[dialogTimeout] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[invokeTimeout] operator[=] identifier[v] operator[SEP] Keyword[this] operator[SEP] identifier[store] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setFileName() {
String type = "";
// lenskit does not provide a factorizer class. This check is to actually see if it's a Mahout or Lenskit SVD.
if (properties.containsKey(RecommendationRunner.FACTORIZER) || properties.containsKey(RecommendationRunner.SIMILARITY)) {
if (properties.containsKey(RecommendationRunner.FACTORIZER)) {
type = properties.getProperty(RecommendationRunner.FACTORIZER);
} else {
type = properties.getProperty(RecommendationRunner.SIMILARITY);
}
type = type.substring(type.lastIndexOf(".") + 1) + ".";
}
String num = "";
if (properties.containsKey(RecommendationRunner.FACTORS) || properties.containsKey(RecommendationRunner.NEIGHBORHOOD)) {
if (properties.containsKey(RecommendationRunner.FACTORS)) {
num = properties.getProperty(RecommendationRunner.FACTORS);
} else {
num = properties.getProperty(RecommendationRunner.NEIGHBORHOOD);
}
num += ".";
}
String trainingSet = properties.getProperty(RecommendationRunner.TRAINING_SET);
trainingSet = trainingSet.substring(trainingSet.lastIndexOf("/") + 1, trainingSet.lastIndexOf("_train"));
fileName = trainingSet + "."
+ properties.getProperty(RecommendationRunner.FRAMEWORK) + "."
+ properties.getProperty(RecommendationRunner.RECOMMENDER).substring(properties.getProperty(RecommendationRunner.RECOMMENDER).lastIndexOf(".") + 1) + "."
+ type
+ num
+ "tsv";
System.out.println(fileName);
} | class class_name[name] begin[{]
method[setFileName, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[String], type]
if[binary_operation[call[properties.containsKey, parameter[member[RecommendationRunner.FACTORIZER]]], ||, call[properties.containsKey, parameter[member[RecommendationRunner.SIMILARITY]]]]] begin[{]
if[call[properties.containsKey, parameter[member[RecommendationRunner.FACTORIZER]]]] begin[{]
assign[member[.type], call[properties.getProperty, parameter[member[RecommendationRunner.FACTORIZER]]]]
else begin[{]
assign[member[.type], call[properties.getProperty, parameter[member[RecommendationRunner.SIMILARITY]]]]
end[}]
assign[member[.type], binary_operation[call[type.substring, parameter[binary_operation[call[type.lastIndexOf, parameter[literal["."]]], +, literal[1]]]], +, literal["."]]]
else begin[{]
None
end[}]
local_variable[type[String], num]
if[binary_operation[call[properties.containsKey, parameter[member[RecommendationRunner.FACTORS]]], ||, call[properties.containsKey, parameter[member[RecommendationRunner.NEIGHBORHOOD]]]]] begin[{]
if[call[properties.containsKey, parameter[member[RecommendationRunner.FACTORS]]]] begin[{]
assign[member[.num], call[properties.getProperty, parameter[member[RecommendationRunner.FACTORS]]]]
else begin[{]
assign[member[.num], call[properties.getProperty, parameter[member[RecommendationRunner.NEIGHBORHOOD]]]]
end[}]
assign[member[.num], literal["."]]
else begin[{]
None
end[}]
local_variable[type[String], trainingSet]
assign[member[.trainingSet], call[trainingSet.substring, parameter[binary_operation[call[trainingSet.lastIndexOf, parameter[literal["/"]]], +, literal[1]], call[trainingSet.lastIndexOf, parameter[literal["_train"]]]]]]
assign[member[.fileName], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.trainingSet], +, literal["."]], +, call[properties.getProperty, parameter[member[RecommendationRunner.FRAMEWORK]]]], +, literal["."]], +, call[properties.getProperty, parameter[member[RecommendationRunner.RECOMMENDER]]]], +, literal["."]], +, member[.type]], +, member[.num]], +, literal["tsv"]]]
call[System.out.println, parameter[member[.fileName]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setFileName] operator[SEP] operator[SEP] {
identifier[String] identifier[type] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[properties] operator[SEP] identifier[containsKey] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[FACTORIZER] operator[SEP] operator[||] identifier[properties] operator[SEP] identifier[containsKey] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[SIMILARITY] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[properties] operator[SEP] identifier[containsKey] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[FACTORIZER] operator[SEP] operator[SEP] {
identifier[type] operator[=] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[FACTORIZER] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[type] operator[=] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[SIMILARITY] operator[SEP] operator[SEP]
}
identifier[type] operator[=] identifier[type] operator[SEP] identifier[substring] operator[SEP] identifier[type] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] operator[+] literal[String] operator[SEP]
}
identifier[String] identifier[num] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[properties] operator[SEP] identifier[containsKey] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[FACTORS] operator[SEP] operator[||] identifier[properties] operator[SEP] identifier[containsKey] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[NEIGHBORHOOD] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[properties] operator[SEP] identifier[containsKey] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[FACTORS] operator[SEP] operator[SEP] {
identifier[num] operator[=] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[FACTORS] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[num] operator[=] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[NEIGHBORHOOD] operator[SEP] operator[SEP]
}
identifier[num] operator[+=] literal[String] operator[SEP]
}
identifier[String] identifier[trainingSet] operator[=] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[TRAINING_SET] operator[SEP] operator[SEP] identifier[trainingSet] operator[=] identifier[trainingSet] operator[SEP] identifier[substring] operator[SEP] identifier[trainingSet] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] , identifier[trainingSet] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[fileName] operator[=] identifier[trainingSet] operator[+] literal[String] operator[+] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[FRAMEWORK] operator[SEP] operator[+] literal[String] operator[+] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[RECOMMENDER] operator[SEP] operator[SEP] identifier[substring] operator[SEP] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[RECOMMENDER] operator[SEP] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] operator[+] literal[String] operator[+] identifier[type] operator[+] identifier[num] operator[+] literal[String] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[fileName] operator[SEP] operator[SEP]
}
|
public Type wildLowerBound(Type t) {
if (t.hasTag(WILDCARD)) {
WildcardType w = (WildcardType) t;
return w.isExtendsBound() ? syms.botType : wildLowerBound(w.type);
}
else return t;
} | class class_name[name] begin[{]
method[wildLowerBound, return_type[type[Type]], modifier[public], parameter[t]] begin[{]
if[call[t.hasTag, parameter[member[.WILDCARD]]]] begin[{]
local_variable[type[WildcardType], w]
return[TernaryExpression(condition=MethodInvocation(arguments=[], member=isExtendsBound, postfix_operators=[], prefix_operators=[], qualifier=w, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=w, selectors=[])], member=wildLowerBound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=MemberReference(member=botType, postfix_operators=[], prefix_operators=[], qualifier=syms, selectors=[]))]
else begin[{]
return[member[.t]]
end[}]
end[}]
END[}] | Keyword[public] identifier[Type] identifier[wildLowerBound] operator[SEP] identifier[Type] identifier[t] operator[SEP] {
Keyword[if] operator[SEP] identifier[t] operator[SEP] identifier[hasTag] operator[SEP] identifier[WILDCARD] operator[SEP] operator[SEP] {
identifier[WildcardType] identifier[w] operator[=] operator[SEP] identifier[WildcardType] operator[SEP] identifier[t] operator[SEP] Keyword[return] identifier[w] operator[SEP] identifier[isExtendsBound] operator[SEP] operator[SEP] operator[?] identifier[syms] operator[SEP] identifier[botType] operator[:] identifier[wildLowerBound] operator[SEP] identifier[w] operator[SEP] identifier[type] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[return] identifier[t] operator[SEP]
}
|
public void setVpnGatewayIds(java.util.Collection<String> vpnGatewayIds) {
if (vpnGatewayIds == null) {
this.vpnGatewayIds = null;
return;
}
this.vpnGatewayIds = new com.amazonaws.internal.SdkInternalList<String>(vpnGatewayIds);
} | class class_name[name] begin[{]
method[setVpnGatewayIds, return_type[void], modifier[public], parameter[vpnGatewayIds]] begin[{]
if[binary_operation[member[.vpnGatewayIds], ==, literal[null]]] begin[{]
assign[THIS[member[None.vpnGatewayIds]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.vpnGatewayIds]], ClassCreator(arguments=[MemberReference(member=vpnGatewayIds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setVpnGatewayIds] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[vpnGatewayIds] operator[SEP] {
Keyword[if] operator[SEP] identifier[vpnGatewayIds] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[vpnGatewayIds] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[vpnGatewayIds] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[vpnGatewayIds] operator[SEP] operator[SEP]
}
|
@Override
public EObject create(EClass eClass)
{
switch (eClass.getClassifierID())
{
case TypesPackage.JVM_VOID: return createJvmVoid();
case TypesPackage.JVM_PRIMITIVE_TYPE: return createJvmPrimitiveType();
case TypesPackage.JVM_ARRAY_TYPE: return createJvmArrayType();
case TypesPackage.JVM_TYPE_PARAMETER: return createJvmTypeParameter();
case TypesPackage.JVM_UPPER_BOUND: return createJvmUpperBound();
case TypesPackage.JVM_LOWER_BOUND: return createJvmLowerBound();
case TypesPackage.JVM_ANNOTATION_TYPE: return createJvmAnnotationType();
case TypesPackage.JVM_ENUMERATION_TYPE: return createJvmEnumerationType();
case TypesPackage.JVM_ENUMERATION_LITERAL: return createJvmEnumerationLiteral();
case TypesPackage.JVM_GENERIC_TYPE: return createJvmGenericType();
case TypesPackage.JVM_PARAMETERIZED_TYPE_REFERENCE: return createJvmParameterizedTypeReference();
case TypesPackage.JVM_GENERIC_ARRAY_TYPE_REFERENCE: return createJvmGenericArrayTypeReference();
case TypesPackage.JVM_WILDCARD_TYPE_REFERENCE: return createJvmWildcardTypeReference();
case TypesPackage.JVM_ANY_TYPE_REFERENCE: return createJvmAnyTypeReference();
case TypesPackage.JVM_MULTI_TYPE_REFERENCE: return createJvmMultiTypeReference();
case TypesPackage.JVM_FIELD: return createJvmField();
case TypesPackage.JVM_CONSTRUCTOR: return createJvmConstructor();
case TypesPackage.JVM_OPERATION: return createJvmOperation();
case TypesPackage.JVM_FORMAL_PARAMETER: return createJvmFormalParameter();
case TypesPackage.JVM_ANNOTATION_REFERENCE: return createJvmAnnotationReference();
case TypesPackage.JVM_INT_ANNOTATION_VALUE: return createJvmIntAnnotationValue();
case TypesPackage.JVM_BOOLEAN_ANNOTATION_VALUE: return createJvmBooleanAnnotationValue();
case TypesPackage.JVM_BYTE_ANNOTATION_VALUE: return createJvmByteAnnotationValue();
case TypesPackage.JVM_SHORT_ANNOTATION_VALUE: return createJvmShortAnnotationValue();
case TypesPackage.JVM_LONG_ANNOTATION_VALUE: return createJvmLongAnnotationValue();
case TypesPackage.JVM_DOUBLE_ANNOTATION_VALUE: return createJvmDoubleAnnotationValue();
case TypesPackage.JVM_FLOAT_ANNOTATION_VALUE: return createJvmFloatAnnotationValue();
case TypesPackage.JVM_CHAR_ANNOTATION_VALUE: return createJvmCharAnnotationValue();
case TypesPackage.JVM_STRING_ANNOTATION_VALUE: return createJvmStringAnnotationValue();
case TypesPackage.JVM_TYPE_ANNOTATION_VALUE: return createJvmTypeAnnotationValue();
case TypesPackage.JVM_ANNOTATION_ANNOTATION_VALUE: return createJvmAnnotationAnnotationValue();
case TypesPackage.JVM_ENUM_ANNOTATION_VALUE: return createJvmEnumAnnotationValue();
case TypesPackage.JVM_DELEGATE_TYPE_REFERENCE: return createJvmDelegateTypeReference();
case TypesPackage.JVM_SYNONYM_TYPE_REFERENCE: return createJvmSynonymTypeReference();
case TypesPackage.JVM_UNKNOWN_TYPE_REFERENCE: return createJvmUnknownTypeReference();
case TypesPackage.JVM_CUSTOM_ANNOTATION_VALUE: return createJvmCustomAnnotationValue();
case TypesPackage.JVM_INNER_TYPE_REFERENCE: return createJvmInnerTypeReference();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
} | class class_name[name] begin[{]
method[create, return_type[type[EObject]], modifier[public], parameter[eClass]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=JVM_VOID, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmVoid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_PRIMITIVE_TYPE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmPrimitiveType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_ARRAY_TYPE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmArrayType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_TYPE_PARAMETER, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmTypeParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_UPPER_BOUND, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmUpperBound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_LOWER_BOUND, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmLowerBound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_ANNOTATION_TYPE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmAnnotationType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_ENUMERATION_TYPE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmEnumerationType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_ENUMERATION_LITERAL, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmEnumerationLiteral, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_GENERIC_TYPE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmGenericType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_PARAMETERIZED_TYPE_REFERENCE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmParameterizedTypeReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_GENERIC_ARRAY_TYPE_REFERENCE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmGenericArrayTypeReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_WILDCARD_TYPE_REFERENCE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmWildcardTypeReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_ANY_TYPE_REFERENCE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmAnyTypeReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_MULTI_TYPE_REFERENCE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmMultiTypeReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_FIELD, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_CONSTRUCTOR, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmConstructor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_OPERATION, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmOperation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_FORMAL_PARAMETER, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmFormalParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_ANNOTATION_REFERENCE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmAnnotationReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_INT_ANNOTATION_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmIntAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_BOOLEAN_ANNOTATION_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmBooleanAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_BYTE_ANNOTATION_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmByteAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_SHORT_ANNOTATION_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmShortAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_LONG_ANNOTATION_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmLongAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_DOUBLE_ANNOTATION_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmDoubleAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_FLOAT_ANNOTATION_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmFloatAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_CHAR_ANNOTATION_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmCharAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_STRING_ANNOTATION_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmStringAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_TYPE_ANNOTATION_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmTypeAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_ANNOTATION_ANNOTATION_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmAnnotationAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_ENUM_ANNOTATION_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmEnumAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_DELEGATE_TYPE_REFERENCE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmDelegateTypeReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_SYNONYM_TYPE_REFERENCE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmSynonymTypeReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_UNKNOWN_TYPE_REFERENCE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmUnknownTypeReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_CUSTOM_ANNOTATION_VALUE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmCustomAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=JVM_INNER_TYPE_REFERENCE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=createJvmInnerTypeReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The class '"), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=eClass, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid classifier"), 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)])], expression=MethodInvocation(arguments=[], member=getClassifierID, postfix_operators=[], prefix_operators=[], qualifier=eClass, selectors=[], type_arguments=None), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[EObject] identifier[create] operator[SEP] identifier[EClass] identifier[eClass] operator[SEP] {
Keyword[switch] operator[SEP] identifier[eClass] operator[SEP] identifier[getClassifierID] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_VOID] operator[:] Keyword[return] identifier[createJvmVoid] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_PRIMITIVE_TYPE] operator[:] Keyword[return] identifier[createJvmPrimitiveType] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_ARRAY_TYPE] operator[:] Keyword[return] identifier[createJvmArrayType] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_TYPE_PARAMETER] operator[:] Keyword[return] identifier[createJvmTypeParameter] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_UPPER_BOUND] operator[:] Keyword[return] identifier[createJvmUpperBound] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_LOWER_BOUND] operator[:] Keyword[return] identifier[createJvmLowerBound] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_ANNOTATION_TYPE] operator[:] Keyword[return] identifier[createJvmAnnotationType] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_ENUMERATION_TYPE] operator[:] Keyword[return] identifier[createJvmEnumerationType] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_ENUMERATION_LITERAL] operator[:] Keyword[return] identifier[createJvmEnumerationLiteral] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_GENERIC_TYPE] operator[:] Keyword[return] identifier[createJvmGenericType] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_PARAMETERIZED_TYPE_REFERENCE] operator[:] Keyword[return] identifier[createJvmParameterizedTypeReference] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_GENERIC_ARRAY_TYPE_REFERENCE] operator[:] Keyword[return] identifier[createJvmGenericArrayTypeReference] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_WILDCARD_TYPE_REFERENCE] operator[:] Keyword[return] identifier[createJvmWildcardTypeReference] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_ANY_TYPE_REFERENCE] operator[:] Keyword[return] identifier[createJvmAnyTypeReference] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_MULTI_TYPE_REFERENCE] operator[:] Keyword[return] identifier[createJvmMultiTypeReference] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_FIELD] operator[:] Keyword[return] identifier[createJvmField] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_CONSTRUCTOR] operator[:] Keyword[return] identifier[createJvmConstructor] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_OPERATION] operator[:] Keyword[return] identifier[createJvmOperation] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_FORMAL_PARAMETER] operator[:] Keyword[return] identifier[createJvmFormalParameter] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_ANNOTATION_REFERENCE] operator[:] Keyword[return] identifier[createJvmAnnotationReference] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_INT_ANNOTATION_VALUE] operator[:] Keyword[return] identifier[createJvmIntAnnotationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_BOOLEAN_ANNOTATION_VALUE] operator[:] Keyword[return] identifier[createJvmBooleanAnnotationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_BYTE_ANNOTATION_VALUE] operator[:] Keyword[return] identifier[createJvmByteAnnotationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_SHORT_ANNOTATION_VALUE] operator[:] Keyword[return] identifier[createJvmShortAnnotationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_LONG_ANNOTATION_VALUE] operator[:] Keyword[return] identifier[createJvmLongAnnotationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_DOUBLE_ANNOTATION_VALUE] operator[:] Keyword[return] identifier[createJvmDoubleAnnotationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_FLOAT_ANNOTATION_VALUE] operator[:] Keyword[return] identifier[createJvmFloatAnnotationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_CHAR_ANNOTATION_VALUE] operator[:] Keyword[return] identifier[createJvmCharAnnotationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_STRING_ANNOTATION_VALUE] operator[:] Keyword[return] identifier[createJvmStringAnnotationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_TYPE_ANNOTATION_VALUE] operator[:] Keyword[return] identifier[createJvmTypeAnnotationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_ANNOTATION_ANNOTATION_VALUE] operator[:] Keyword[return] identifier[createJvmAnnotationAnnotationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_ENUM_ANNOTATION_VALUE] operator[:] Keyword[return] identifier[createJvmEnumAnnotationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_DELEGATE_TYPE_REFERENCE] operator[:] Keyword[return] identifier[createJvmDelegateTypeReference] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_SYNONYM_TYPE_REFERENCE] operator[:] Keyword[return] identifier[createJvmSynonymTypeReference] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_UNKNOWN_TYPE_REFERENCE] operator[:] Keyword[return] identifier[createJvmUnknownTypeReference] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_CUSTOM_ANNOTATION_VALUE] operator[:] Keyword[return] identifier[createJvmCustomAnnotationValue] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_INNER_TYPE_REFERENCE] operator[:] Keyword[return] identifier[createJvmInnerTypeReference] operator[SEP] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[eClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
|
public static void setESInnerTypeReferences(String type,Class<?> refs){
Map<String,ESClass> typeRefs = innerHitTypeLocalsByType.get();
if(typeRefs == null) {
typeRefs = new HashMap<String, ESClass>();
innerHitTypeLocalsByType.set(typeRefs);
}
typeRefs.put(type,new ESClassType(refs));
} | class class_name[name] begin[{]
method[setESInnerTypeReferences, return_type[void], modifier[public static], parameter[type, refs]] begin[{]
local_variable[type[Map], typeRefs]
if[binary_operation[member[.typeRefs], ==, literal[null]]] begin[{]
assign[member[.typeRefs], 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=None, dimensions=[], name=ESClass, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))]
call[innerHitTypeLocalsByType.set, parameter[member[.typeRefs]]]
else begin[{]
None
end[}]
call[typeRefs.put, parameter[member[.type], ClassCreator(arguments=[MemberReference(member=refs, 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=ESClassType, sub_type=None))]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[setESInnerTypeReferences] operator[SEP] identifier[String] identifier[type] , identifier[Class] operator[<] operator[?] operator[>] identifier[refs] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[ESClass] operator[>] identifier[typeRefs] operator[=] identifier[innerHitTypeLocalsByType] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[typeRefs] operator[==] Other[null] operator[SEP] {
identifier[typeRefs] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[ESClass] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[innerHitTypeLocalsByType] operator[SEP] identifier[set] operator[SEP] identifier[typeRefs] operator[SEP] operator[SEP]
}
identifier[typeRefs] operator[SEP] identifier[put] operator[SEP] identifier[type] , Keyword[new] identifier[ESClassType] operator[SEP] identifier[refs] operator[SEP] operator[SEP] operator[SEP]
}
|
private int ctoi(char c) {
int i = c > IALPHABET_MAX_INDEX ? -1 : IALPHABET[c];
if (i < 0) {
String msg = "Illegal " + getName() + " character: '" + c + "'";
throw new DecodingException(msg);
}
return i;
} | class class_name[name] begin[{]
method[ctoi, return_type[type[int]], modifier[private], parameter[c]] begin[{]
local_variable[type[int], i]
if[binary_operation[member[.i], <, literal[0]]] 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=DecodingException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.i]]
end[}]
END[}] | Keyword[private] Keyword[int] identifier[ctoi] operator[SEP] Keyword[char] identifier[c] operator[SEP] {
Keyword[int] identifier[i] operator[=] identifier[c] operator[>] identifier[IALPHABET_MAX_INDEX] operator[?] operator[-] Other[1] operator[:] identifier[IALPHABET] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[<] Other[0] operator[SEP] {
identifier[String] identifier[msg] operator[=] literal[String] operator[+] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[c] operator[+] literal[String] operator[SEP] Keyword[throw] Keyword[new] identifier[DecodingException] operator[SEP] identifier[msg] operator[SEP] operator[SEP]
}
Keyword[return] identifier[i] operator[SEP]
}
|
public alluxio.grpc.FileSystemMasterCommonPOptions getCommonOptions() {
return commonOptions_ == null ? alluxio.grpc.FileSystemMasterCommonPOptions.getDefaultInstance() : commonOptions_;
} | class class_name[name] begin[{]
method[getCommonOptions, return_type[type[alluxio]], modifier[public], parameter[]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=commonOptions_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=commonOptions_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=getDefaultInstance, postfix_operators=[], prefix_operators=[], qualifier=alluxio.grpc.FileSystemMasterCommonPOptions, selectors=[], type_arguments=None))]
end[}]
END[}] | Keyword[public] identifier[alluxio] operator[SEP] identifier[grpc] operator[SEP] identifier[FileSystemMasterCommonPOptions] identifier[getCommonOptions] operator[SEP] operator[SEP] {
Keyword[return] identifier[commonOptions_] operator[==] Other[null] operator[?] identifier[alluxio] operator[SEP] identifier[grpc] operator[SEP] identifier[FileSystemMasterCommonPOptions] operator[SEP] identifier[getDefaultInstance] operator[SEP] operator[SEP] operator[:] identifier[commonOptions_] operator[SEP]
}
|
public void addAliases(Map<String, String> aliases) {
notNull(aliases, "Aliases must not be null");
for (Map.Entry<String, String> entry : aliases.entrySet()) {
addAlias(entry.getKey(), entry.getValue());
}
} | class class_name[name] begin[{]
method[addAliases, return_type[void], modifier[public], parameter[aliases]] begin[{]
call[.notNull, parameter[member[.aliases], literal["Aliases must not be null"]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=addAlias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=aliases, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=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=Entry, sub_type=None)))), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addAliases] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[aliases] operator[SEP] {
identifier[notNull] operator[SEP] identifier[aliases] , literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[aliases] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[addAlias] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private static VectorTile.Tile.Feature toFeature(Geometry geom,
Vec2d cursor,
MvtLayerProps layerProps,
IUserDataConverter userDataConverter) {
// Guard: UNKNOWN Geometry
final VectorTile.Tile.GeomType mvtGeomType = JtsAdapter.toGeomType(geom);
if(mvtGeomType == VectorTile.Tile.GeomType.UNKNOWN) {
return null;
}
final VectorTile.Tile.Feature.Builder featureBuilder = VectorTile.Tile.Feature.newBuilder();
final boolean mvtClosePath = MvtUtil.shouldClosePath(mvtGeomType);
final List<Integer> mvtGeom = new ArrayList<>();
featureBuilder.setType(mvtGeomType);
if(geom instanceof Point || geom instanceof MultiPoint) {
// Encode as MVT point or multipoint
mvtGeom.addAll(ptsToGeomCmds(geom, cursor));
} else if(geom instanceof LineString || geom instanceof MultiLineString) {
// Encode as MVT linestring or multi-linestring
for (int i = 0; i < geom.getNumGeometries(); ++i) {
mvtGeom.addAll(linesToGeomCmds(geom.getGeometryN(i), mvtClosePath, cursor, 1));
}
} else if(geom instanceof MultiPolygon || geom instanceof Polygon) {
// Encode as MVT polygon or multi-polygon
for(int i = 0; i < geom.getNumGeometries(); ++i) {
final Polygon nextPoly = (Polygon) geom.getGeometryN(i);
final List<Integer> nextPolyGeom = new ArrayList<>();
boolean valid = true;
// Add exterior ring
final LineString exteriorRing = nextPoly.getExteriorRing();
// Area must be non-zero
final double exteriorArea = CGAlgorithms.signedArea(exteriorRing.getCoordinates());
if(((int) Math.round(exteriorArea)) == 0) {
continue;
}
// Check CCW Winding (must be positive area)
if(exteriorArea < 0d) {
CoordinateArrays.reverse(exteriorRing.getCoordinates());
}
nextPolyGeom.addAll(linesToGeomCmds(exteriorRing, mvtClosePath, cursor, 2));
// Add interior rings
for(int ringIndex = 0; ringIndex < nextPoly.getNumInteriorRing(); ++ringIndex) {
final LineString nextInteriorRing = nextPoly.getInteriorRingN(ringIndex);
// Area must be non-zero
final double interiorArea = CGAlgorithms.signedArea(nextInteriorRing.getCoordinates());
if(((int)Math.round(interiorArea)) == 0) {
continue;
}
// Check CW Winding (must be negative area)
if(interiorArea > 0d) {
CoordinateArrays.reverse(nextInteriorRing.getCoordinates());
}
// Interior ring area must be < exterior ring area, or entire geometry is invalid
if(Math.abs(exteriorArea) <= Math.abs(interiorArea)) {
valid = false;
break;
}
nextPolyGeom.addAll(linesToGeomCmds(nextInteriorRing, mvtClosePath, cursor, 2));
}
if(valid) {
mvtGeom.addAll(nextPolyGeom);
}
}
}
if(mvtGeom.size() < 1) {
return null;
}
featureBuilder.addAllGeometry(mvtGeom);
// Feature Properties
userDataConverter.addTags(geom.getUserData(), layerProps, featureBuilder);
return featureBuilder.build();
} | class class_name[name] begin[{]
method[toFeature, return_type[type[VectorTile]], modifier[private static], parameter[geom, cursor, layerProps, userDataConverter]] begin[{]
local_variable[type[VectorTile], mvtGeomType]
if[binary_operation[member[.mvtGeomType], ==, member[VectorTile.Tile.GeomType.UNKNOWN]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[VectorTile], featureBuilder]
local_variable[type[boolean], mvtClosePath]
local_variable[type[List], mvtGeom]
call[featureBuilder.setType, parameter[member[.mvtGeomType]]]
if[binary_operation[binary_operation[member[.geom], instanceof, type[Point]], ||, binary_operation[member[.geom], instanceof, type[MultiPoint]]]] begin[{]
call[mvtGeom.addAll, parameter[call[.ptsToGeomCmds, parameter[member[.geom], member[.cursor]]]]]
else begin[{]
if[binary_operation[binary_operation[member[.geom], instanceof, type[LineString]], ||, binary_operation[member[.geom], instanceof, type[MultiLineString]]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getGeometryN, postfix_operators=[], prefix_operators=[], qualifier=geom, selectors=[], type_arguments=None), MemberReference(member=mvtClosePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cursor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=linesToGeomCmds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=mvtGeom, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumGeometries, postfix_operators=[], prefix_operators=[], qualifier=geom, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
else begin[{]
if[binary_operation[binary_operation[member[.geom], instanceof, type[MultiPolygon]], ||, binary_operation[member[.geom], instanceof, type[Polygon]]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getGeometryN, postfix_operators=[], prefix_operators=[], qualifier=geom, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Polygon, sub_type=None)), name=nextPoly)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Polygon, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=nextPolyGeom)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), name=valid)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getExteriorRing, postfix_operators=[], prefix_operators=[], qualifier=nextPoly, selectors=[], type_arguments=None), name=exteriorRing)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=LineString, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCoordinates, postfix_operators=[], prefix_operators=[], qualifier=exteriorRing, selectors=[], type_arguments=None)], member=signedArea, postfix_operators=[], prefix_operators=[], qualifier=CGAlgorithms, selectors=[], type_arguments=None), name=exteriorArea)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=Cast(expression=MethodInvocation(arguments=[MemberReference(member=exteriorArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=round, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), 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)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=exteriorArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0d), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCoordinates, postfix_operators=[], prefix_operators=[], qualifier=exteriorRing, selectors=[], type_arguments=None)], member=reverse, postfix_operators=[], prefix_operators=[], qualifier=CoordinateArrays, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=exteriorRing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mvtClosePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cursor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=linesToGeomCmds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=nextPolyGeom, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ringIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInteriorRingN, postfix_operators=[], prefix_operators=[], qualifier=nextPoly, selectors=[], type_arguments=None), name=nextInteriorRing)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=LineString, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCoordinates, postfix_operators=[], prefix_operators=[], qualifier=nextInteriorRing, selectors=[], type_arguments=None)], member=signedArea, postfix_operators=[], prefix_operators=[], qualifier=CGAlgorithms, selectors=[], type_arguments=None), name=interiorArea)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=Cast(expression=MethodInvocation(arguments=[MemberReference(member=interiorArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=round, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), 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)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=interiorArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0d), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCoordinates, postfix_operators=[], prefix_operators=[], qualifier=nextInteriorRing, selectors=[], type_arguments=None)], member=reverse, postfix_operators=[], prefix_operators=[], qualifier=CoordinateArrays, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=exteriorArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=interiorArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=valid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=nextInteriorRing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mvtClosePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cursor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=linesToGeomCmds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=nextPolyGeom, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ringIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumInteriorRing, postfix_operators=[], prefix_operators=[], qualifier=nextPoly, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=ringIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ringIndex, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None), IfStatement(condition=MemberReference(member=valid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nextPolyGeom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=mvtGeom, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumGeometries, postfix_operators=[], prefix_operators=[], qualifier=geom, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
else begin[{]
None
end[}]
end[}]
end[}]
if[binary_operation[call[mvtGeom.size, parameter[]], <, literal[1]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
call[featureBuilder.addAllGeometry, parameter[member[.mvtGeom]]]
call[userDataConverter.addTags, parameter[call[geom.getUserData, parameter[]], member[.layerProps], member[.featureBuilder]]]
return[call[featureBuilder.build, parameter[]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[VectorTile] operator[SEP] identifier[Tile] operator[SEP] identifier[Feature] identifier[toFeature] operator[SEP] identifier[Geometry] identifier[geom] , identifier[Vec2d] identifier[cursor] , identifier[MvtLayerProps] identifier[layerProps] , identifier[IUserDataConverter] identifier[userDataConverter] operator[SEP] {
Keyword[final] identifier[VectorTile] operator[SEP] identifier[Tile] operator[SEP] identifier[GeomType] identifier[mvtGeomType] operator[=] identifier[JtsAdapter] operator[SEP] identifier[toGeomType] operator[SEP] identifier[geom] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mvtGeomType] operator[==] identifier[VectorTile] operator[SEP] identifier[Tile] operator[SEP] identifier[GeomType] operator[SEP] identifier[UNKNOWN] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[final] identifier[VectorTile] operator[SEP] identifier[Tile] operator[SEP] identifier[Feature] operator[SEP] identifier[Builder] identifier[featureBuilder] operator[=] identifier[VectorTile] operator[SEP] identifier[Tile] operator[SEP] identifier[Feature] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[mvtClosePath] operator[=] identifier[MvtUtil] operator[SEP] identifier[shouldClosePath] operator[SEP] identifier[mvtGeomType] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Integer] operator[>] identifier[mvtGeom] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[featureBuilder] operator[SEP] identifier[setType] operator[SEP] identifier[mvtGeomType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[geom] Keyword[instanceof] identifier[Point] operator[||] identifier[geom] Keyword[instanceof] identifier[MultiPoint] operator[SEP] {
identifier[mvtGeom] operator[SEP] identifier[addAll] operator[SEP] identifier[ptsToGeomCmds] operator[SEP] identifier[geom] , identifier[cursor] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[geom] Keyword[instanceof] identifier[LineString] operator[||] identifier[geom] Keyword[instanceof] identifier[MultiLineString] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[geom] operator[SEP] identifier[getNumGeometries] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[mvtGeom] operator[SEP] identifier[addAll] operator[SEP] identifier[linesToGeomCmds] operator[SEP] identifier[geom] operator[SEP] identifier[getGeometryN] operator[SEP] identifier[i] operator[SEP] , identifier[mvtClosePath] , identifier[cursor] , Other[1] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[geom] Keyword[instanceof] identifier[MultiPolygon] operator[||] identifier[geom] Keyword[instanceof] identifier[Polygon] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[geom] operator[SEP] identifier[getNumGeometries] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] {
Keyword[final] identifier[Polygon] identifier[nextPoly] operator[=] operator[SEP] identifier[Polygon] operator[SEP] identifier[geom] operator[SEP] identifier[getGeometryN] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Integer] operator[>] identifier[nextPolyGeom] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[valid] operator[=] literal[boolean] operator[SEP] Keyword[final] identifier[LineString] identifier[exteriorRing] operator[=] identifier[nextPoly] operator[SEP] identifier[getExteriorRing] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[double] identifier[exteriorArea] operator[=] identifier[CGAlgorithms] operator[SEP] identifier[signedArea] operator[SEP] identifier[exteriorRing] operator[SEP] identifier[getCoordinates] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[round] operator[SEP] identifier[exteriorArea] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[exteriorArea] operator[<] literal[Float] operator[SEP] {
identifier[CoordinateArrays] operator[SEP] identifier[reverse] operator[SEP] identifier[exteriorRing] operator[SEP] identifier[getCoordinates] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[nextPolyGeom] operator[SEP] identifier[addAll] operator[SEP] identifier[linesToGeomCmds] operator[SEP] identifier[exteriorRing] , identifier[mvtClosePath] , identifier[cursor] , Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ringIndex] operator[=] Other[0] operator[SEP] identifier[ringIndex] operator[<] identifier[nextPoly] operator[SEP] identifier[getNumInteriorRing] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[ringIndex] operator[SEP] {
Keyword[final] identifier[LineString] identifier[nextInteriorRing] operator[=] identifier[nextPoly] operator[SEP] identifier[getInteriorRingN] operator[SEP] identifier[ringIndex] operator[SEP] operator[SEP] Keyword[final] Keyword[double] identifier[interiorArea] operator[=] identifier[CGAlgorithms] operator[SEP] identifier[signedArea] operator[SEP] identifier[nextInteriorRing] operator[SEP] identifier[getCoordinates] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[round] operator[SEP] identifier[interiorArea] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[interiorArea] operator[>] literal[Float] operator[SEP] {
identifier[CoordinateArrays] operator[SEP] identifier[reverse] operator[SEP] identifier[nextInteriorRing] operator[SEP] identifier[getCoordinates] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[exteriorArea] operator[SEP] operator[<=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[interiorArea] operator[SEP] operator[SEP] {
identifier[valid] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
identifier[nextPolyGeom] operator[SEP] identifier[addAll] operator[SEP] identifier[linesToGeomCmds] operator[SEP] identifier[nextInteriorRing] , identifier[mvtClosePath] , identifier[cursor] , Other[2] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[valid] operator[SEP] {
identifier[mvtGeom] operator[SEP] identifier[addAll] operator[SEP] identifier[nextPolyGeom] operator[SEP] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[mvtGeom] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[1] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[featureBuilder] operator[SEP] identifier[addAllGeometry] operator[SEP] identifier[mvtGeom] operator[SEP] operator[SEP] identifier[userDataConverter] operator[SEP] identifier[addTags] operator[SEP] identifier[geom] operator[SEP] identifier[getUserData] operator[SEP] operator[SEP] , identifier[layerProps] , identifier[featureBuilder] operator[SEP] operator[SEP] Keyword[return] identifier[featureBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
public void billingAccount_service_serviceName_directory_PUT(String billingAccount, String serviceName, OvhDirectoryInfo body) throws IOException {
String qPath = "/telephony/{billingAccount}/service/{serviceName}/directory";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | class class_name[name] begin[{]
method[billingAccount_service_serviceName_directory_PUT, return_type[void], modifier[public], parameter[billingAccount, serviceName, body]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
call[.exec, parameter[member[.qPath], literal["PUT"], call[sb.toString, parameter[]], member[.body]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[billingAccount_service_serviceName_directory_PUT] operator[SEP] identifier[String] identifier[billingAccount] , identifier[String] identifier[serviceName] , identifier[OvhDirectoryInfo] identifier[body] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[billingAccount] , identifier[serviceName] operator[SEP] operator[SEP] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[body] operator[SEP] operator[SEP]
}
|
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "direction")
public JAXBElement<DirectionPropertyType> createDirection(DirectionPropertyType value) {
return new JAXBElement<DirectionPropertyType>(_Direction_QNAME, DirectionPropertyType.class, null, value);
} | class class_name[name] begin[{]
method[createDirection, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=_Direction_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DirectionPropertyType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DirectionPropertyType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[DirectionPropertyType] operator[>] identifier[createDirection] operator[SEP] identifier[DirectionPropertyType] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[DirectionPropertyType] operator[>] operator[SEP] identifier[_Direction_QNAME] , identifier[DirectionPropertyType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP]
}
|
public static String getSBln( boolean... blnA ) {
//
String Info = "";
//
if ( blnA == null ) return "?";
if ( blnA.length == 0 ) return "?";
//
for ( int K = 0; K < blnA.length; K ++ ) {
//
Info += ( blnA[ K ] )? "T" : "F";
}
//
return Info;
} | class class_name[name] begin[{]
method[getSBln, return_type[type[String]], modifier[public static], parameter[blnA]] begin[{]
local_variable[type[String], Info]
if[binary_operation[member[.blnA], ==, literal[null]]] begin[{]
return[literal["?"]]
else begin[{]
None
end[}]
if[binary_operation[member[blnA.length], ==, literal[0]]] begin[{]
return[literal["?"]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=Info, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=TernaryExpression(condition=MemberReference(member=blnA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="F"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="T"))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=K, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=blnA, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=K)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=K, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.Info]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getSBln] operator[SEP] Keyword[boolean] operator[...] identifier[blnA] operator[SEP] {
identifier[String] identifier[Info] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[blnA] operator[==] Other[null] operator[SEP] Keyword[return] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[blnA] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] Keyword[return] literal[String] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[K] operator[=] Other[0] operator[SEP] identifier[K] operator[<] identifier[blnA] operator[SEP] identifier[length] operator[SEP] identifier[K] operator[++] operator[SEP] {
identifier[Info] operator[+=] operator[SEP] identifier[blnA] operator[SEP] identifier[K] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP]
}
Keyword[return] identifier[Info] operator[SEP]
}
|
public static byte[] loadBytes(URL url) {
byte[] bytes = null;
try {
bytes = loadBytes(url.openStream());
} catch (IOException ex) {
// ex.printStackTrace();
}
return bytes;
} | class class_name[name] begin[{]
method[loadBytes, return_type[type[byte]], modifier[public static], parameter[url]] begin[{]
local_variable[type[byte], bytes]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=openStream, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None)], member=loadBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None)
return[member[.bytes]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[loadBytes] operator[SEP] identifier[URL] identifier[url] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[bytes] operator[=] identifier[loadBytes] operator[SEP] identifier[url] operator[SEP] identifier[openStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] {
}
Keyword[return] identifier[bytes] operator[SEP]
}
|
public static List<Field> listFields(Class<?> clazz) {
assert clazz != null;
Class<?> entityClass = clazz;
List<Field> list = new ArrayList<Field>();
while (!Object.class.equals(entityClass) && entityClass != null) {
list.addAll(Arrays.asList(entityClass.getDeclaredFields()));
entityClass = entityClass.getSuperclass();
}
return list;
} | class class_name[name] begin[{]
method[listFields, return_type[type[List]], modifier[public static], parameter[clazz]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
local_variable[type[Class], entityClass]
local_variable[type[List], list]
while[binary_operation[ClassReference(postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=entityClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), &&, binary_operation[member[.entityClass], !=, literal[null]]]] begin[{]
call[list.addAll, parameter[call[Arrays.asList, parameter[call[entityClass.getDeclaredFields, parameter[]]]]]]
assign[member[.entityClass], call[entityClass.getSuperclass, parameter[]]]
end[}]
return[member[.list]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Field] operator[>] identifier[listFields] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] {
Keyword[assert] identifier[clazz] operator[!=] Other[null] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[entityClass] operator[=] identifier[clazz] operator[SEP] identifier[List] operator[<] identifier[Field] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Field] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[Object] operator[SEP] Keyword[class] operator[SEP] identifier[equals] operator[SEP] identifier[entityClass] operator[SEP] operator[&&] identifier[entityClass] operator[!=] Other[null] operator[SEP] {
identifier[list] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[entityClass] operator[SEP] identifier[getDeclaredFields] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[entityClass] operator[=] identifier[entityClass] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[list] operator[SEP]
}
|
@Override
public SIUncoordinatedTransaction createUncoordinatedTransaction()
throws SIIncorrectCallException, SIConnectionUnavailableException,
SIResourceException {
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, "createUncoordinatedTransaction");
}
checkValid();
// Check we don't already have an active application local transaction
if (_applicationLocalTransaction != null) {
final SIIncorrectCallException exception = new SIIncorrectCallException(
NLS.getString("ACTIVE_LOCAL_TRAN_CWSIV0150"));
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
SibTr.exception(this, TRACE, exception);
}
throw exception;
}
// Check that there isn't an active container transaction
if (getContainerTransaction() != null) {
final SIIncorrectCallException exception = new SIIncorrectCallException(
NLS.getString("ACTIVE_CONTAINER_TRAN_CWSIV0151"));
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
SibTr.exception(this, TRACE, exception);
}
throw exception;
}
_applicationLocalTransaction = new SibRaUncoordinatedTransaction(
_delegateConnection.createUncoordinatedTransaction());
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exit(this, TRACE, "createUncoordinatedTransaction",
_applicationLocalTransaction);
}
return _applicationLocalTransaction;
} | class class_name[name] begin[{]
method[createUncoordinatedTransaction, return_type[type[SIUncoordinatedTransaction]], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[TRACE.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[THIS[], member[.TRACE], literal["createUncoordinatedTransaction"]]]
else begin[{]
None
end[}]
call[.checkValid, parameter[]]
if[binary_operation[member[._applicationLocalTransaction], !=, literal[null]]] begin[{]
local_variable[type[SIIncorrectCallException], exception]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[TRACE.isEventEnabled, parameter[]]]] begin[{]
call[SibTr.exception, parameter[THIS[], member[.TRACE], member[.exception]]]
else begin[{]
None
end[}]
ThrowStatement(expression=MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
else begin[{]
None
end[}]
if[binary_operation[call[.getContainerTransaction, parameter[]], !=, literal[null]]] begin[{]
local_variable[type[SIIncorrectCallException], exception]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[TRACE.isEventEnabled, parameter[]]]] begin[{]
call[SibTr.exception, parameter[THIS[], member[.TRACE], member[.exception]]]
else begin[{]
None
end[}]
ThrowStatement(expression=MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
else begin[{]
None
end[}]
assign[member[._applicationLocalTransaction], ClassCreator(arguments=[MethodInvocation(arguments=[], member=createUncoordinatedTransaction, postfix_operators=[], prefix_operators=[], qualifier=_delegateConnection, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SibRaUncoordinatedTransaction, sub_type=None))]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[TRACE.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[THIS[], member[.TRACE], literal["createUncoordinatedTransaction"], member[._applicationLocalTransaction]]]
else begin[{]
None
end[}]
return[member[._applicationLocalTransaction]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[SIUncoordinatedTransaction] identifier[createUncoordinatedTransaction] operator[SEP] operator[SEP] Keyword[throws] identifier[SIIncorrectCallException] , identifier[SIConnectionUnavailableException] , identifier[SIResourceException] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[TRACE] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[TRACE] , literal[String] operator[SEP] operator[SEP]
}
identifier[checkValid] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_applicationLocalTransaction] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[SIIncorrectCallException] identifier[exception] operator[=] Keyword[new] identifier[SIIncorrectCallException] operator[SEP] identifier[NLS] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[TRACE] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] Keyword[this] , identifier[TRACE] , identifier[exception] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[exception] operator[SEP]
}
Keyword[if] operator[SEP] identifier[getContainerTransaction] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[SIIncorrectCallException] identifier[exception] operator[=] Keyword[new] identifier[SIIncorrectCallException] operator[SEP] identifier[NLS] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[TRACE] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] Keyword[this] , identifier[TRACE] , identifier[exception] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[exception] operator[SEP]
}
identifier[_applicationLocalTransaction] operator[=] Keyword[new] identifier[SibRaUncoordinatedTransaction] operator[SEP] identifier[_delegateConnection] operator[SEP] identifier[createUncoordinatedTransaction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[TRACE] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[TRACE] , literal[String] , identifier[_applicationLocalTransaction] operator[SEP] operator[SEP]
}
Keyword[return] identifier[_applicationLocalTransaction] operator[SEP]
}
|
@Override
public Long expire(final byte[] key, final int seconds) {
checkIsInMultiOrPipeline();
client.expire(key, seconds);
return client.getIntegerReply();
} | class class_name[name] begin[{]
method[expire, return_type[type[Long]], modifier[public], parameter[key, seconds]] begin[{]
call[.checkIsInMultiOrPipeline, parameter[]]
call[client.expire, parameter[member[.key], member[.seconds]]]
return[call[client.getIntegerReply, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Long] identifier[expire] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[key] , Keyword[final] Keyword[int] identifier[seconds] operator[SEP] {
identifier[checkIsInMultiOrPipeline] operator[SEP] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[expire] operator[SEP] identifier[key] , identifier[seconds] operator[SEP] operator[SEP] Keyword[return] identifier[client] operator[SEP] identifier[getIntegerReply] operator[SEP] operator[SEP] operator[SEP]
}
|
public void addRows(ArrayList<String> rows, String defaultValue) {
CompactCharSequence dv = new CompactCharSequence(defaultValue);
int oldlength = data.length;
int numColumns = 0;
if (data.length > 0 && data[0] != null) {
numColumns = data[0].length;
}
data = (CompactCharSequence[][]) resizeArray(data, data.length + rows.size());
for (int r = 0; r < rows.size(); r++) {
data[oldlength + r] = new CompactCharSequence[numColumns];
for (int c = 0; c < numColumns; c++) {
data[oldlength + r][c] = dv;
}
data[oldlength + r][0] = new CompactCharSequence(rows.get(r));
rowLookup.put(rows.get(r), new HeaderInfo(r + oldlength));
}
} | class class_name[name] begin[{]
method[addRows, return_type[void], modifier[public], parameter[rows, defaultValue]] begin[{]
local_variable[type[CompactCharSequence], dv]
local_variable[type[int], oldlength]
local_variable[type[int], numColumns]
if[binary_operation[binary_operation[member[data.length], >, literal[0]], &&, binary_operation[member[.data], !=, literal[null]]]] begin[{]
assign[member[.numColumns], member[.data]]
else begin[{]
None
end[}]
assign[member[.data], Cast(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=rows, selectors=[], type_arguments=None), operator=+)], member=resizeArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None, None], name=CompactCharSequence, sub_type=None))]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=oldlength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type==, value=ArrayCreator(dimensions=[MemberReference(member=numColumns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CompactCharSequence, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=oldlength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=dv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numColumns, 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=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=c, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=oldlength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=rows, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CompactCharSequence, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=rows, selectors=[], type_arguments=None), ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=oldlength, 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=HeaderInfo, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=rowLookup, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=rows, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=r)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=r, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addRows] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[rows] , identifier[String] identifier[defaultValue] operator[SEP] {
identifier[CompactCharSequence] identifier[dv] operator[=] Keyword[new] identifier[CompactCharSequence] operator[SEP] identifier[defaultValue] operator[SEP] operator[SEP] Keyword[int] identifier[oldlength] operator[=] identifier[data] operator[SEP] identifier[length] operator[SEP] Keyword[int] identifier[numColumns] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[data] operator[SEP] identifier[length] operator[>] Other[0] operator[&&] identifier[data] operator[SEP] Other[0] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[numColumns] operator[=] identifier[data] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP]
}
identifier[data] operator[=] operator[SEP] identifier[CompactCharSequence] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[resizeArray] operator[SEP] identifier[data] , identifier[data] operator[SEP] identifier[length] operator[+] identifier[rows] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[r] operator[=] Other[0] operator[SEP] identifier[r] operator[<] identifier[rows] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[r] operator[++] operator[SEP] {
identifier[data] operator[SEP] identifier[oldlength] operator[+] identifier[r] operator[SEP] operator[=] Keyword[new] identifier[CompactCharSequence] operator[SEP] identifier[numColumns] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] identifier[c] operator[<] identifier[numColumns] operator[SEP] identifier[c] operator[++] operator[SEP] {
identifier[data] operator[SEP] identifier[oldlength] operator[+] identifier[r] operator[SEP] operator[SEP] identifier[c] operator[SEP] operator[=] identifier[dv] operator[SEP]
}
identifier[data] operator[SEP] identifier[oldlength] operator[+] identifier[r] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[new] identifier[CompactCharSequence] operator[SEP] identifier[rows] operator[SEP] identifier[get] operator[SEP] identifier[r] operator[SEP] operator[SEP] operator[SEP] identifier[rowLookup] operator[SEP] identifier[put] operator[SEP] identifier[rows] operator[SEP] identifier[get] operator[SEP] identifier[r] operator[SEP] , Keyword[new] identifier[HeaderInfo] operator[SEP] identifier[r] operator[+] identifier[oldlength] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public ConfigOptionBuilder setDefaultWith( Object defaultValue ) {
co.setHasDefault( true );
co.setValue( defaultValue );
return setOptional();
} | class class_name[name] begin[{]
method[setDefaultWith, return_type[type[ConfigOptionBuilder]], modifier[public], parameter[defaultValue]] begin[{]
call[co.setHasDefault, parameter[literal[true]]]
call[co.setValue, parameter[member[.defaultValue]]]
return[call[.setOptional, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[ConfigOptionBuilder] identifier[setDefaultWith] operator[SEP] identifier[Object] identifier[defaultValue] operator[SEP] {
identifier[co] operator[SEP] identifier[setHasDefault] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[co] operator[SEP] identifier[setValue] operator[SEP] identifier[defaultValue] operator[SEP] operator[SEP] Keyword[return] identifier[setOptional] operator[SEP] operator[SEP] operator[SEP]
}
|
public AbstractBuilder getPackageSummaryBuilder(PackageElement pkg, PackageElement prevPkg,
PackageElement nextPkg) {
return PackageSummaryBuilder.getInstance(context, pkg,
writerFactory.getPackageSummaryWriter(pkg, prevPkg, nextPkg));
} | class class_name[name] begin[{]
method[getPackageSummaryBuilder, return_type[type[AbstractBuilder]], modifier[public], parameter[pkg, prevPkg, nextPkg]] begin[{]
return[call[PackageSummaryBuilder.getInstance, parameter[member[.context], member[.pkg], call[writerFactory.getPackageSummaryWriter, parameter[member[.pkg], member[.prevPkg], member[.nextPkg]]]]]]
end[}]
END[}] | Keyword[public] identifier[AbstractBuilder] identifier[getPackageSummaryBuilder] operator[SEP] identifier[PackageElement] identifier[pkg] , identifier[PackageElement] identifier[prevPkg] , identifier[PackageElement] identifier[nextPkg] operator[SEP] {
Keyword[return] identifier[PackageSummaryBuilder] operator[SEP] identifier[getInstance] operator[SEP] identifier[context] , identifier[pkg] , identifier[writerFactory] operator[SEP] identifier[getPackageSummaryWriter] operator[SEP] identifier[pkg] , identifier[prevPkg] , identifier[nextPkg] operator[SEP] operator[SEP] operator[SEP]
}
|
public void warn(final Marker marker, final String message, final Object object) {
log.warn(marker, sanitize(message), object);
} | class class_name[name] begin[{]
method[warn, return_type[void], modifier[public], parameter[marker, message, object]] begin[{]
call[log.warn, parameter[member[.marker], call[.sanitize, parameter[member[.message]]], member[.object]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[warn] operator[SEP] Keyword[final] identifier[Marker] identifier[marker] , Keyword[final] identifier[String] identifier[message] , Keyword[final] identifier[Object] identifier[object] operator[SEP] {
identifier[log] operator[SEP] identifier[warn] operator[SEP] identifier[marker] , identifier[sanitize] operator[SEP] identifier[message] operator[SEP] , identifier[object] operator[SEP] operator[SEP]
}
|
public void run()
{
String strClassName = this.getProperty(DBParams.RECORD);
Record record = Record.makeRecordFromClassName(strClassName, this);
String strObjectID = this.getProperty(DBConstants.OBJECT_ID);
try {
record.addNew();
record.getCounterField().setString(strObjectID);
if (record.seek(DBConstants.EQUALS))
{
String strField = this.getProperty(DBParams.FIELD);
String strValue = this.getProperty(DBParams.VALUE);
if ("[random]".equalsIgnoreCase(strValue))
strValue = Double.toString(Math.random());
BaseField field = record.getField(strField);
if (field != null)
{
record.edit();
field.setString(strValue);
record.set();
}
}
} catch (DBException e) {
e.printStackTrace();
}
record.free();
} | class class_name[name] begin[{]
method[run, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[String], strClassName]
local_variable[type[Record], record]
local_variable[type[String], strObjectID]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=addNew, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getCounterField, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[MethodInvocation(arguments=[MemberReference(member=strObjectID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=EQUALS, postfix_operators=[], prefix_operators=[], qualifier=DBConstants, selectors=[])], member=seek, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=FIELD, postfix_operators=[], prefix_operators=[], qualifier=DBParams, selectors=[])], member=getProperty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=strField)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=VALUE, postfix_operators=[], prefix_operators=[], qualifier=DBParams, selectors=[])], member=getProperty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=strValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=strValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="[random]"), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=strValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=random, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None)), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=strField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BaseField, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=field, 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=[], member=edit, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=strValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setString, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=set, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None)]))]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DBException']))], finally_block=None, label=None, resources=None)
call[record.free, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[String] identifier[strClassName] operator[=] Keyword[this] operator[SEP] identifier[getProperty] operator[SEP] identifier[DBParams] operator[SEP] identifier[RECORD] operator[SEP] operator[SEP] identifier[Record] identifier[record] operator[=] identifier[Record] operator[SEP] identifier[makeRecordFromClassName] operator[SEP] identifier[strClassName] , Keyword[this] operator[SEP] operator[SEP] identifier[String] identifier[strObjectID] operator[=] Keyword[this] operator[SEP] identifier[getProperty] operator[SEP] identifier[DBConstants] operator[SEP] identifier[OBJECT_ID] operator[SEP] operator[SEP] Keyword[try] {
identifier[record] operator[SEP] identifier[addNew] operator[SEP] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[getCounterField] operator[SEP] operator[SEP] operator[SEP] identifier[setString] operator[SEP] identifier[strObjectID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[record] operator[SEP] identifier[seek] operator[SEP] identifier[DBConstants] operator[SEP] identifier[EQUALS] operator[SEP] operator[SEP] {
identifier[String] identifier[strField] operator[=] Keyword[this] operator[SEP] identifier[getProperty] operator[SEP] identifier[DBParams] operator[SEP] identifier[FIELD] operator[SEP] operator[SEP] identifier[String] identifier[strValue] operator[=] Keyword[this] operator[SEP] identifier[getProperty] operator[SEP] identifier[DBParams] operator[SEP] identifier[VALUE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[strValue] operator[SEP] operator[SEP] identifier[strValue] operator[=] identifier[Double] operator[SEP] identifier[toString] operator[SEP] identifier[Math] operator[SEP] identifier[random] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[BaseField] identifier[field] operator[=] identifier[record] operator[SEP] identifier[getField] operator[SEP] identifier[strField] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[!=] Other[null] operator[SEP] {
identifier[record] operator[SEP] identifier[edit] operator[SEP] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setString] operator[SEP] identifier[strValue] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[set] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[DBException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
identifier[record] operator[SEP] identifier[free] operator[SEP] operator[SEP] operator[SEP]
}
|
public EbeanQueryWrapper bindAndPrepare(EbeanQueryWrapper query) {
Assert.notNull(query, "query must not be null!");
return bindAndPrepare(query, parameters);
} | class class_name[name] begin[{]
method[bindAndPrepare, return_type[type[EbeanQueryWrapper]], modifier[public], parameter[query]] begin[{]
call[Assert.notNull, parameter[member[.query], literal["query must not be null!"]]]
return[call[.bindAndPrepare, parameter[member[.query], member[.parameters]]]]
end[}]
END[}] | Keyword[public] identifier[EbeanQueryWrapper] identifier[bindAndPrepare] operator[SEP] identifier[EbeanQueryWrapper] identifier[query] operator[SEP] {
identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[query] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[bindAndPrepare] operator[SEP] identifier[query] , identifier[parameters] operator[SEP] operator[SEP]
}
|
@NonNull
public BatchStatementBuilder addStatements(@NonNull BatchableStatement<?>... statements) {
return addStatements(Arrays.asList(statements));
} | class class_name[name] begin[{]
method[addStatements, return_type[type[BatchStatementBuilder]], modifier[public], parameter[statements]] begin[{]
return[call[.addStatements, parameter[call[Arrays.asList, parameter[member[.statements]]]]]]
end[}]
END[}] | annotation[@] identifier[NonNull] Keyword[public] identifier[BatchStatementBuilder] identifier[addStatements] operator[SEP] annotation[@] identifier[NonNull] identifier[BatchableStatement] operator[<] operator[?] operator[>] operator[...] identifier[statements] operator[SEP] {
Keyword[return] identifier[addStatements] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[statements] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Class<?> getRealClass(Class<?> clazz) {
Class<?> realClazz = clazz;
if (isWeldProxy(clazz)) {
realClazz = clazz.getSuperclass();
}
return realClazz;
} | class class_name[name] begin[{]
method[getRealClass, return_type[type[Class]], modifier[public static], parameter[clazz]] begin[{]
local_variable[type[Class], realClazz]
if[call[.isWeldProxy, parameter[member[.clazz]]]] begin[{]
assign[member[.realClazz], call[clazz.getSuperclass, parameter[]]]
else begin[{]
None
end[}]
return[member[.realClazz]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Class] operator[<] operator[?] operator[>] identifier[getRealClass] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] {
identifier[Class] operator[<] operator[?] operator[>] identifier[realClazz] operator[=] identifier[clazz] operator[SEP] Keyword[if] operator[SEP] identifier[isWeldProxy] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] {
identifier[realClazz] operator[=] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[realClazz] operator[SEP]
}
|
private SQLPPMapping extractPPMapping(Optional<SQLPPMapping> ppMapping) throws MappingException, SQLException {
SQLPPMapping mapping;
if (!ppMapping.isPresent()) {
it.unibz.inf.ontop.spec.mapping.PrefixManager prefixManager = specificationFactory.createPrefixManager(ImmutableMap.of());
MappingMetadata mappingMetadata = specificationFactory.createMetadata(prefixManager,
UriTemplateMatcher.create(Stream.empty(), termFactory));
mapping = ppMappingFactory.createSQLPreProcessedMapping(ImmutableList.of(), mappingMetadata);
}
else
mapping = ppMapping.get();
currentMappingIndex = mapping.getTripleMaps().size() + 1;
return bootstrapMappings(mapping);
} | class class_name[name] begin[{]
method[extractPPMapping, return_type[type[SQLPPMapping]], modifier[private], parameter[ppMapping]] begin[{]
local_variable[type[SQLPPMapping], mapping]
if[call[ppMapping.isPresent, parameter[]]] begin[{]
local_variable[type[it], prefixManager]
local_variable[type[MappingMetadata], mappingMetadata]
assign[member[.mapping], call[ppMappingFactory.createSQLPreProcessedMapping, parameter[call[ImmutableList.of, parameter[]], member[.mappingMetadata]]]]
else begin[{]
assign[member[.mapping], call[ppMapping.get, parameter[]]]
end[}]
assign[member[.currentMappingIndex], binary_operation[call[mapping.getTripleMaps, parameter[]], +, literal[1]]]
return[call[.bootstrapMappings, parameter[member[.mapping]]]]
end[}]
END[}] | Keyword[private] identifier[SQLPPMapping] identifier[extractPPMapping] operator[SEP] identifier[Optional] operator[<] identifier[SQLPPMapping] operator[>] identifier[ppMapping] operator[SEP] Keyword[throws] identifier[MappingException] , identifier[SQLException] {
identifier[SQLPPMapping] identifier[mapping] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[ppMapping] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
identifier[it] operator[SEP] identifier[unibz] operator[SEP] identifier[inf] operator[SEP] identifier[ontop] operator[SEP] identifier[spec] operator[SEP] identifier[mapping] operator[SEP] identifier[PrefixManager] identifier[prefixManager] operator[=] identifier[specificationFactory] operator[SEP] identifier[createPrefixManager] operator[SEP] identifier[ImmutableMap] operator[SEP] identifier[of] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[MappingMetadata] identifier[mappingMetadata] operator[=] identifier[specificationFactory] operator[SEP] identifier[createMetadata] operator[SEP] identifier[prefixManager] , identifier[UriTemplateMatcher] operator[SEP] identifier[create] operator[SEP] identifier[Stream] operator[SEP] identifier[empty] operator[SEP] operator[SEP] , identifier[termFactory] operator[SEP] operator[SEP] operator[SEP] identifier[mapping] operator[=] identifier[ppMappingFactory] operator[SEP] identifier[createSQLPreProcessedMapping] operator[SEP] identifier[ImmutableList] operator[SEP] identifier[of] operator[SEP] operator[SEP] , identifier[mappingMetadata] operator[SEP] operator[SEP]
}
Keyword[else] identifier[mapping] operator[=] identifier[ppMapping] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[currentMappingIndex] operator[=] identifier[mapping] operator[SEP] identifier[getTripleMaps] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[return] identifier[bootstrapMappings] operator[SEP] identifier[mapping] operator[SEP] operator[SEP]
}
|
protected static void addCowthinkOption() {
if (!options.hasOption(null)) {
options.addOption(null, Opt.THINK.text, false, "");
}
} | class class_name[name] begin[{]
method[addCowthinkOption, return_type[void], modifier[static protected], parameter[]] begin[{]
if[call[options.hasOption, parameter[literal[null]]]] begin[{]
call[options.addOption, parameter[literal[null], member[Opt.THINK.text], literal[false], literal[""]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[static] Keyword[void] identifier[addCowthinkOption] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[options] operator[SEP] identifier[hasOption] operator[SEP] Other[null] operator[SEP] operator[SEP] {
identifier[options] operator[SEP] identifier[addOption] operator[SEP] Other[null] , identifier[Opt] operator[SEP] identifier[THINK] operator[SEP] identifier[text] , literal[boolean] , literal[String] operator[SEP] operator[SEP]
}
}
|
public static <T> T[] append(T[] array, int currentSize, T element) {
assert currentSize <= array.length;
if (currentSize + 1 > array.length) {
@SuppressWarnings("unchecked")
T[] newArray = (T[]) new Object[growSize(currentSize)];
System.arraycopy(array, 0, newArray, 0, currentSize);
array = newArray;
}
array[currentSize] = element;
return array;
} | class class_name[name] begin[{]
method[append, return_type[type[T]], modifier[public static], parameter[array, currentSize, element]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=currentSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=array, selectors=[]), operator=<=), label=None, value=None)
if[binary_operation[binary_operation[member[.currentSize], +, literal[1]], >, member[array.length]]] begin[{]
local_variable[type[T], newArray]
call[System.arraycopy, parameter[member[.array], literal[0], member[.newArray], literal[0], member[.currentSize]]]
assign[member[.array], member[.newArray]]
else begin[{]
None
end[}]
assign[member[.array], member[.element]]
return[member[.array]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[array] , Keyword[int] identifier[currentSize] , identifier[T] identifier[element] operator[SEP] {
Keyword[assert] identifier[currentSize] operator[<=] identifier[array] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[currentSize] operator[+] Other[1] operator[>] identifier[array] operator[SEP] identifier[length] operator[SEP] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[newArray] operator[=] operator[SEP] identifier[T] operator[SEP] operator[SEP] operator[SEP] Keyword[new] identifier[Object] operator[SEP] identifier[growSize] operator[SEP] identifier[currentSize] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[array] , Other[0] , identifier[newArray] , Other[0] , identifier[currentSize] operator[SEP] operator[SEP] identifier[array] operator[=] identifier[newArray] operator[SEP]
}
identifier[array] operator[SEP] identifier[currentSize] operator[SEP] operator[=] identifier[element] operator[SEP] Keyword[return] identifier[array] operator[SEP]
}
|
public void setDIRECTION(Integer newDIRECTION) {
Integer oldDIRECTION = direction;
direction = newDIRECTION;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.GSCD__DIRECTION, oldDIRECTION, direction));
} | class class_name[name] begin[{]
method[setDIRECTION, return_type[void], modifier[public], parameter[newDIRECTION]] begin[{]
local_variable[type[Integer], oldDIRECTION]
assign[member[.direction], member[.newDIRECTION]]
if[call[.eNotificationRequired, parameter[]]] begin[{]
call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=GSCD__DIRECTION, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[]), MemberReference(member=oldDIRECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=direction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ENotificationImpl, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setDIRECTION] operator[SEP] identifier[Integer] identifier[newDIRECTION] operator[SEP] {
identifier[Integer] identifier[oldDIRECTION] operator[=] identifier[direction] operator[SEP] identifier[direction] operator[=] identifier[newDIRECTION] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[AfplibPackage] operator[SEP] identifier[GSCD__DIRECTION] , identifier[oldDIRECTION] , identifier[direction] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered())
return;
ProgressBar progressBar = (ProgressBar) component;
ResponseWriter rw = context.getResponseWriter();
String clientId = progressBar.getClientId();
String span = startColSpanDiv(rw, progressBar);
rw.startElement("div", progressBar); // outer div
rw.writeAttribute("class", "progress", "class");
rw.writeAttribute("id", clientId, "id");
rw.writeAttribute("class", progressBar.getStyleClass(), null);
rw.writeAttribute("style", progressBar.getStyle(), null);
Tooltip.generateTooltip(context, progressBar, rw);
rw.startElement("div", progressBar); // inner div, responsible for the actual bar
int max = progressBar.getMax();
int min = progressBar.getMin();
if (max == min)
throw new FacesException("ProgressBar: max and min values must not match.");
String svalue = progressBar.getValue();
if (null == svalue) {
throw new FacesException("Please define the value of the progressbar. It must not be null, nor may it be omitted.");
}
double value = Double.parseDouble(svalue);
double progressCompletion = (value - min) / (max - min) * 100;
String style = "width: " + progressCompletion + "%;";
//append inline style, if set
style += progressBar.getContentStyle() != null ? progressBar.getContentStyle() : "";
rw.writeAttribute("style", style, null);
rw.writeAttribute("role", "progressbar", "role");
rw.writeAttribute("aria-valuemax", max, "aria-valuemax");
rw.writeAttribute("aria-valuemin", min, "aria-valuemin");
rw.writeAttribute("aria-valuenow", progressCompletion, "aria-valuenow");
NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits(progressBar.getMaxDecimalPlaces());
String caption = progressBar.getCaption();
if (caption != null && !caption.isEmpty())
rw.writeAttribute("aria-valuetext", caption, "aria-valuetext");
writeStyleClass(progressBar, rw);
String labelText = caption != null ? caption : nf.format(progressCompletion) + "%";
writeCaption(progressBar, rw, labelText);
rw.endElement("div");
rw.endElement("div");
closeColSpanDiv(rw, span);
Tooltip.activateTooltips(context, progressBar);
} | class class_name[name] begin[{]
method[encodeBegin, return_type[void], modifier[public], parameter[context, component]] begin[{]
if[call[component.isRendered, parameter[]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[ProgressBar], progressBar]
local_variable[type[ResponseWriter], rw]
local_variable[type[String], clientId]
local_variable[type[String], span]
call[rw.startElement, parameter[literal["div"], member[.progressBar]]]
call[rw.writeAttribute, parameter[literal["class"], literal["progress"], literal["class"]]]
call[rw.writeAttribute, parameter[literal["id"], member[.clientId], literal["id"]]]
call[rw.writeAttribute, parameter[literal["class"], call[progressBar.getStyleClass, parameter[]], literal[null]]]
call[rw.writeAttribute, parameter[literal["style"], call[progressBar.getStyle, parameter[]], literal[null]]]
call[Tooltip.generateTooltip, parameter[member[.context], member[.progressBar], member[.rw]]]
call[rw.startElement, parameter[literal["div"], member[.progressBar]]]
local_variable[type[int], max]
local_variable[type[int], min]
if[binary_operation[member[.max], ==, member[.min]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ProgressBar: max and min values must not match.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FacesException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], svalue]
if[binary_operation[literal[null], ==, member[.svalue]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Please define the value of the progressbar. It must not be null, nor may it be omitted.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FacesException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[double], value]
local_variable[type[double], progressCompletion]
local_variable[type[String], style]
assign[member[.style], TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getContentStyle, postfix_operators=[], prefix_operators=[], qualifier=progressBar, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=MethodInvocation(arguments=[], member=getContentStyle, postfix_operators=[], prefix_operators=[], qualifier=progressBar, selectors=[], type_arguments=None))]
call[rw.writeAttribute, parameter[literal["style"], member[.style], literal[null]]]
call[rw.writeAttribute, parameter[literal["role"], literal["progressbar"], literal["role"]]]
call[rw.writeAttribute, parameter[literal["aria-valuemax"], member[.max], literal["aria-valuemax"]]]
call[rw.writeAttribute, parameter[literal["aria-valuemin"], member[.min], literal["aria-valuemin"]]]
call[rw.writeAttribute, parameter[literal["aria-valuenow"], member[.progressCompletion], literal["aria-valuenow"]]]
local_variable[type[NumberFormat], nf]
call[nf.setMaximumFractionDigits, parameter[call[progressBar.getMaxDecimalPlaces, parameter[]]]]
local_variable[type[String], caption]
if[binary_operation[binary_operation[member[.caption], !=, literal[null]], &&, call[caption.isEmpty, parameter[]]]] begin[{]
call[rw.writeAttribute, parameter[literal["aria-valuetext"], member[.caption], literal["aria-valuetext"]]]
else begin[{]
None
end[}]
call[.writeStyleClass, parameter[member[.progressBar], member[.rw]]]
local_variable[type[String], labelText]
call[.writeCaption, parameter[member[.progressBar], member[.rw], member[.labelText]]]
call[rw.endElement, parameter[literal["div"]]]
call[rw.endElement, parameter[literal["div"]]]
call[.closeColSpanDiv, parameter[member[.rw], member[.span]]]
call[Tooltip.activateTooltips, parameter[member[.context], member[.progressBar]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[encodeBegin] operator[SEP] identifier[FacesContext] identifier[context] , identifier[UIComponent] identifier[component] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] operator[!] identifier[component] operator[SEP] identifier[isRendered] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[ProgressBar] identifier[progressBar] operator[=] operator[SEP] identifier[ProgressBar] operator[SEP] identifier[component] operator[SEP] identifier[ResponseWriter] identifier[rw] operator[=] identifier[context] operator[SEP] identifier[getResponseWriter] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[clientId] operator[=] identifier[progressBar] operator[SEP] identifier[getClientId] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[span] operator[=] identifier[startColSpanDiv] operator[SEP] identifier[rw] , identifier[progressBar] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[startElement] operator[SEP] literal[String] , identifier[progressBar] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , identifier[clientId] , literal[String] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , identifier[progressBar] operator[SEP] identifier[getStyleClass] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , identifier[progressBar] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] identifier[Tooltip] operator[SEP] identifier[generateTooltip] operator[SEP] identifier[context] , identifier[progressBar] , identifier[rw] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[startElement] operator[SEP] literal[String] , identifier[progressBar] operator[SEP] operator[SEP] Keyword[int] identifier[max] operator[=] identifier[progressBar] operator[SEP] identifier[getMax] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[min] operator[=] identifier[progressBar] operator[SEP] identifier[getMin] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[max] operator[==] identifier[min] operator[SEP] Keyword[throw] Keyword[new] identifier[FacesException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[svalue] operator[=] identifier[progressBar] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[svalue] operator[SEP] {
Keyword[throw] Keyword[new] identifier[FacesException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[double] identifier[value] operator[=] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[svalue] operator[SEP] operator[SEP] Keyword[double] identifier[progressCompletion] operator[=] operator[SEP] identifier[value] operator[-] identifier[min] operator[SEP] operator[/] operator[SEP] identifier[max] operator[-] identifier[min] operator[SEP] operator[*] Other[100] operator[SEP] identifier[String] identifier[style] operator[=] literal[String] operator[+] identifier[progressCompletion] operator[+] literal[String] operator[SEP] identifier[style] operator[+=] identifier[progressBar] operator[SEP] identifier[getContentStyle] operator[SEP] operator[SEP] operator[!=] Other[null] operator[?] identifier[progressBar] operator[SEP] identifier[getContentStyle] operator[SEP] operator[SEP] operator[:] literal[String] operator[SEP] identifier[rw] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , identifier[style] , Other[null] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , identifier[max] , literal[String] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , identifier[min] , literal[String] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , identifier[progressCompletion] , literal[String] operator[SEP] operator[SEP] identifier[NumberFormat] identifier[nf] operator[=] identifier[NumberFormat] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[nf] operator[SEP] identifier[setMaximumFractionDigits] operator[SEP] identifier[progressBar] operator[SEP] identifier[getMaxDecimalPlaces] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[caption] operator[=] identifier[progressBar] operator[SEP] identifier[getCaption] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[caption] operator[!=] Other[null] operator[&&] operator[!] identifier[caption] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , identifier[caption] , literal[String] operator[SEP] operator[SEP] identifier[writeStyleClass] operator[SEP] identifier[progressBar] , identifier[rw] operator[SEP] operator[SEP] identifier[String] identifier[labelText] operator[=] identifier[caption] operator[!=] Other[null] operator[?] identifier[caption] operator[:] identifier[nf] operator[SEP] identifier[format] operator[SEP] identifier[progressCompletion] operator[SEP] operator[+] literal[String] operator[SEP] identifier[writeCaption] operator[SEP] identifier[progressBar] , identifier[rw] , identifier[labelText] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[endElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[endElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[closeColSpanDiv] operator[SEP] identifier[rw] , identifier[span] operator[SEP] operator[SEP] identifier[Tooltip] operator[SEP] identifier[activateTooltips] operator[SEP] identifier[context] , identifier[progressBar] operator[SEP] operator[SEP]
}
|
public static <T> Schema<T> createFrom(RuntimeSchema<T> ms,
Instantiator<T> instantiator,
Factory vf,
Predicate.Factory pf,
String... args)
{
return vf.create(ms, instantiator, pf, args);
} | class class_name[name] begin[{]
method[createFrom, return_type[type[Schema]], modifier[public static], parameter[ms, instantiator, vf, pf, args]] begin[{]
return[call[vf.create, parameter[member[.ms], member[.instantiator], member[.pf], member[.args]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Schema] operator[<] identifier[T] operator[>] identifier[createFrom] operator[SEP] identifier[RuntimeSchema] operator[<] identifier[T] operator[>] identifier[ms] , identifier[Instantiator] operator[<] identifier[T] operator[>] identifier[instantiator] , identifier[Factory] identifier[vf] , identifier[Predicate] operator[SEP] identifier[Factory] identifier[pf] , identifier[String] operator[...] identifier[args] operator[SEP] {
Keyword[return] identifier[vf] operator[SEP] identifier[create] operator[SEP] identifier[ms] , identifier[instantiator] , identifier[pf] , identifier[args] operator[SEP] operator[SEP]
}
|
public BooleanExpression isRing() {
if (ring == null) {
ring = Expressions.booleanOperation(SpatialOps.IS_RING, mixin);
}
return ring;
} | class class_name[name] begin[{]
method[isRing, return_type[type[BooleanExpression]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ring], ==, literal[null]]] begin[{]
assign[member[.ring], call[Expressions.booleanOperation, parameter[member[SpatialOps.IS_RING], member[.mixin]]]]
else begin[{]
None
end[}]
return[member[.ring]]
end[}]
END[}] | Keyword[public] identifier[BooleanExpression] identifier[isRing] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ring] operator[==] Other[null] operator[SEP] {
identifier[ring] operator[=] identifier[Expressions] operator[SEP] identifier[booleanOperation] operator[SEP] identifier[SpatialOps] operator[SEP] identifier[IS_RING] , identifier[mixin] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ring] operator[SEP]
}
|
public static BaseResult productClear(String accessToken, ProductGet productGet) {
return productClear(accessToken, JsonUtil.toJSONString(productGet));
} | class class_name[name] begin[{]
method[productClear, return_type[type[BaseResult]], modifier[public static], parameter[accessToken, productGet]] begin[{]
return[call[.productClear, parameter[member[.accessToken], call[JsonUtil.toJSONString, parameter[member[.productGet]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[BaseResult] identifier[productClear] operator[SEP] identifier[String] identifier[accessToken] , identifier[ProductGet] identifier[productGet] operator[SEP] {
Keyword[return] identifier[productClear] operator[SEP] identifier[accessToken] , identifier[JsonUtil] operator[SEP] identifier[toJSONString] operator[SEP] identifier[productGet] operator[SEP] operator[SEP] operator[SEP]
}
|
@MustBeLocked (ELockType.WRITE)
protected final void internalMarkItemDeleted (@Nonnull final IMPLTYPE aItem)
{
internalMarkItemDeleted (aItem, true);
} | class class_name[name] begin[{]
method[internalMarkItemDeleted, return_type[void], modifier[final protected], parameter[aItem]] begin[{]
call[.internalMarkItemDeleted, parameter[member[.aItem], literal[true]]]
end[}]
END[}] | annotation[@] identifier[MustBeLocked] operator[SEP] identifier[ELockType] operator[SEP] identifier[WRITE] operator[SEP] Keyword[protected] Keyword[final] Keyword[void] identifier[internalMarkItemDeleted] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[IMPLTYPE] identifier[aItem] operator[SEP] {
identifier[internalMarkItemDeleted] operator[SEP] identifier[aItem] , literal[boolean] operator[SEP] operator[SEP]
}
|
public CreateRouteResult withAuthorizationScopes(String... authorizationScopes) {
if (this.authorizationScopes == null) {
setAuthorizationScopes(new java.util.ArrayList<String>(authorizationScopes.length));
}
for (String ele : authorizationScopes) {
this.authorizationScopes.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withAuthorizationScopes, return_type[type[CreateRouteResult]], modifier[public], parameter[authorizationScopes]] begin[{]
if[binary_operation[THIS[member[None.authorizationScopes]], ==, literal[null]]] begin[{]
call[.setAuthorizationScopes, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=authorizationScopes, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, 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=authorizationScopes, 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=authorizationScopes, 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=String, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[CreateRouteResult] identifier[withAuthorizationScopes] operator[SEP] identifier[String] operator[...] identifier[authorizationScopes] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[authorizationScopes] operator[==] Other[null] operator[SEP] {
identifier[setAuthorizationScopes] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[authorizationScopes] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[authorizationScopes] operator[SEP] {
Keyword[this] operator[SEP] identifier[authorizationScopes] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
private <T> DeferredAction<M> deferAction(
final M metadata, final Supplier<? extends CompletionStage<T>> action,
final CompletableFuture<T> future
) {
return new DeferredAction<>(metadata, () -> {
final CompletionStage<? extends T> resultFuture;
try {
resultFuture = action.get();
} catch (final Exception e) {
future.completeExceptionally(e);
markProcessed(metadata);
return;
}
resultFuture.handleAsync((result, e) -> {
if (e != null) {
future.completeExceptionally(e);
} else {
future.complete(result);
}
markProcessed(metadata);
return null;
}, executor);
});
} | class class_name[name] begin[{]
method[deferAction, return_type[type[DeferredAction]], modifier[private], parameter[metadata, action, future]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=resultFuture)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=CompletionStage, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=resultFuture, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=action, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=completeExceptionally, postfix_operators=[], prefix_operators=[], qualifier=future, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=markProcessed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[LambdaExpression(body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=complete, postfix_operators=[], prefix_operators=[], qualifier=future, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=completeExceptionally, postfix_operators=[], prefix_operators=[], qualifier=future, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=markProcessed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], parameters=[InferredFormalParameter(name=result), InferredFormalParameter(name=e)]), MemberReference(member=executor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleAsync, postfix_operators=[], prefix_operators=[], qualifier=resultFuture, selectors=[], type_arguments=None), label=None)], parameters=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=DeferredAction, sub_type=None))]
end[}]
END[}] | Keyword[private] operator[<] identifier[T] operator[>] identifier[DeferredAction] operator[<] identifier[M] operator[>] identifier[deferAction] operator[SEP] Keyword[final] identifier[M] identifier[metadata] , Keyword[final] identifier[Supplier] operator[<] operator[?] Keyword[extends] identifier[CompletionStage] operator[<] identifier[T] operator[>] operator[>] identifier[action] , Keyword[final] identifier[CompletableFuture] operator[<] identifier[T] operator[>] identifier[future] operator[SEP] {
Keyword[return] Keyword[new] identifier[DeferredAction] operator[<] operator[>] operator[SEP] identifier[metadata] , operator[SEP] operator[SEP] operator[->] {
Keyword[final] identifier[CompletionStage] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[resultFuture] operator[SEP] Keyword[try] {
identifier[resultFuture] operator[=] identifier[action] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] {
identifier[future] operator[SEP] identifier[completeExceptionally] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[markProcessed] operator[SEP] identifier[metadata] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[resultFuture] operator[SEP] identifier[handleAsync] operator[SEP] operator[SEP] identifier[result] , identifier[e] operator[SEP] operator[->] {
Keyword[if] operator[SEP] identifier[e] operator[!=] Other[null] operator[SEP] {
identifier[future] operator[SEP] identifier[completeExceptionally] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[future] operator[SEP] identifier[complete] operator[SEP] identifier[result] operator[SEP] operator[SEP]
}
identifier[markProcessed] operator[SEP] identifier[metadata] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
} , identifier[executor] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP]
}
|
public void serviceName_domains_domain_cacheRules_cacheRuleId_PUT(String serviceName, String domain, Long cacheRuleId, OvhCacheRule body) throws IOException {
String qPath = "/cdn/dedicated/{serviceName}/domains/{domain}/cacheRules/{cacheRuleId}";
StringBuilder sb = path(qPath, serviceName, domain, cacheRuleId);
exec(qPath, "PUT", sb.toString(), body);
} | class class_name[name] begin[{]
method[serviceName_domains_domain_cacheRules_cacheRuleId_PUT, return_type[void], modifier[public], parameter[serviceName, domain, cacheRuleId, body]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
call[.exec, parameter[member[.qPath], literal["PUT"], call[sb.toString, parameter[]], member[.body]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[serviceName_domains_domain_cacheRules_cacheRuleId_PUT] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[domain] , identifier[Long] identifier[cacheRuleId] , identifier[OvhCacheRule] identifier[body] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] , identifier[domain] , identifier[cacheRuleId] operator[SEP] operator[SEP] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[body] operator[SEP] operator[SEP]
}
|
public static List<Pair> splitPairs(String string, char pairsSeparator, char componentsSeparator)
{
if(string == null) {
return null;
}
string = string.trim();
final int length = string.length();
final List<Pair> list = new ArrayList<Pair>();
int beginIndex = 0;
int endIndex = 0;
while(endIndex < length) {
if(string.charAt(endIndex) == pairsSeparator) {
if(endIndex > beginIndex) {
list.add(pair(string.substring(beginIndex, endIndex), componentsSeparator));
}
beginIndex = ++endIndex;
}
++endIndex;
}
if(beginIndex < length) {
list.add(pair(string.substring(beginIndex), componentsSeparator));
}
return list;
} | class class_name[name] begin[{]
method[splitPairs, return_type[type[List]], modifier[public static], parameter[string, pairsSeparator, componentsSeparator]] begin[{]
if[binary_operation[member[.string], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
assign[member[.string], call[string.trim, parameter[]]]
local_variable[type[int], length]
local_variable[type[List], list]
local_variable[type[int], beginIndex]
local_variable[type[int], endIndex]
while[binary_operation[member[.endIndex], <, member[.length]]] begin[{]
if[binary_operation[call[string.charAt, parameter[member[.endIndex]]], ==, member[.pairsSeparator]]] begin[{]
if[binary_operation[member[.endIndex], >, member[.beginIndex]]] begin[{]
call[list.add, parameter[call[.pair, parameter[call[string.substring, parameter[member[.beginIndex], member[.endIndex]]], member[.componentsSeparator]]]]]
else begin[{]
None
end[}]
assign[member[.beginIndex], member[.endIndex]]
else begin[{]
None
end[}]
member[.endIndex]
end[}]
if[binary_operation[member[.beginIndex], <, member[.length]]] begin[{]
call[list.add, parameter[call[.pair, parameter[call[string.substring, parameter[member[.beginIndex]]], member[.componentsSeparator]]]]]
else begin[{]
None
end[}]
return[member[.list]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Pair] operator[>] identifier[splitPairs] operator[SEP] identifier[String] identifier[string] , Keyword[char] identifier[pairsSeparator] , Keyword[char] identifier[componentsSeparator] operator[SEP] {
Keyword[if] operator[SEP] identifier[string] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[string] operator[=] identifier[string] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[length] operator[=] identifier[string] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Pair] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Pair] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[beginIndex] operator[=] Other[0] operator[SEP] Keyword[int] identifier[endIndex] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[endIndex] operator[<] identifier[length] operator[SEP] {
Keyword[if] operator[SEP] identifier[string] operator[SEP] identifier[charAt] operator[SEP] identifier[endIndex] operator[SEP] operator[==] identifier[pairsSeparator] operator[SEP] {
Keyword[if] operator[SEP] identifier[endIndex] operator[>] identifier[beginIndex] operator[SEP] {
identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[pair] operator[SEP] identifier[string] operator[SEP] identifier[substring] operator[SEP] identifier[beginIndex] , identifier[endIndex] operator[SEP] , identifier[componentsSeparator] operator[SEP] operator[SEP] operator[SEP]
}
identifier[beginIndex] operator[=] operator[++] identifier[endIndex] operator[SEP]
} operator[++] identifier[endIndex] operator[SEP]
}
Keyword[if] operator[SEP] identifier[beginIndex] operator[<] identifier[length] operator[SEP] {
identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[pair] operator[SEP] identifier[string] operator[SEP] identifier[substring] operator[SEP] identifier[beginIndex] operator[SEP] , identifier[componentsSeparator] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[list] operator[SEP]
}
|
public FutureAPIResponse sendQueryAsFuture(Map<String, Object> query)
throws ExecutionException, InterruptedException, IOException {
RequestBuilder builder = new RequestBuilder("POST");
builder.setUrl(apiUrl + "/queries.json");
// handle DateTime separately
GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder.registerTypeAdapter(DateTime.class, new DateTimeAdapter());
Gson gson = gsonBuilder.create();
String requestJsonString = gson.toJson(query);
builder.setBody(requestJsonString);
builder.setHeader("Content-Type", "application/json");
builder.setHeader("Content-Length", "" + requestJsonString.length());
return new FutureAPIResponse(client.executeRequest(builder.build(), getHandler()));
} | class class_name[name] begin[{]
method[sendQueryAsFuture, return_type[type[FutureAPIResponse]], modifier[public], parameter[query]] begin[{]
local_variable[type[RequestBuilder], builder]
call[builder.setUrl, parameter[binary_operation[member[.apiUrl], +, literal["/queries.json"]]]]
local_variable[type[GsonBuilder], gsonBuilder]
call[gsonBuilder.registerTypeAdapter, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateTime, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateTimeAdapter, sub_type=None))]]
local_variable[type[Gson], gson]
local_variable[type[String], requestJsonString]
call[builder.setBody, parameter[member[.requestJsonString]]]
call[builder.setHeader, parameter[literal["Content-Type"], literal["application/json"]]]
call[builder.setHeader, parameter[literal["Content-Length"], binary_operation[literal[""], +, call[requestJsonString.length, parameter[]]]]]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=build, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=executeRequest, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FutureAPIResponse, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[FutureAPIResponse] identifier[sendQueryAsFuture] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[query] operator[SEP] Keyword[throws] identifier[ExecutionException] , identifier[InterruptedException] , identifier[IOException] {
identifier[RequestBuilder] identifier[builder] operator[=] Keyword[new] identifier[RequestBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[setUrl] operator[SEP] identifier[apiUrl] operator[+] literal[String] operator[SEP] operator[SEP] identifier[GsonBuilder] identifier[gsonBuilder] operator[=] Keyword[new] identifier[GsonBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[gsonBuilder] operator[SEP] identifier[registerTypeAdapter] operator[SEP] identifier[DateTime] operator[SEP] Keyword[class] , Keyword[new] identifier[DateTimeAdapter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Gson] identifier[gson] operator[=] identifier[gsonBuilder] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[requestJsonString] operator[=] identifier[gson] operator[SEP] identifier[toJson] operator[SEP] identifier[query] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[setBody] operator[SEP] identifier[requestJsonString] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[setHeader] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[setHeader] operator[SEP] literal[String] , literal[String] operator[+] identifier[requestJsonString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[FutureAPIResponse] operator[SEP] identifier[client] operator[SEP] identifier[executeRequest] operator[SEP] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] , identifier[getHandler] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Nonnull
@CheckReturnValue
public CSSSimpleValueWithUnit multiply (@Nonnull final BigDecimal aValue)
{
return new CSSSimpleValueWithUnit (m_aValue.multiply (aValue), m_eUnit);
} | class class_name[name] begin[{]
method[multiply, return_type[type[CSSSimpleValueWithUnit]], modifier[public], parameter[aValue]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=aValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=multiply, postfix_operators=[], prefix_operators=[], qualifier=m_aValue, selectors=[], type_arguments=None), MemberReference(member=m_eUnit, 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=CSSSimpleValueWithUnit, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Nonnull] annotation[@] identifier[CheckReturnValue] Keyword[public] identifier[CSSSimpleValueWithUnit] identifier[multiply] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[BigDecimal] identifier[aValue] operator[SEP] {
Keyword[return] Keyword[new] identifier[CSSSimpleValueWithUnit] operator[SEP] identifier[m_aValue] operator[SEP] identifier[multiply] operator[SEP] identifier[aValue] operator[SEP] , identifier[m_eUnit] operator[SEP] operator[SEP]
}
|
public void failIfDenied(ModelNode operation) throws OperationFailedException {
failIfDenied(operation, PathAddress.pathAddress(operation.get(OP_ADDR)));
} | class class_name[name] begin[{]
method[failIfDenied, return_type[void], modifier[public], parameter[operation]] begin[{]
call[.failIfDenied, parameter[member[.operation], call[PathAddress.pathAddress, parameter[call[operation.get, parameter[member[.OP_ADDR]]]]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[failIfDenied] operator[SEP] identifier[ModelNode] identifier[operation] operator[SEP] Keyword[throws] identifier[OperationFailedException] {
identifier[failIfDenied] operator[SEP] identifier[operation] , identifier[PathAddress] operator[SEP] identifier[pathAddress] operator[SEP] identifier[operation] operator[SEP] identifier[get] operator[SEP] identifier[OP_ADDR] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public List<ParsingError> doValidate() {
List<ParsingError> result = new ArrayList<> ();
if( Utils.isEmptyOrWhitespaces( this.newInstanceName ))
result.add( error( ErrorCode.CMD_MISSING_INSTANCE_NAME ));
else if( ! this.newInstanceName.matches( ParsingConstants.PATTERN_FLEX_ID ))
result.add( error( ErrorCode.CMD_INVALID_INSTANCE_NAME ));
if( ! this.context.instanceExists( this.replicatedInstancePath ))
result.add( error( ErrorCode.CMD_NO_MATCHING_INSTANCE, instance( this.replicatedInstancePath )));
else if( InstanceHelpers.countInstances( this.replicatedInstancePath ) > 1 )
result.add( error( ErrorCode.CMD_NOT_A_ROOT_INSTANCE, instance( this.replicatedInstancePath )));
return result;
} | class class_name[name] begin[{]
method[doValidate, return_type[type[List]], modifier[public], parameter[]] begin[{]
local_variable[type[List], result]
if[call[Utils.isEmptyOrWhitespaces, parameter[THIS[member[None.newInstanceName]]]]] begin[{]
call[result.add, parameter[call[.error, parameter[member[ErrorCode.CMD_MISSING_INSTANCE_NAME]]]]]
else begin[{]
if[THIS[member[None.newInstanceName]call[None.matches, parameter[member[ParsingConstants.PATTERN_FLEX_ID]]]]] begin[{]
call[result.add, parameter[call[.error, parameter[member[ErrorCode.CMD_INVALID_INSTANCE_NAME]]]]]
else begin[{]
None
end[}]
end[}]
if[THIS[member[None.context]call[None.instanceExists, parameter[THIS[member[None.replicatedInstancePath]]]]]] begin[{]
call[result.add, parameter[call[.error, parameter[member[ErrorCode.CMD_NO_MATCHING_INSTANCE], call[.instance, parameter[THIS[member[None.replicatedInstancePath]]]]]]]]
else begin[{]
if[binary_operation[call[InstanceHelpers.countInstances, parameter[THIS[member[None.replicatedInstancePath]]]], >, literal[1]]] begin[{]
call[result.add, parameter[call[.error, parameter[member[ErrorCode.CMD_NOT_A_ROOT_INSTANCE], call[.instance, parameter[THIS[member[None.replicatedInstancePath]]]]]]]]
else begin[{]
None
end[}]
end[}]
return[member[.result]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[ParsingError] operator[>] identifier[doValidate] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[ParsingError] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Utils] operator[SEP] identifier[isEmptyOrWhitespaces] operator[SEP] Keyword[this] operator[SEP] identifier[newInstanceName] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[error] operator[SEP] identifier[ErrorCode] operator[SEP] identifier[CMD_MISSING_INSTANCE_NAME] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[newInstanceName] operator[SEP] identifier[matches] operator[SEP] identifier[ParsingConstants] operator[SEP] identifier[PATTERN_FLEX_ID] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[error] operator[SEP] identifier[ErrorCode] operator[SEP] identifier[CMD_INVALID_INSTANCE_NAME] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[context] operator[SEP] identifier[instanceExists] operator[SEP] Keyword[this] operator[SEP] identifier[replicatedInstancePath] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[error] operator[SEP] identifier[ErrorCode] operator[SEP] identifier[CMD_NO_MATCHING_INSTANCE] , identifier[instance] operator[SEP] Keyword[this] operator[SEP] identifier[replicatedInstancePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[InstanceHelpers] operator[SEP] identifier[countInstances] operator[SEP] Keyword[this] operator[SEP] identifier[replicatedInstancePath] operator[SEP] operator[>] Other[1] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[error] operator[SEP] identifier[ErrorCode] operator[SEP] identifier[CMD_NOT_A_ROOT_INSTANCE] , identifier[instance] operator[SEP] Keyword[this] operator[SEP] identifier[replicatedInstancePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public CmsPropertiesBean getPropertyData() {
CmsPropertyEditorHelper helper = new PropertyEditorHelper(m_cms);
try {
CmsPropertiesBean data = helper.loadPropertyData(CmsUUID.getNullUUID());
return data;
} catch (Exception e) {
throw new RuntimeException(e);
}
} | class class_name[name] begin[{]
method[getPropertyData, return_type[type[CmsPropertiesBean]], modifier[public], parameter[]] begin[{]
local_variable[type[CmsPropertyEditorHelper], helper]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNullUUID, postfix_operators=[], prefix_operators=[], qualifier=CmsUUID, selectors=[], type_arguments=None)], member=loadPropertyData, postfix_operators=[], prefix_operators=[], qualifier=helper, selectors=[], type_arguments=None), name=data)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsPropertiesBean, sub_type=None)), ReturnStatement(expression=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[CmsPropertiesBean] identifier[getPropertyData] operator[SEP] operator[SEP] {
identifier[CmsPropertyEditorHelper] identifier[helper] operator[=] Keyword[new] identifier[PropertyEditorHelper] operator[SEP] identifier[m_cms] operator[SEP] operator[SEP] Keyword[try] {
identifier[CmsPropertiesBean] identifier[data] operator[=] identifier[helper] operator[SEP] identifier[loadPropertyData] operator[SEP] identifier[CmsUUID] operator[SEP] identifier[getNullUUID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[data] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
public boolean isSortedFromTo(int from, int to) {
if (size==0) return true;
checkRangeFromTo(from, to, size);
Object[] theElements = elements;
for (int i=from+1; i<=to; i++ ) {
if (((Comparable)theElements[i]).compareTo((Comparable) theElements[i-1]) < 0) return false;
}
return true;
} | class class_name[name] begin[{]
method[isSortedFromTo, return_type[type[boolean]], modifier[public], parameter[from, to]] begin[{]
if[binary_operation[member[.size], ==, literal[0]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
call[.checkRangeFromTo, parameter[member[.from], member[.to], member[.size]]]
local_variable[type[Object], theElements]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=Cast(expression=MemberReference(member=theElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=Comparable, sub_type=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=to, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=from, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), 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[isSortedFromTo] operator[SEP] Keyword[int] identifier[from] , Keyword[int] identifier[to] operator[SEP] {
Keyword[if] operator[SEP] identifier[size] operator[==] Other[0] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[checkRangeFromTo] operator[SEP] identifier[from] , identifier[to] , identifier[size] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[theElements] operator[=] identifier[elements] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[from] operator[+] Other[1] operator[SEP] identifier[i] operator[<=] identifier[to] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[Comparable] operator[SEP] identifier[theElements] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[compareTo] operator[SEP] operator[SEP] identifier[Comparable] operator[SEP] identifier[theElements] operator[SEP] identifier[i] operator[-] Other[1] operator[SEP] operator[SEP] operator[<] Other[0] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public void closeFiles() {
filesAreOpened = false;
for (HeaderIndexFile<Data> file : files) {
if (file != null) {
file.close();
}
}
} | class class_name[name] begin[{]
method[closeFiles, return_type[void], modifier[public], parameter[]] begin[{]
assign[member[.filesAreOpened], literal[false]]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=file, 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=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=file)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Data, sub_type=None))], dimensions=[], name=HeaderIndexFile, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[closeFiles] operator[SEP] operator[SEP] {
identifier[filesAreOpened] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[HeaderIndexFile] operator[<] identifier[Data] operator[>] identifier[file] operator[:] identifier[files] operator[SEP] {
Keyword[if] operator[SEP] identifier[file] operator[!=] Other[null] operator[SEP] {
identifier[file] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
@Deprecated
public Counter<L> logProbabilityOf(RVFDatum<L, F> example) {
// NB: this duplicate method is needed so it calls the scoresOf method
// with an RVFDatum signature!! Don't remove it!
// JLS: type resolution of method parameters is static
Counter<L> scores = scoresOf(example);
Counters.logNormalizeInPlace(scores);
return scores;
} | class class_name[name] begin[{]
method[logProbabilityOf, return_type[type[Counter]], modifier[public], parameter[example]] begin[{]
local_variable[type[Counter], scores]
call[Counters.logNormalizeInPlace, parameter[member[.scores]]]
return[member[.scores]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] identifier[Counter] operator[<] identifier[L] operator[>] identifier[logProbabilityOf] operator[SEP] identifier[RVFDatum] operator[<] identifier[L] , identifier[F] operator[>] identifier[example] operator[SEP] {
identifier[Counter] operator[<] identifier[L] operator[>] identifier[scores] operator[=] identifier[scoresOf] operator[SEP] identifier[example] operator[SEP] operator[SEP] identifier[Counters] operator[SEP] identifier[logNormalizeInPlace] operator[SEP] identifier[scores] operator[SEP] operator[SEP] Keyword[return] identifier[scores] operator[SEP]
}
|
public Geometry parseGeometry(JsonParser jsParser) throws IOException, SQLException {
jsParser.nextToken(); // START_OBJECT {
jsParser.nextToken(); // FIELD_NAME type
jsParser.nextToken(); // VALUE_STRING Point or whatever supported
String geomType = jsParser.getText();
if (geomType.equalsIgnoreCase(GeoJsonField.POINT)) {
return parsePoint(jsParser);
} else if (geomType.equalsIgnoreCase(GeoJsonField.MULTIPOINT)) {
return parseMultiPoint(jsParser);
} else if (geomType.equalsIgnoreCase(GeoJsonField.LINESTRING)) {
return parseLinestring(jsParser);
} else if (geomType.equalsIgnoreCase(GeoJsonField.MULTILINESTRING)) {
return parseMultiLinestring(jsParser);
} else if (geomType.equalsIgnoreCase(GeoJsonField.POLYGON)) {
return parsePolygon(jsParser);
} else if (geomType.equalsIgnoreCase(GeoJsonField.MULTIPOLYGON)) {
return parseMultiPolygon(jsParser);
} else if (geomType.equalsIgnoreCase(GeoJsonField.GEOMETRYCOLLECTION)) {
return parseGeometryCollection(jsParser);
} else {
throw new SQLException("Unsupported geometry : " + geomType);
}
} | class class_name[name] begin[{]
method[parseGeometry, return_type[type[Geometry]], modifier[public], parameter[jsParser]] begin[{]
call[jsParser.nextToken, parameter[]]
call[jsParser.nextToken, parameter[]]
call[jsParser.nextToken, parameter[]]
local_variable[type[String], geomType]
if[call[geomType.equalsIgnoreCase, parameter[member[GeoJsonField.POINT]]]] begin[{]
return[call[.parsePoint, parameter[member[.jsParser]]]]
else begin[{]
if[call[geomType.equalsIgnoreCase, parameter[member[GeoJsonField.MULTIPOINT]]]] begin[{]
return[call[.parseMultiPoint, parameter[member[.jsParser]]]]
else begin[{]
if[call[geomType.equalsIgnoreCase, parameter[member[GeoJsonField.LINESTRING]]]] begin[{]
return[call[.parseLinestring, parameter[member[.jsParser]]]]
else begin[{]
if[call[geomType.equalsIgnoreCase, parameter[member[GeoJsonField.MULTILINESTRING]]]] begin[{]
return[call[.parseMultiLinestring, parameter[member[.jsParser]]]]
else begin[{]
if[call[geomType.equalsIgnoreCase, parameter[member[GeoJsonField.POLYGON]]]] begin[{]
return[call[.parsePolygon, parameter[member[.jsParser]]]]
else begin[{]
if[call[geomType.equalsIgnoreCase, parameter[member[GeoJsonField.MULTIPOLYGON]]]] begin[{]
return[call[.parseMultiPolygon, parameter[member[.jsParser]]]]
else begin[{]
if[call[geomType.equalsIgnoreCase, parameter[member[GeoJsonField.GEOMETRYCOLLECTION]]]] begin[{]
return[call[.parseGeometryCollection, parameter[member[.jsParser]]]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported geometry : "), operandr=MemberReference(member=geomType, 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=SQLException, sub_type=None)), label=None)
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[public] identifier[Geometry] identifier[parseGeometry] operator[SEP] identifier[JsonParser] identifier[jsParser] operator[SEP] Keyword[throws] identifier[IOException] , identifier[SQLException] {
identifier[jsParser] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[jsParser] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[jsParser] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[geomType] operator[=] identifier[jsParser] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[geomType] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[GeoJsonField] operator[SEP] identifier[POINT] operator[SEP] operator[SEP] {
Keyword[return] identifier[parsePoint] operator[SEP] identifier[jsParser] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[geomType] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[GeoJsonField] operator[SEP] identifier[MULTIPOINT] operator[SEP] operator[SEP] {
Keyword[return] identifier[parseMultiPoint] operator[SEP] identifier[jsParser] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[geomType] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[GeoJsonField] operator[SEP] identifier[LINESTRING] operator[SEP] operator[SEP] {
Keyword[return] identifier[parseLinestring] operator[SEP] identifier[jsParser] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[geomType] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[GeoJsonField] operator[SEP] identifier[MULTILINESTRING] operator[SEP] operator[SEP] {
Keyword[return] identifier[parseMultiLinestring] operator[SEP] identifier[jsParser] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[geomType] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[GeoJsonField] operator[SEP] identifier[POLYGON] operator[SEP] operator[SEP] {
Keyword[return] identifier[parsePolygon] operator[SEP] identifier[jsParser] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[geomType] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[GeoJsonField] operator[SEP] identifier[MULTIPOLYGON] operator[SEP] operator[SEP] {
Keyword[return] identifier[parseMultiPolygon] operator[SEP] identifier[jsParser] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[geomType] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[GeoJsonField] operator[SEP] identifier[GEOMETRYCOLLECTION] operator[SEP] operator[SEP] {
Keyword[return] identifier[parseGeometryCollection] operator[SEP] identifier[jsParser] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[SQLException] operator[SEP] literal[String] operator[+] identifier[geomType] operator[SEP] operator[SEP]
}
}
|
private void copyResponseHeaders(HttpResponse proxyResponse, final HttpServletResponse servletResponse) {
servletResponse.setCharacterEncoding(getContentCharSet(proxyResponse.getEntity()));
from(Arrays.asList(proxyResponse.getAllHeaders())).filter(new Predicate<Header>() {
@Override
public boolean apply(Header header) {
return !hopByHopHeaders.containsHeader(header.getName());
}
}).transform(new Function<Header, Boolean>() {
@Override
public Boolean apply(Header header) {
servletResponse.addHeader(header.getName(), header.getValue());
return true;
}
}).toList();
} | class class_name[name] begin[{]
method[copyResponseHeaders, return_type[void], modifier[private], parameter[proxyResponse, servletResponse]] begin[{]
call[servletResponse.setCharacterEncoding, parameter[call[.getContentCharSet, parameter[call[proxyResponse.getEntity, parameter[]]]]]]
call[.from, parameter[call[Arrays.asList, parameter[call[proxyResponse.getAllHeaders, parameter[]]]]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[copyResponseHeaders] operator[SEP] identifier[HttpResponse] identifier[proxyResponse] , Keyword[final] identifier[HttpServletResponse] identifier[servletResponse] operator[SEP] {
identifier[servletResponse] operator[SEP] identifier[setCharacterEncoding] operator[SEP] identifier[getContentCharSet] operator[SEP] identifier[proxyResponse] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[from] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[proxyResponse] operator[SEP] identifier[getAllHeaders] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] Keyword[new] identifier[Predicate] operator[<] identifier[Header] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[apply] operator[SEP] identifier[Header] identifier[header] operator[SEP] {
Keyword[return] operator[!] identifier[hopByHopHeaders] operator[SEP] identifier[containsHeader] operator[SEP] identifier[header] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[transform] operator[SEP] Keyword[new] identifier[Function] operator[<] identifier[Header] , identifier[Boolean] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Boolean] identifier[apply] operator[SEP] identifier[Header] identifier[header] operator[SEP] {
identifier[servletResponse] operator[SEP] identifier[addHeader] operator[SEP] identifier[header] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[header] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void solvingStarted(DefaultSolverScope solverScope) {
for (Termination termination : terminationList) {
termination.solvingStarted(solverScope);
}
} | class class_name[name] begin[{]
method[solvingStarted, return_type[void], modifier[public], parameter[solverScope]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=solverScope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=solvingStarted, postfix_operators=[], prefix_operators=[], qualifier=termination, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=terminationList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=termination)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Termination, sub_type=None))), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[solvingStarted] operator[SEP] identifier[DefaultSolverScope] identifier[solverScope] operator[SEP] {
Keyword[for] operator[SEP] identifier[Termination] identifier[termination] operator[:] identifier[terminationList] operator[SEP] {
identifier[termination] operator[SEP] identifier[solvingStarted] operator[SEP] identifier[solverScope] operator[SEP] operator[SEP]
}
}
|
public static byte[] renderedImage2ByteArray( RenderedImage renderedImage, boolean doRowsThenCols ) {
int width = renderedImage.getWidth();
int height = renderedImage.getHeight();
byte[] values = new byte[width * height];
RandomIter imageIter = RandomIterFactory.create(renderedImage, null);
int index = 0;
if (doRowsThenCols) {
for( int y = 0; y < height; y++ ) {
for( int x = 0; x < width; x++ ) {
double sample = imageIter.getSampleDouble(x, y, 0);
values[index++] = (byte) sample;
}
}
} else {
for( int x = 0; x < width; x++ ) {
for( int y = 0; y < height; y++ ) {
double sample = imageIter.getSampleDouble(x, y, 0);
values[index++] = (byte) sample;
}
}
}
imageIter.done();
return values;
} | class class_name[name] begin[{]
method[renderedImage2ByteArray, return_type[type[byte]], modifier[public static], parameter[renderedImage, doRowsThenCols]] begin[{]
local_variable[type[int], width]
local_variable[type[int], height]
local_variable[type[byte], values]
local_variable[type[RandomIter], imageIter]
local_variable[type[int], index]
if[member[.doRowsThenCols]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getSampleDouble, postfix_operators=[], prefix_operators=[], qualifier=imageIter, selectors=[], type_arguments=None), name=sample)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=sample, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getSampleDouble, postfix_operators=[], prefix_operators=[], qualifier=imageIter, selectors=[], type_arguments=None), name=sample)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=sample, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
call[imageIter.done, parameter[]]
return[member[.values]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[renderedImage2ByteArray] operator[SEP] identifier[RenderedImage] identifier[renderedImage] , Keyword[boolean] identifier[doRowsThenCols] operator[SEP] {
Keyword[int] identifier[width] operator[=] identifier[renderedImage] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[height] operator[=] identifier[renderedImage] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[values] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[width] operator[*] identifier[height] operator[SEP] operator[SEP] identifier[RandomIter] identifier[imageIter] operator[=] identifier[RandomIterFactory] operator[SEP] identifier[create] operator[SEP] identifier[renderedImage] , Other[null] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[doRowsThenCols] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[height] operator[SEP] identifier[y] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[width] operator[SEP] identifier[x] operator[++] operator[SEP] {
Keyword[double] identifier[sample] operator[=] identifier[imageIter] operator[SEP] identifier[getSampleDouble] operator[SEP] identifier[x] , identifier[y] , Other[0] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[index] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[sample] operator[SEP]
}
}
}
Keyword[else] {
Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[width] operator[SEP] identifier[x] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[height] operator[SEP] identifier[y] operator[++] operator[SEP] {
Keyword[double] identifier[sample] operator[=] identifier[imageIter] operator[SEP] identifier[getSampleDouble] operator[SEP] identifier[x] , identifier[y] , Other[0] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[index] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[sample] operator[SEP]
}
}
}
identifier[imageIter] operator[SEP] identifier[done] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[values] operator[SEP]
}
|
public void marshall(Message message, ProtocolMarshaller protocolMarshaller) {
if (message == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(message.getMessageId(), MESSAGEID_BINDING);
protocolMarshaller.marshall(message.getPayload(), PAYLOAD_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[message, protocolMarshaller]] begin[{]
if[binary_operation[member[.message], ==, 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=getMessageId, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), MemberReference(member=MESSAGEID_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=getPayload, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), MemberReference(member=PAYLOAD_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[Message] identifier[message] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[message] 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[message] operator[SEP] identifier[getMessageId] operator[SEP] operator[SEP] , identifier[MESSAGEID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[message] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] , identifier[PAYLOAD_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
private void checkTemplate(TemplateNode node, TemplateRegistry templateRegistry) {
ListMultimap<String, SourceLocation> dataKeys = ArrayListMultimap.create();
for (VarRefNode varRefNode : SoyTreeUtils.getAllNodesOfType(node, VarRefNode.class)) {
if (varRefNode.isPossibleHeaderVar()) {
dataKeys.put(varRefNode.getName(), varRefNode.getSourceLocation());
}
}
IndirectParamsInfo ipi =
new IndirectParamsCalculator(templateRegistry)
.calculateIndirectParams(templateRegistry.getMetadata(node));
Set<String> allHeaderVarNames = new HashSet<>();
List<TemplateHeaderVarDefn> unusedParams = new ArrayList<>();
// Process @param header variables.
for (TemplateParam param : node.getAllParams()) {
allHeaderVarNames.add(param.name());
if (dataKeys.containsKey(param.name())) {
// Good: Declared and referenced in template. We remove these from dataKeys so
// that at the end of the for-loop, dataKeys will only contain the keys that are referenced
// but not declared in SoyDoc.
dataKeys.removeAll(param.name());
} else if (ipi.paramKeyToCalleesMultimap.containsKey(param.name())
|| ipi.mayHaveIndirectParamsInExternalCalls
|| ipi.mayHaveIndirectParamsInExternalDelCalls) {
// Good: Declared in SoyDoc and either (a) used in a call that passes all data or (b) used
// in an external call or delcall that passes all data, which may need the param (we can't
// verify).
} else {
// Bad: Declared in SoyDoc but not referenced in template.
unusedParams.add(param);
}
}
List<TemplateHeaderVarDefn> unusedStateVars = new ArrayList<>();
// Process @state header variables.
if (node instanceof TemplateElementNode) {
TemplateElementNode el = (TemplateElementNode) node;
for (TemplateStateVar stateVar : el.getStateVars()) {
allHeaderVarNames.add(stateVar.name());
if (dataKeys.containsKey(stateVar.name())) {
// Good: declared and referenced in the template.
dataKeys.removeAll(stateVar.name());
} else {
// Bad: declared in the header, but not used.
unusedStateVars.add(stateVar);
}
}
}
// At this point, the only keys left in dataKeys are undeclared.
for (Entry<String, SourceLocation> undeclared : dataKeys.entries()) {
String extraErrorMessage =
SoyErrors.getDidYouMeanMessage(allHeaderVarNames, undeclared.getKey());
errorReporter.report(
undeclared.getValue(), UNDECLARED_DATA_KEY, undeclared.getKey(), extraErrorMessage);
}
// Delegate templates can declare unused params because other implementations
// of the same delegate may need to use those params.
if (node instanceof TemplateBasicNode) {
reportUnusedHeaderVars(errorReporter, unusedParams, UNUSED_PARAM);
}
if (node instanceof TemplateElementNode) {
reportUnusedHeaderVars(errorReporter, unusedStateVars, UNUSED_STATE);
}
} | class class_name[name] begin[{]
method[checkTemplate, return_type[void], modifier[private], parameter[node, templateRegistry]] begin[{]
local_variable[type[ListMultimap], dataKeys]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isPossibleHeaderVar, postfix_operators=[], prefix_operators=[], qualifier=varRefNode, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=varRefNode, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSourceLocation, postfix_operators=[], prefix_operators=[], qualifier=varRefNode, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=dataKeys, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VarRefNode, sub_type=None))], member=getAllNodesOfType, postfix_operators=[], prefix_operators=[], qualifier=SoyTreeUtils, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=varRefNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VarRefNode, sub_type=None))), label=None)
local_variable[type[IndirectParamsInfo], ipi]
local_variable[type[Set], allHeaderVarNames]
local_variable[type[List], unusedParams]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=allHeaderVarNames, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=dataKeys, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=ipi.paramKeyToCalleesMultimap, selectors=[], type_arguments=None), operandr=MemberReference(member=mayHaveIndirectParamsInExternalCalls, postfix_operators=[], prefix_operators=[], qualifier=ipi, selectors=[]), operator=||), operandr=MemberReference(member=mayHaveIndirectParamsInExternalDelCalls, postfix_operators=[], prefix_operators=[], qualifier=ipi, selectors=[]), operator=||), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=param, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=unusedParams, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], member=removeAll, postfix_operators=[], prefix_operators=[], qualifier=dataKeys, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAllParams, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=param)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TemplateParam, sub_type=None))), label=None)
local_variable[type[List], unusedStateVars]
if[binary_operation[member[.node], instanceof, type[TemplateElementNode]]] begin[{]
local_variable[type[TemplateElementNode], el]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=stateVar, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=allHeaderVarNames, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=stateVar, selectors=[], type_arguments=None)], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=dataKeys, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stateVar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=unusedStateVars, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=stateVar, selectors=[], type_arguments=None)], member=removeAll, postfix_operators=[], prefix_operators=[], qualifier=dataKeys, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getStateVars, postfix_operators=[], prefix_operators=[], qualifier=el, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=stateVar)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TemplateStateVar, sub_type=None))), label=None)
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=allHeaderVarNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=undeclared, selectors=[], type_arguments=None)], member=getDidYouMeanMessage, postfix_operators=[], prefix_operators=[], qualifier=SoyErrors, selectors=[], type_arguments=None), name=extraErrorMessage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=undeclared, selectors=[], type_arguments=None), MemberReference(member=UNDECLARED_DATA_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=undeclared, selectors=[], type_arguments=None), MemberReference(member=extraErrorMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=report, postfix_operators=[], prefix_operators=[], qualifier=errorReporter, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entries, postfix_operators=[], prefix_operators=[], qualifier=dataKeys, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=undeclared)], 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=SourceLocation, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None)
if[binary_operation[member[.node], instanceof, type[TemplateBasicNode]]] begin[{]
call[.reportUnusedHeaderVars, parameter[member[.errorReporter], member[.unusedParams], member[.UNUSED_PARAM]]]
else begin[{]
None
end[}]
if[binary_operation[member[.node], instanceof, type[TemplateElementNode]]] begin[{]
call[.reportUnusedHeaderVars, parameter[member[.errorReporter], member[.unusedStateVars], member[.UNUSED_STATE]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[checkTemplate] operator[SEP] identifier[TemplateNode] identifier[node] , identifier[TemplateRegistry] identifier[templateRegistry] operator[SEP] {
identifier[ListMultimap] operator[<] identifier[String] , identifier[SourceLocation] operator[>] identifier[dataKeys] operator[=] identifier[ArrayListMultimap] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[VarRefNode] identifier[varRefNode] operator[:] identifier[SoyTreeUtils] operator[SEP] identifier[getAllNodesOfType] operator[SEP] identifier[node] , identifier[VarRefNode] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[varRefNode] operator[SEP] identifier[isPossibleHeaderVar] operator[SEP] operator[SEP] operator[SEP] {
identifier[dataKeys] operator[SEP] identifier[put] operator[SEP] identifier[varRefNode] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[varRefNode] operator[SEP] identifier[getSourceLocation] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[IndirectParamsInfo] identifier[ipi] operator[=] Keyword[new] identifier[IndirectParamsCalculator] operator[SEP] identifier[templateRegistry] operator[SEP] operator[SEP] identifier[calculateIndirectParams] operator[SEP] identifier[templateRegistry] operator[SEP] identifier[getMetadata] operator[SEP] identifier[node] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[allHeaderVarNames] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[TemplateHeaderVarDefn] operator[>] identifier[unusedParams] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[TemplateParam] identifier[param] operator[:] identifier[node] operator[SEP] identifier[getAllParams] operator[SEP] operator[SEP] operator[SEP] {
identifier[allHeaderVarNames] operator[SEP] identifier[add] operator[SEP] identifier[param] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dataKeys] operator[SEP] identifier[containsKey] operator[SEP] identifier[param] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[dataKeys] operator[SEP] identifier[removeAll] operator[SEP] identifier[param] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[ipi] operator[SEP] identifier[paramKeyToCalleesMultimap] operator[SEP] identifier[containsKey] operator[SEP] identifier[param] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[ipi] operator[SEP] identifier[mayHaveIndirectParamsInExternalCalls] operator[||] identifier[ipi] operator[SEP] identifier[mayHaveIndirectParamsInExternalDelCalls] operator[SEP] {
}
Keyword[else] {
identifier[unusedParams] operator[SEP] identifier[add] operator[SEP] identifier[param] operator[SEP] operator[SEP]
}
}
identifier[List] operator[<] identifier[TemplateHeaderVarDefn] operator[>] identifier[unusedStateVars] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[TemplateElementNode] operator[SEP] {
identifier[TemplateElementNode] identifier[el] operator[=] operator[SEP] identifier[TemplateElementNode] operator[SEP] identifier[node] operator[SEP] Keyword[for] operator[SEP] identifier[TemplateStateVar] identifier[stateVar] operator[:] identifier[el] operator[SEP] identifier[getStateVars] operator[SEP] operator[SEP] operator[SEP] {
identifier[allHeaderVarNames] operator[SEP] identifier[add] operator[SEP] identifier[stateVar] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dataKeys] operator[SEP] identifier[containsKey] operator[SEP] identifier[stateVar] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[dataKeys] operator[SEP] identifier[removeAll] operator[SEP] identifier[stateVar] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[unusedStateVars] operator[SEP] identifier[add] operator[SEP] identifier[stateVar] operator[SEP] operator[SEP]
}
}
}
Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[SourceLocation] operator[>] identifier[undeclared] operator[:] identifier[dataKeys] operator[SEP] identifier[entries] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[extraErrorMessage] operator[=] identifier[SoyErrors] operator[SEP] identifier[getDidYouMeanMessage] operator[SEP] identifier[allHeaderVarNames] , identifier[undeclared] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[errorReporter] operator[SEP] identifier[report] operator[SEP] identifier[undeclared] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[UNDECLARED_DATA_KEY] , identifier[undeclared] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[extraErrorMessage] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[TemplateBasicNode] operator[SEP] {
identifier[reportUnusedHeaderVars] operator[SEP] identifier[errorReporter] , identifier[unusedParams] , identifier[UNUSED_PARAM] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[TemplateElementNode] operator[SEP] {
identifier[reportUnusedHeaderVars] operator[SEP] identifier[errorReporter] , identifier[unusedStateVars] , identifier[UNUSED_STATE] operator[SEP] operator[SEP]
}
}
|
@Override
public void finish(IQueueMessage<ID, DATA> msg) {
if (!isEphemeralDisabled()) {
String key = msg.getId().toString();
rocksDbWrapper.delete(cfNameEphemeral, writeOptions, key);
}
} | class class_name[name] begin[{]
method[finish, return_type[void], modifier[public], parameter[msg]] begin[{]
if[call[.isEphemeralDisabled, parameter[]]] begin[{]
local_variable[type[String], key]
call[rocksDbWrapper.delete, parameter[member[.cfNameEphemeral], member[.writeOptions], member[.key]]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[finish] operator[SEP] identifier[IQueueMessage] operator[<] identifier[ID] , identifier[DATA] operator[>] identifier[msg] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isEphemeralDisabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[key] operator[=] identifier[msg] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[rocksDbWrapper] operator[SEP] identifier[delete] operator[SEP] identifier[cfNameEphemeral] , identifier[writeOptions] , identifier[key] operator[SEP] operator[SEP]
}
}
|
public static cuDoubleComplex cublasZdotu(int n, Pointer x, int incx, Pointer y, int incy)
{
cuDoubleComplex result = cublasZdotuNative(n, x, incx, y, incy);
checkResultBLAS();
return result;
} | class class_name[name] begin[{]
method[cublasZdotu, return_type[type[cuDoubleComplex]], modifier[public static], parameter[n, x, incx, y, incy]] begin[{]
local_variable[type[cuDoubleComplex], result]
call[.checkResultBLAS, parameter[]]
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[cuDoubleComplex] identifier[cublasZdotu] operator[SEP] Keyword[int] identifier[n] , identifier[Pointer] identifier[x] , Keyword[int] identifier[incx] , identifier[Pointer] identifier[y] , Keyword[int] identifier[incy] operator[SEP] {
identifier[cuDoubleComplex] identifier[result] operator[=] identifier[cublasZdotuNative] operator[SEP] identifier[n] , identifier[x] , identifier[incx] , identifier[y] , identifier[incy] operator[SEP] operator[SEP] identifier[checkResultBLAS] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public static String getResourceFromURL(String url)
{
String retval = url;
if (url != null && url.length() > 0)
{
int colonIndex;
colonIndex = url.indexOf("://");
if (colonIndex > 0)
retval = url.substring(colonIndex+3);
else {
colonIndex = url.indexOf(":");
if (colonIndex > 1) // handle windows drive letters.
{
// remove the URL prefix
retval = url.substring(colonIndex + 1);
}
}
}
return retval;
} | class class_name[name] begin[{]
method[getResourceFromURL, return_type[type[String]], modifier[public static], parameter[url]] begin[{]
local_variable[type[String], retval]
if[binary_operation[binary_operation[member[.url], !=, literal[null]], &&, binary_operation[call[url.length, parameter[]], >, literal[0]]]] begin[{]
local_variable[type[int], colonIndex]
assign[member[.colonIndex], call[url.indexOf, parameter[literal["://"]]]]
if[binary_operation[member[.colonIndex], >, literal[0]]] begin[{]
assign[member[.retval], call[url.substring, parameter[binary_operation[member[.colonIndex], +, literal[3]]]]]
else begin[{]
assign[member[.colonIndex], call[url.indexOf, parameter[literal[":"]]]]
if[binary_operation[member[.colonIndex], >, literal[1]]] begin[{]
assign[member[.retval], call[url.substring, parameter[binary_operation[member[.colonIndex], +, literal[1]]]]]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
return[member[.retval]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getResourceFromURL] operator[SEP] identifier[String] identifier[url] operator[SEP] {
identifier[String] identifier[retval] operator[=] identifier[url] operator[SEP] Keyword[if] operator[SEP] identifier[url] operator[!=] Other[null] operator[&&] identifier[url] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[int] identifier[colonIndex] operator[SEP] identifier[colonIndex] operator[=] identifier[url] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[colonIndex] operator[>] Other[0] operator[SEP] identifier[retval] operator[=] identifier[url] operator[SEP] identifier[substring] operator[SEP] identifier[colonIndex] operator[+] Other[3] operator[SEP] operator[SEP] Keyword[else] {
identifier[colonIndex] operator[=] identifier[url] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[colonIndex] operator[>] Other[1] operator[SEP] {
identifier[retval] operator[=] identifier[url] operator[SEP] identifier[substring] operator[SEP] identifier[colonIndex] operator[+] Other[1] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[retval] operator[SEP]
}
|
protected void repaintOverlayable(JComponent c) {
final Container parent = c.getParent();
if ((!(c instanceof Overlayable)) && (parent != null) && (parent instanceof DefaultOverlayable)) {
OverlayableUtils.repaintOverlayable(c);
}
} | class class_name[name] begin[{]
method[repaintOverlayable, return_type[void], modifier[protected], parameter[c]] begin[{]
local_variable[type[Container], parent]
if[binary_operation[binary_operation[binary_operation[member[.c], instanceof, type[Overlayable]], &&, binary_operation[member[.parent], !=, literal[null]]], &&, binary_operation[member[.parent], instanceof, type[DefaultOverlayable]]]] begin[{]
call[OverlayableUtils.repaintOverlayable, parameter[member[.c]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[repaintOverlayable] operator[SEP] identifier[JComponent] identifier[c] operator[SEP] {
Keyword[final] identifier[Container] identifier[parent] operator[=] identifier[c] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[!] operator[SEP] identifier[c] Keyword[instanceof] identifier[Overlayable] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[parent] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[parent] Keyword[instanceof] identifier[DefaultOverlayable] operator[SEP] operator[SEP] {
identifier[OverlayableUtils] operator[SEP] identifier[repaintOverlayable] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
}
|
protected void createDeviceFingerPrintCookie(final RequestContext context, final HttpServletRequest request, final String cookieValue) {
val response = WebUtils.getHttpServletResponseFromExternalWebflowContext(context);
cookieGenerator.addCookie(request, response, cookieValue);
} | class class_name[name] begin[{]
method[createDeviceFingerPrintCookie, return_type[void], modifier[protected], parameter[context, request, cookieValue]] begin[{]
local_variable[type[val], response]
call[cookieGenerator.addCookie, parameter[member[.request], member[.response], member[.cookieValue]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[createDeviceFingerPrintCookie] operator[SEP] Keyword[final] identifier[RequestContext] identifier[context] , Keyword[final] identifier[HttpServletRequest] identifier[request] , Keyword[final] identifier[String] identifier[cookieValue] operator[SEP] {
identifier[val] identifier[response] operator[=] identifier[WebUtils] operator[SEP] identifier[getHttpServletResponseFromExternalWebflowContext] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[cookieGenerator] operator[SEP] identifier[addCookie] operator[SEP] identifier[request] , identifier[response] , identifier[cookieValue] operator[SEP] operator[SEP]
}
|
private static boolean passwordsMatch(String userPassword,
String ldapPassword) {
Matcher m = LDAP_PASSWORD_PATTERN.matcher(ldapPassword);
boolean match = false;
if (m.find() && m.groupCount() == 2) {
// if password is encoded in the LDAP, encode the password before
// compare
String encoding = m.group(1);
String password = m.group(2);
if (logger.isDebugEnabled()) {
logger.debug("Encoding: {}, Password: {}", encoding, password);
}
MessageDigest digest = null;
try {
digest = MessageDigest.getInstance(encoding.toUpperCase());
} catch (NoSuchAlgorithmException e) {
logger.error("Unsupported Algorithm used: {}", encoding);
logger.error(e.getMessage());
return false;
}
byte[] resultBytes = digest.digest(userPassword.getBytes());
byte[] result = Base64.encodeBytesToBytes(resultBytes);
String pwd = new String(password);
String ldp = new String(result);
match = pwd.equals(ldp);
} else {
// if passwords are not encoded, just do raw compare
match = userPassword.equals(ldapPassword);
}
return match;
} | class class_name[name] begin[{]
method[passwordsMatch, return_type[type[boolean]], modifier[private static], parameter[userPassword, ldapPassword]] begin[{]
local_variable[type[Matcher], m]
local_variable[type[boolean], match]
if[binary_operation[call[m.find, parameter[]], &&, binary_operation[call[m.groupCount, parameter[]], ==, literal[2]]]] begin[{]
local_variable[type[String], encoding]
local_variable[type[String], password]
if[call[logger.isDebugEnabled, parameter[]]] begin[{]
call[logger.debug, parameter[literal["Encoding: {}, Password: {}"], member[.encoding], member[.password]]]
else begin[{]
None
end[}]
local_variable[type[MessageDigest], digest]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=digest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=encoding, selectors=[], type_arguments=None)], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=MessageDigest, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported Algorithm used: {}"), MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, 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=['NoSuchAlgorithmException']))], finally_block=None, label=None, resources=None)
local_variable[type[byte], resultBytes]
local_variable[type[byte], result]
local_variable[type[String], pwd]
local_variable[type[String], ldp]
assign[member[.match], call[pwd.equals, parameter[member[.ldp]]]]
else begin[{]
assign[member[.match], call[userPassword.equals, parameter[member[.ldapPassword]]]]
end[}]
return[member[.match]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[boolean] identifier[passwordsMatch] operator[SEP] identifier[String] identifier[userPassword] , identifier[String] identifier[ldapPassword] operator[SEP] {
identifier[Matcher] identifier[m] operator[=] identifier[LDAP_PASSWORD_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[ldapPassword] operator[SEP] operator[SEP] Keyword[boolean] identifier[match] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[&&] identifier[m] operator[SEP] identifier[groupCount] operator[SEP] operator[SEP] operator[==] Other[2] operator[SEP] {
identifier[String] identifier[encoding] operator[=] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[String] identifier[password] operator[=] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[2] 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] , identifier[encoding] , identifier[password] operator[SEP] operator[SEP]
}
identifier[MessageDigest] identifier[digest] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[digest] operator[=] identifier[MessageDigest] operator[SEP] identifier[getInstance] operator[SEP] identifier[encoding] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[encoding] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[byte] operator[SEP] operator[SEP] identifier[resultBytes] operator[=] identifier[digest] operator[SEP] identifier[digest] operator[SEP] identifier[userPassword] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[Base64] operator[SEP] identifier[encodeBytesToBytes] operator[SEP] identifier[resultBytes] operator[SEP] operator[SEP] identifier[String] identifier[pwd] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[password] operator[SEP] operator[SEP] identifier[String] identifier[ldp] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[result] operator[SEP] operator[SEP] identifier[match] operator[=] identifier[pwd] operator[SEP] identifier[equals] operator[SEP] identifier[ldp] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[match] operator[=] identifier[userPassword] operator[SEP] identifier[equals] operator[SEP] identifier[ldapPassword] operator[SEP] operator[SEP]
}
Keyword[return] identifier[match] operator[SEP]
}
|
protected StringBuilder renderOptions (@Nonnull final StringBuilder ret,
final int nWidth,
@Nonnull final Options aOptions,
final int nLeftPad,
final int nDescPad)
{
final String sLeftPad = createPadding (nLeftPad);
final String sDescPad = createPadding (nDescPad);
// first create list containing only <lpad>-a,--aaa where
// -a is opt and --aaa is long opt; in parallel look for
// the longest opt string this list will be then used to
// sort options ascending
int nMaxLen = 0;
final ICommonsList <StringBuilder> aPrefixList = new CommonsArrayList <> ();
final ICommonsList <Option> aOptList = aOptions.getAllOptions ();
if (m_aOptionComparator != null)
aOptList.sort (m_aOptionComparator);
for (final Option aOption : aOptList)
{
final StringBuilder aSB = new StringBuilder ();
if (aOption.hasShortOpt ())
{
aSB.append (sLeftPad).append (getOptPrefix ()).append (aOption.getShortOpt ());
if (aOption.hasLongOpt ())
aSB.append (',').append (getLongOptPrefix ()).append (aOption.getLongOpt ());
}
else
{
aSB.append (sLeftPad).append (" ").append (getLongOptPrefix ()).append (aOption.getLongOpt ());
}
if (aOption.canHaveArgs ())
{
final String argName = aOption.getArgName ();
if (argName != null && argName.length () == 0)
{
// if the option has a blank argname
aSB.append (' ');
}
else
{
aSB.append (aOption.hasLongOpt () ? getLongOptSeparator () : " ");
aSB.append ('<').append (argName != null ? aOption.getArgName () : getArgName ()).append ('>');
}
}
aPrefixList.add (aSB);
nMaxLen = Math.max (aSB.length (), nMaxLen);
}
int x = 0;
for (final Iterator <Option> it = aOptList.iterator (); it.hasNext ();)
{
final Option aOption = it.next ();
final StringBuilder aSB = new StringBuilder (aPrefixList.get (x++).toString ());
if (aSB.length () < nMaxLen)
aSB.append (createPadding (nMaxLen - aSB.length ()));
aSB.append (sDescPad);
final int nNextLineTabStop = nMaxLen + nDescPad;
if (aOption.hasDescription ())
aSB.append (aOption.getDescription ());
renderWrappedText (ret, nWidth, nNextLineTabStop, aSB.toString ());
if (it.hasNext ())
ret.append (getNewLine ());
}
return ret;
} | class class_name[name] begin[{]
method[renderOptions, return_type[type[StringBuilder]], modifier[protected], parameter[ret, nWidth, aOptions, nLeftPad, nDescPad]] begin[{]
local_variable[type[String], sLeftPad]
local_variable[type[String], sDescPad]
local_variable[type[int], nMaxLen]
local_variable[type[ICommonsList], aPrefixList]
local_variable[type[ICommonsList], aOptList]
if[binary_operation[member[.m_aOptionComparator], !=, literal[null]]] begin[{]
call[aOptList.sort, parameter[member[.m_aOptionComparator]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=aSB)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=hasShortOpt, postfix_operators=[], prefix_operators=[], qualifier=aOption, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sLeftPad, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=aSB, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLongOptPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLongOpt, postfix_operators=[], prefix_operators=[], qualifier=aOption, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sLeftPad, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=aSB, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOptPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getShortOpt, postfix_operators=[], prefix_operators=[], qualifier=aOption, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=hasLongOpt, postfix_operators=[], prefix_operators=[], qualifier=aOption, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=',')], member=append, postfix_operators=[], prefix_operators=[], qualifier=aSB, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLongOptPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLongOpt, postfix_operators=[], prefix_operators=[], qualifier=aOption, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None))])), IfStatement(condition=MethodInvocation(arguments=[], member=canHaveArgs, postfix_operators=[], prefix_operators=[], qualifier=aOption, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getArgName, postfix_operators=[], prefix_operators=[], qualifier=aOption, selectors=[], type_arguments=None), name=argName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=argName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=argName, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=MethodInvocation(arguments=[], member=hasLongOpt, postfix_operators=[], prefix_operators=[], qualifier=aOption, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), if_true=MethodInvocation(arguments=[], member=getLongOptSeparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))], member=append, postfix_operators=[], prefix_operators=[], qualifier=aSB, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='<')], member=append, postfix_operators=[], prefix_operators=[], qualifier=aSB, selectors=[MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=argName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MethodInvocation(arguments=[], member=getArgName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=getArgName, postfix_operators=[], prefix_operators=[], qualifier=aOption, selectors=[], type_arguments=None))], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='>')], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=append, postfix_operators=[], prefix_operators=[], qualifier=aSB, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=aSB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=aPrefixList, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nMaxLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=aSB, selectors=[], type_arguments=None), MemberReference(member=nMaxLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=aOptList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=aOption)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Option, sub_type=None))), label=None)
local_variable[type[int], x]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), name=aOption)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Option, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=aPrefixList, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=aSB)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=aSB, selectors=[], type_arguments=None), operandr=MemberReference(member=nMaxLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=nMaxLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=aSB, selectors=[], type_arguments=None), operator=-)], member=createPadding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=aSB, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sDescPad, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=aSB, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=nMaxLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nDescPad, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=nNextLineTabStop)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[], member=hasDescription, postfix_operators=[], prefix_operators=[], qualifier=aOption, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDescription, postfix_operators=[], prefix_operators=[], qualifier=aOption, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=aSB, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nNextLineTabStop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=aSB, selectors=[], type_arguments=None)], member=renderWrappedText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNewLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=aOptList, selectors=[], type_arguments=None), name=it)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Option, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)
return[member[.ret]]
end[}]
END[}] | Keyword[protected] identifier[StringBuilder] identifier[renderOptions] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[StringBuilder] identifier[ret] , Keyword[final] Keyword[int] identifier[nWidth] , annotation[@] identifier[Nonnull] Keyword[final] identifier[Options] identifier[aOptions] , Keyword[final] Keyword[int] identifier[nLeftPad] , Keyword[final] Keyword[int] identifier[nDescPad] operator[SEP] {
Keyword[final] identifier[String] identifier[sLeftPad] operator[=] identifier[createPadding] operator[SEP] identifier[nLeftPad] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[sDescPad] operator[=] identifier[createPadding] operator[SEP] identifier[nDescPad] operator[SEP] operator[SEP] Keyword[int] identifier[nMaxLen] operator[=] Other[0] operator[SEP] Keyword[final] identifier[ICommonsList] operator[<] identifier[StringBuilder] operator[>] identifier[aPrefixList] operator[=] Keyword[new] identifier[CommonsArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ICommonsList] operator[<] identifier[Option] operator[>] identifier[aOptList] operator[=] identifier[aOptions] operator[SEP] identifier[getAllOptions] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_aOptionComparator] operator[!=] Other[null] operator[SEP] identifier[aOptList] operator[SEP] identifier[sort] operator[SEP] identifier[m_aOptionComparator] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Option] identifier[aOption] operator[:] identifier[aOptList] operator[SEP] {
Keyword[final] identifier[StringBuilder] identifier[aSB] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aOption] operator[SEP] identifier[hasShortOpt] operator[SEP] operator[SEP] operator[SEP] {
identifier[aSB] operator[SEP] identifier[append] operator[SEP] identifier[sLeftPad] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[getOptPrefix] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[aOption] operator[SEP] identifier[getShortOpt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aOption] operator[SEP] identifier[hasLongOpt] operator[SEP] operator[SEP] operator[SEP] identifier[aSB] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[getLongOptPrefix] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[aOption] operator[SEP] identifier[getLongOpt] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[aSB] operator[SEP] identifier[append] operator[SEP] identifier[sLeftPad] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[getLongOptPrefix] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[aOption] operator[SEP] identifier[getLongOpt] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[aOption] operator[SEP] identifier[canHaveArgs] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] identifier[argName] operator[=] identifier[aOption] operator[SEP] identifier[getArgName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[argName] operator[!=] Other[null] operator[&&] identifier[argName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[aSB] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[aSB] operator[SEP] identifier[append] operator[SEP] identifier[aOption] operator[SEP] identifier[hasLongOpt] operator[SEP] operator[SEP] operator[?] identifier[getLongOptSeparator] operator[SEP] operator[SEP] operator[:] literal[String] operator[SEP] operator[SEP] identifier[aSB] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[argName] operator[!=] Other[null] operator[?] identifier[aOption] operator[SEP] identifier[getArgName] operator[SEP] operator[SEP] operator[:] identifier[getArgName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
identifier[aPrefixList] operator[SEP] identifier[add] operator[SEP] identifier[aSB] operator[SEP] operator[SEP] identifier[nMaxLen] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[aSB] operator[SEP] identifier[length] operator[SEP] operator[SEP] , identifier[nMaxLen] operator[SEP] operator[SEP]
}
Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Iterator] operator[<] identifier[Option] operator[>] identifier[it] operator[=] identifier[aOptList] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[Option] identifier[aOption] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[StringBuilder] identifier[aSB] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[aPrefixList] operator[SEP] identifier[get] operator[SEP] identifier[x] operator[++] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aSB] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] identifier[nMaxLen] operator[SEP] identifier[aSB] operator[SEP] identifier[append] operator[SEP] identifier[createPadding] operator[SEP] identifier[nMaxLen] operator[-] identifier[aSB] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[aSB] operator[SEP] identifier[append] operator[SEP] identifier[sDescPad] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[nNextLineTabStop] operator[=] identifier[nMaxLen] operator[+] identifier[nDescPad] operator[SEP] Keyword[if] operator[SEP] identifier[aOption] operator[SEP] identifier[hasDescription] operator[SEP] operator[SEP] operator[SEP] identifier[aSB] operator[SEP] identifier[append] operator[SEP] identifier[aOption] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[renderWrappedText] operator[SEP] identifier[ret] , identifier[nWidth] , identifier[nNextLineTabStop] , identifier[aSB] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[append] operator[SEP] identifier[getNewLine] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ret] operator[SEP]
}
|
public void logReduceTaskKilled(TaskAttemptID taskAttemptId, long timestamp,
String hostName, String error,
String taskType) {
if (disableHistory) {
return;
}
JobID id = taskAttemptId.getJobID();
if (!this.jobId.equals(id)) {
throw new RuntimeException("JobId from task: " + id +
" does not match expected: " + jobId);
}
if (null != writers) {
log(writers, RecordTypes.ReduceAttempt,
new Keys[]{ Keys.TASK_TYPE, Keys.TASKID,
Keys.TASK_ATTEMPT_ID, Keys.TASK_STATUS,
Keys.FINISH_TIME, Keys.HOSTNAME,
Keys.ERROR },
new String[]{ taskType,
taskAttemptId.getTaskID().toString(),
taskAttemptId.toString(),
Values.KILLED.name(),
String.valueOf(timestamp),
hostName, error });
}
} | class class_name[name] begin[{]
method[logReduceTaskKilled, return_type[void], modifier[public], parameter[taskAttemptId, timestamp, hostName, error, taskType]] begin[{]
if[member[.disableHistory]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[JobID], id]
if[THIS[member[None.jobId]call[None.equals, parameter[member[.id]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="JobId from task: "), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" does not match expected: "), operator=+), operandr=MemberReference(member=jobId, 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=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[literal[null], !=, member[.writers]]] begin[{]
call[.log, parameter[member[.writers], member[RecordTypes.ReduceAttempt], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=TASK_TYPE, postfix_operators=[], prefix_operators=[], qualifier=Keys, selectors=[]), MemberReference(member=TASKID, postfix_operators=[], prefix_operators=[], qualifier=Keys, selectors=[]), MemberReference(member=TASK_ATTEMPT_ID, postfix_operators=[], prefix_operators=[], qualifier=Keys, selectors=[]), MemberReference(member=TASK_STATUS, postfix_operators=[], prefix_operators=[], qualifier=Keys, selectors=[]), MemberReference(member=FINISH_TIME, postfix_operators=[], prefix_operators=[], qualifier=Keys, selectors=[]), MemberReference(member=HOSTNAME, postfix_operators=[], prefix_operators=[], qualifier=Keys, selectors=[]), MemberReference(member=ERROR, postfix_operators=[], prefix_operators=[], qualifier=Keys, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Keys, sub_type=None)), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=taskType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getTaskID, postfix_operators=[], prefix_operators=[], qualifier=taskAttemptId, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=taskAttemptId, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=Values.KILLED, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=timestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=hostName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[logReduceTaskKilled] operator[SEP] identifier[TaskAttemptID] identifier[taskAttemptId] , Keyword[long] identifier[timestamp] , identifier[String] identifier[hostName] , identifier[String] identifier[error] , identifier[String] identifier[taskType] operator[SEP] {
Keyword[if] operator[SEP] identifier[disableHistory] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[JobID] identifier[id] operator[=] identifier[taskAttemptId] operator[SEP] identifier[getJobID] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[jobId] operator[SEP] identifier[equals] operator[SEP] identifier[id] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[+] identifier[jobId] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Other[null] operator[!=] identifier[writers] operator[SEP] {
identifier[log] operator[SEP] identifier[writers] , identifier[RecordTypes] operator[SEP] identifier[ReduceAttempt] , Keyword[new] identifier[Keys] operator[SEP] operator[SEP] {
identifier[Keys] operator[SEP] identifier[TASK_TYPE] , identifier[Keys] operator[SEP] identifier[TASKID] , identifier[Keys] operator[SEP] identifier[TASK_ATTEMPT_ID] , identifier[Keys] operator[SEP] identifier[TASK_STATUS] , identifier[Keys] operator[SEP] identifier[FINISH_TIME] , identifier[Keys] operator[SEP] identifier[HOSTNAME] , identifier[Keys] operator[SEP] identifier[ERROR]
} , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[taskType] , identifier[taskAttemptId] operator[SEP] identifier[getTaskID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[taskAttemptId] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[Values] operator[SEP] identifier[KILLED] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[timestamp] operator[SEP] , identifier[hostName] , identifier[error]
} operator[SEP] operator[SEP]
}
}
|
@Override
protected Set<TypeInference.DataType> getSupportedXDataTypes() {
return new HashSet<>(Arrays.asList(TypeInference.DataType.BOOLEAN, TypeInference.DataType.NUMERICAL));
} | class class_name[name] begin[{]
method[getSupportedXDataTypes, return_type[type[Set]], modifier[protected], parameter[]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=BOOLEAN, postfix_operators=[], prefix_operators=[], qualifier=TypeInference.DataType, selectors=[]), MemberReference(member=NUMERICAL, postfix_operators=[], prefix_operators=[], qualifier=TypeInference.DataType, selectors=[])], member=asList, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] identifier[Set] operator[<] identifier[TypeInference] operator[SEP] identifier[DataType] operator[>] identifier[getSupportedXDataTypes] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[TypeInference] operator[SEP] identifier[DataType] operator[SEP] identifier[BOOLEAN] , identifier[TypeInference] operator[SEP] identifier[DataType] operator[SEP] identifier[NUMERICAL] operator[SEP] operator[SEP] operator[SEP]
}
|
public Icons getTableIcons(String featureTable) {
Icons icons = null;
Long id = contentsId.getId(featureTable);
if (id != null) {
icons = getTableIcons(featureTable, id);
}
return icons;
} | class class_name[name] begin[{]
method[getTableIcons, return_type[type[Icons]], modifier[public], parameter[featureTable]] begin[{]
local_variable[type[Icons], icons]
local_variable[type[Long], id]
if[binary_operation[member[.id], !=, literal[null]]] begin[{]
assign[member[.icons], call[.getTableIcons, parameter[member[.featureTable], member[.id]]]]
else begin[{]
None
end[}]
return[member[.icons]]
end[}]
END[}] | Keyword[public] identifier[Icons] identifier[getTableIcons] operator[SEP] identifier[String] identifier[featureTable] operator[SEP] {
identifier[Icons] identifier[icons] operator[=] Other[null] operator[SEP] identifier[Long] identifier[id] operator[=] identifier[contentsId] operator[SEP] identifier[getId] operator[SEP] identifier[featureTable] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[id] operator[!=] Other[null] operator[SEP] {
identifier[icons] operator[=] identifier[getTableIcons] operator[SEP] identifier[featureTable] , identifier[id] operator[SEP] operator[SEP]
}
Keyword[return] identifier[icons] operator[SEP]
}
|
public T random() {
long randomNum =
ThreadLocalRandom.current().nextLong(
toProlepticNumber(this.t1),
toProlepticNumber(this.t2) + 1);
return fromProlepticNumber(randomNum);
} | class class_name[name] begin[{]
method[random, return_type[type[T]], modifier[public], parameter[]] begin[{]
local_variable[type[long], randomNum]
return[call[.fromProlepticNumber, parameter[member[.randomNum]]]]
end[}]
END[}] | Keyword[public] identifier[T] identifier[random] operator[SEP] operator[SEP] {
Keyword[long] identifier[randomNum] operator[=] identifier[ThreadLocalRandom] operator[SEP] identifier[current] operator[SEP] operator[SEP] operator[SEP] identifier[nextLong] operator[SEP] identifier[toProlepticNumber] operator[SEP] Keyword[this] operator[SEP] identifier[t1] operator[SEP] , identifier[toProlepticNumber] operator[SEP] Keyword[this] operator[SEP] identifier[t2] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[fromProlepticNumber] operator[SEP] identifier[randomNum] operator[SEP] operator[SEP]
}
|
@Override
public void init() throws InitializationException {
List<String> options = getOptionsByCommand(getCommand());
options.contains(ASYNC_OPTION);
async = true;
} | class class_name[name] begin[{]
method[init, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[List], options]
call[options.contains, parameter[member[.ASYNC_OPTION]]]
assign[member[.async], literal[true]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[init] operator[SEP] operator[SEP] Keyword[throws] identifier[InitializationException] {
identifier[List] operator[<] identifier[String] operator[>] identifier[options] operator[=] identifier[getOptionsByCommand] operator[SEP] identifier[getCommand] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[options] operator[SEP] identifier[contains] operator[SEP] identifier[ASYNC_OPTION] operator[SEP] operator[SEP] identifier[async] operator[=] literal[boolean] operator[SEP]
}
|
public static List<CDKRMap> checkSingleAtomCases(IAtomContainer sourceGraph, IAtomContainer targetGraph)
throws CDKException {
if (sourceGraph instanceof IQueryAtomContainer) {
throw new CDKException("The first IAtomContainer must not be an IQueryAtomContainer");
}
if (targetGraph.getAtomCount() == 1) {
List<CDKRMap> arrayList = new ArrayList<CDKRMap>();
IAtom atom = targetGraph.getAtom(0);
if (atom instanceof IQueryAtom) {
IQueryAtom qAtom = (IQueryAtom) atom;
for (int i = 0; i < sourceGraph.getAtomCount(); i++) {
if (qAtom.matches(sourceGraph.getAtom(i))) {
arrayList.add(new CDKRMap(i, 0));
}
}
} else {
String atomSymbol = atom.getSymbol();
for (int i = 0; i < sourceGraph.getAtomCount(); i++) {
if (sourceGraph.getAtom(i).getSymbol().equals(atomSymbol)) {
arrayList.add(new CDKRMap(i, 0));
}
}
}
return arrayList;
} else if (sourceGraph.getAtomCount() == 1) {
List<CDKRMap> arrayList = new ArrayList<CDKRMap>();
IAtom atom = sourceGraph.getAtom(0);
for (int i = 0; i < targetGraph.getAtomCount(); i++) {
IAtom atom2 = targetGraph.getAtom(i);
if (atom2 instanceof IQueryAtom) {
IQueryAtom qAtom = (IQueryAtom) atom2;
if (qAtom.matches(atom)) {
arrayList.add(new CDKRMap(0, i));
}
} else {
if (atom2.getSymbol().equals(atom.getSymbol())) {
arrayList.add(new CDKRMap(0, i));
}
}
}
return arrayList;
} else {
return null;
}
} | class class_name[name] begin[{]
method[checkSingleAtomCases, return_type[type[List]], modifier[public static], parameter[sourceGraph, targetGraph]] begin[{]
if[binary_operation[member[.sourceGraph], instanceof, type[IQueryAtomContainer]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The first IAtomContainer must not be an IQueryAtomContainer")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CDKException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[call[targetGraph.getAtomCount, parameter[]], ==, literal[1]]] begin[{]
local_variable[type[List], arrayList]
local_variable[type[IAtom], atom]
if[binary_operation[member[.atom], instanceof, type[IQueryAtom]]] begin[{]
local_variable[type[IQueryAtom], qAtom]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAtom, postfix_operators=[], prefix_operators=[], qualifier=sourceGraph, selectors=[], type_arguments=None)], member=matches, postfix_operators=[], prefix_operators=[], qualifier=qAtom, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CDKRMap, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=arrayList, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getAtomCount, postfix_operators=[], prefix_operators=[], qualifier=sourceGraph, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
local_variable[type[String], atomSymbol]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAtom, postfix_operators=[], prefix_operators=[], qualifier=sourceGraph, selectors=[MethodInvocation(arguments=[], member=getSymbol, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=atomSymbol, 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=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CDKRMap, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=arrayList, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getAtomCount, postfix_operators=[], prefix_operators=[], qualifier=sourceGraph, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
return[member[.arrayList]]
else begin[{]
if[binary_operation[call[sourceGraph.getAtomCount, parameter[]], ==, literal[1]]] begin[{]
local_variable[type[List], arrayList]
local_variable[type[IAtom], atom]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAtom, postfix_operators=[], prefix_operators=[], qualifier=targetGraph, selectors=[], type_arguments=None), name=atom2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=atom2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=IQueryAtom, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getSymbol, postfix_operators=[], prefix_operators=[], qualifier=atom2, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSymbol, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None)], 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=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CDKRMap, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=arrayList, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=atom2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IQueryAtom, sub_type=None)), name=qAtom)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IQueryAtom, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=qAtom, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CDKRMap, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=arrayList, selectors=[], type_arguments=None), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getAtomCount, postfix_operators=[], prefix_operators=[], qualifier=targetGraph, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.arrayList]]
else begin[{]
return[literal[null]]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[CDKRMap] operator[>] identifier[checkSingleAtomCases] operator[SEP] identifier[IAtomContainer] identifier[sourceGraph] , identifier[IAtomContainer] identifier[targetGraph] operator[SEP] Keyword[throws] identifier[CDKException] {
Keyword[if] operator[SEP] identifier[sourceGraph] Keyword[instanceof] identifier[IQueryAtomContainer] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CDKException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[targetGraph] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[List] operator[<] identifier[CDKRMap] operator[>] identifier[arrayList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CDKRMap] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[IAtom] identifier[atom] operator[=] identifier[targetGraph] operator[SEP] identifier[getAtom] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[atom] Keyword[instanceof] identifier[IQueryAtom] operator[SEP] {
identifier[IQueryAtom] identifier[qAtom] operator[=] operator[SEP] identifier[IQueryAtom] operator[SEP] identifier[atom] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[sourceGraph] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[qAtom] operator[SEP] identifier[matches] operator[SEP] identifier[sourceGraph] operator[SEP] identifier[getAtom] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] {
identifier[arrayList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CDKRMap] operator[SEP] identifier[i] , Other[0] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
identifier[String] identifier[atomSymbol] operator[=] identifier[atom] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[sourceGraph] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[sourceGraph] operator[SEP] identifier[getAtom] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[atomSymbol] operator[SEP] operator[SEP] {
identifier[arrayList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CDKRMap] operator[SEP] identifier[i] , Other[0] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[arrayList] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[sourceGraph] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[List] operator[<] identifier[CDKRMap] operator[>] identifier[arrayList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CDKRMap] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[IAtom] identifier[atom] operator[=] identifier[sourceGraph] operator[SEP] identifier[getAtom] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[targetGraph] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[IAtom] identifier[atom2] operator[=] identifier[targetGraph] operator[SEP] identifier[getAtom] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[atom2] Keyword[instanceof] identifier[IQueryAtom] operator[SEP] {
identifier[IQueryAtom] identifier[qAtom] operator[=] operator[SEP] identifier[IQueryAtom] operator[SEP] identifier[atom2] operator[SEP] Keyword[if] operator[SEP] identifier[qAtom] operator[SEP] identifier[matches] operator[SEP] identifier[atom] operator[SEP] operator[SEP] {
identifier[arrayList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CDKRMap] operator[SEP] Other[0] , identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[atom2] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[atom] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[arrayList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CDKRMap] operator[SEP] Other[0] , identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[arrayList] operator[SEP]
}
Keyword[else] {
Keyword[return] Other[null] operator[SEP]
}
}
|
public ServerBuilder tls(File keyCertChainFile, File keyFile,
Consumer<SslContextBuilder> tlsCustomizer) throws SSLException {
defaultVirtualHostBuilderUpdated();
defaultVirtualHostBuilder.tls(keyCertChainFile, keyFile, tlsCustomizer);
return this;
} | class class_name[name] begin[{]
method[tls, return_type[type[ServerBuilder]], modifier[public], parameter[keyCertChainFile, keyFile, tlsCustomizer]] begin[{]
call[.defaultVirtualHostBuilderUpdated, parameter[]]
call[defaultVirtualHostBuilder.tls, parameter[member[.keyCertChainFile], member[.keyFile], member[.tlsCustomizer]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ServerBuilder] identifier[tls] operator[SEP] identifier[File] identifier[keyCertChainFile] , identifier[File] identifier[keyFile] , identifier[Consumer] operator[<] identifier[SslContextBuilder] operator[>] identifier[tlsCustomizer] operator[SEP] Keyword[throws] identifier[SSLException] {
identifier[defaultVirtualHostBuilderUpdated] operator[SEP] operator[SEP] operator[SEP] identifier[defaultVirtualHostBuilder] operator[SEP] identifier[tls] operator[SEP] identifier[keyCertChainFile] , identifier[keyFile] , identifier[tlsCustomizer] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public static WindowState getWindowState(String state) {
if (state == null) {
return null;
}
final WindowState windowState = WINDOW_STATES.get(state);
if (windowState != null) {
return windowState;
}
return new WindowState(state);
} | class class_name[name] begin[{]
method[getWindowState, return_type[type[WindowState]], modifier[public static], parameter[state]] begin[{]
if[binary_operation[member[.state], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[WindowState], windowState]
if[binary_operation[member[.windowState], !=, literal[null]]] begin[{]
return[member[.windowState]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=state, 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=WindowState, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[WindowState] identifier[getWindowState] operator[SEP] identifier[String] identifier[state] operator[SEP] {
Keyword[if] operator[SEP] identifier[state] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[final] identifier[WindowState] identifier[windowState] operator[=] identifier[WINDOW_STATES] operator[SEP] identifier[get] operator[SEP] identifier[state] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[windowState] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[windowState] operator[SEP]
}
Keyword[return] Keyword[new] identifier[WindowState] operator[SEP] identifier[state] operator[SEP] operator[SEP]
}
|
public Statement store(final Expression expr, Label firstVarInstruction) {
return store(expr, Optional.of(firstVarInstruction));
} | class class_name[name] begin[{]
method[store, return_type[type[Statement]], modifier[public], parameter[expr, firstVarInstruction]] begin[{]
return[call[.store, parameter[member[.expr], call[Optional.of, parameter[member[.firstVarInstruction]]]]]]
end[}]
END[}] | Keyword[public] identifier[Statement] identifier[store] operator[SEP] Keyword[final] identifier[Expression] identifier[expr] , identifier[Label] identifier[firstVarInstruction] operator[SEP] {
Keyword[return] identifier[store] operator[SEP] identifier[expr] , identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[firstVarInstruction] operator[SEP] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("rawtypes")
public List<String> discoverAndAddMappers(ClassLoader cl) {
List<String> added = new ArrayList<String>();
ServiceLoader<QueryResultMapper> availableProviders = ServiceLoader.load(QueryResultMapper.class, cl);
for (QueryResultMapper<?> mapper : availableProviders) {
QueryResultMapper<?> existed = knownMappers.putIfAbsent(mapper.getName(), mapper);
if (existed == null) {
added.add(mapper.getName());
logger.debug("Added mapper {} to the registry", mapper.getName());
} else {
logger.debug("Mapper {} already existing in the registry", mapper.getName());
}
}
return added;
} | class class_name[name] begin[{]
method[discoverAndAddMappers, return_type[type[List]], modifier[public], parameter[cl]] begin[{]
local_variable[type[List], added]
local_variable[type[ServiceLoader], availableProviders]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=mapper, selectors=[], type_arguments=None), MemberReference(member=mapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putIfAbsent, postfix_operators=[], prefix_operators=[], qualifier=knownMappers, selectors=[], type_arguments=None), name=existed)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=QueryResultMapper, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=existed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Mapper {} already existing in the registry"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=mapper, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=mapper, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=added, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Added mapper {} to the registry"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=mapper, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=availableProviders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=mapper)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=QueryResultMapper, sub_type=None))), label=None)
return[member[.added]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[discoverAndAddMappers] operator[SEP] identifier[ClassLoader] identifier[cl] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[added] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ServiceLoader] operator[<] identifier[QueryResultMapper] operator[>] identifier[availableProviders] operator[=] identifier[ServiceLoader] operator[SEP] identifier[load] operator[SEP] identifier[QueryResultMapper] operator[SEP] Keyword[class] , identifier[cl] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[QueryResultMapper] operator[<] operator[?] operator[>] identifier[mapper] operator[:] identifier[availableProviders] operator[SEP] {
identifier[QueryResultMapper] operator[<] operator[?] operator[>] identifier[existed] operator[=] identifier[knownMappers] operator[SEP] identifier[putIfAbsent] operator[SEP] identifier[mapper] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[mapper] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[existed] operator[==] Other[null] operator[SEP] {
identifier[added] operator[SEP] identifier[add] operator[SEP] identifier[mapper] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[mapper] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[mapper] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[added] operator[SEP]
}
|
@GET
@Produces(APPLICATION_JSON)
@Timed
@ExceptionMetered
public List<String> list(@QueryParam("namePattern") final String namePattern,
@QueryParam("selector") final List<String> hostSelectors) {
List<String> hosts = namePattern == null ? model.listHosts() : model.listHosts(namePattern);
if (!hostSelectors.isEmpty()) {
// check that all supplied selectors are parseable/valid
final List<HostSelector> selectors = hostSelectors.stream()
.map(selectorStr -> {
final HostSelector parsed = HostSelector.parse(selectorStr);
if (parsed == null) {
throw new WebApplicationException(
Response.status(Response.Status.BAD_REQUEST)
.entity("Invalid host selector: " + selectorStr)
.build()
);
}
return parsed;
})
.collect(Collectors.toList());
final Map<String, Map<String, String>> hostsAndLabels = getLabels(hosts);
final HostMatcher matcher = new HostMatcher(hostsAndLabels);
hosts = matcher.getMatchingHosts(selectors);
}
return hosts;
} | class class_name[name] begin[{]
method[list, return_type[type[List]], modifier[public], parameter[namePattern, hostSelectors]] begin[{]
local_variable[type[List], hosts]
if[call[hostSelectors.isEmpty, parameter[]]] begin[{]
local_variable[type[List], selectors]
local_variable[type[Map], hostsAndLabels]
local_variable[type[HostMatcher], matcher]
assign[member[.hosts], call[matcher.getMatchingHosts, parameter[member[.selectors]]]]
else begin[{]
None
end[}]
return[member[.hosts]]
end[}]
END[}] | annotation[@] identifier[GET] annotation[@] identifier[Produces] operator[SEP] identifier[APPLICATION_JSON] operator[SEP] annotation[@] identifier[Timed] annotation[@] identifier[ExceptionMetered] Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[list] operator[SEP] annotation[@] identifier[QueryParam] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[String] identifier[namePattern] , annotation[@] identifier[QueryParam] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[hostSelectors] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[hosts] operator[=] identifier[namePattern] operator[==] Other[null] operator[?] identifier[model] operator[SEP] identifier[listHosts] operator[SEP] operator[SEP] operator[:] identifier[model] operator[SEP] identifier[listHosts] operator[SEP] identifier[namePattern] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[hostSelectors] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[List] operator[<] identifier[HostSelector] operator[>] identifier[selectors] operator[=] identifier[hostSelectors] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[selectorStr] operator[->] {
Keyword[final] identifier[HostSelector] identifier[parsed] operator[=] identifier[HostSelector] operator[SEP] identifier[parse] operator[SEP] identifier[selectorStr] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parsed] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[WebApplicationException] operator[SEP] identifier[Response] operator[SEP] identifier[status] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[BAD_REQUEST] operator[SEP] operator[SEP] identifier[entity] operator[SEP] literal[String] operator[+] identifier[selectorStr] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[parsed] operator[SEP]
} operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] operator[>] identifier[hostsAndLabels] operator[=] identifier[getLabels] operator[SEP] identifier[hosts] operator[SEP] operator[SEP] Keyword[final] identifier[HostMatcher] identifier[matcher] operator[=] Keyword[new] identifier[HostMatcher] operator[SEP] identifier[hostsAndLabels] operator[SEP] operator[SEP] identifier[hosts] operator[=] identifier[matcher] operator[SEP] identifier[getMatchingHosts] operator[SEP] identifier[selectors] operator[SEP] operator[SEP]
}
Keyword[return] identifier[hosts] operator[SEP]
}
|
public static RadioInput build(String name, String keys[], String values[]) {
RadioInput si = RadioInput.build(name);
if (keys.length != values.length) {
throw new IllegalArgumentException("Key / Values with unequal lenght");
}
LinkedHashMap<String, String> possibleNames = new LinkedHashMap<>();
for (int i = 0; i < keys.length; i++) {
possibleNames.put(keys[i], values[i]);
}
si.setPossibleValues(possibleNames);
return si;
} | class class_name[name] begin[{]
method[build, return_type[type[RadioInput]], modifier[public static], parameter[name, keys, values]] begin[{]
local_variable[type[RadioInput], si]
if[binary_operation[member[keys.length], !=, member[values.length]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Key / Values with unequal lenght")], 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[LinkedHashMap], possibleNames]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=put, postfix_operators=[], prefix_operators=[], qualifier=possibleNames, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=keys, 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)
call[si.setPossibleValues, parameter[member[.possibleNames]]]
return[member[.si]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[RadioInput] identifier[build] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[keys] operator[SEP] operator[SEP] , identifier[String] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
identifier[RadioInput] identifier[si] operator[=] identifier[RadioInput] operator[SEP] identifier[build] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keys] operator[SEP] identifier[length] operator[!=] identifier[values] operator[SEP] identifier[length] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[LinkedHashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[possibleNames] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[keys] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[possibleNames] operator[SEP] identifier[put] operator[SEP] identifier[keys] operator[SEP] identifier[i] operator[SEP] , identifier[values] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
identifier[si] operator[SEP] identifier[setPossibleValues] operator[SEP] identifier[possibleNames] operator[SEP] operator[SEP] Keyword[return] identifier[si] operator[SEP]
}
|
protected void collectActionFilters() {
final Collection<? extends ActionFilter> filterValues = filtersManager.getAllFilters();
filters = new ArrayList<>();
filters.addAll(filterValues);
filters.sort(Comparator.comparing(a -> a.getClass().getSimpleName()));
} | class class_name[name] begin[{]
method[collectActionFilters, return_type[void], modifier[protected], parameter[]] begin[{]
local_variable[type[Collection], filterValues]
assign[member[.filters], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))]
call[filters.addAll, parameter[member[.filterValues]]]
call[filters.sort, parameter[call[Comparator.comparing, parameter[LambdaExpression(body=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[collectActionFilters] operator[SEP] operator[SEP] {
Keyword[final] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[ActionFilter] operator[>] identifier[filterValues] operator[=] identifier[filtersManager] operator[SEP] identifier[getAllFilters] operator[SEP] operator[SEP] operator[SEP] identifier[filters] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[filters] operator[SEP] identifier[addAll] operator[SEP] identifier[filterValues] operator[SEP] operator[SEP] identifier[filters] operator[SEP] identifier[sort] operator[SEP] identifier[Comparator] operator[SEP] identifier[comparing] operator[SEP] identifier[a] operator[->] identifier[a] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String convertClassNameToUnderscoreName(String name) {
StringBuilder result = new StringBuilder();
if (name != null) {
int len = name.length();
if (len > 0) {
result.append(name.charAt(0));
for (int i = 1; i < len; i++) {
if (true == Character.isUpperCase(name.charAt(i))) {
result.append('_');
}
result.append(name.charAt(i));
}
}
}
return result.toString().toUpperCase();
} | class class_name[name] begin[{]
method[convertClassNameToUnderscoreName, return_type[type[String]], modifier[public static], parameter[name]] begin[{]
local_variable[type[StringBuilder], result]
if[binary_operation[member[.name], !=, literal[null]]] begin[{]
local_variable[type[int], len]
if[binary_operation[member[.len], >, literal[0]]] begin[{]
call[result.append, parameter[call[name.charAt, parameter[literal[0]]]]]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None)], member=isUpperCase, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='_')], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[call[result.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[convertClassNameToUnderscoreName] operator[SEP] identifier[String] identifier[name] operator[SEP] {
identifier[StringBuilder] identifier[result] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[!=] Other[null] operator[SEP] {
Keyword[int] identifier[len] operator[=] identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[>] Other[0] operator[SEP] {
identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[name] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] literal[boolean] operator[==] identifier[Character] operator[SEP] identifier[isUpperCase] operator[SEP] identifier[name] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] {
identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[name] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP]
}
|
protected Path createTempDirectory(String prefix) {
try {
return Files.createTempDirectory(tempDirectory, prefix);
} catch (IOException e) {
throw new AllureCommandException(e);
}
} | class class_name[name] begin[{]
method[createTempDirectory, return_type[type[Path]], modifier[protected], parameter[prefix]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=tempDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createTempDirectory, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AllureCommandException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[protected] identifier[Path] identifier[createTempDirectory] operator[SEP] identifier[String] identifier[prefix] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[Files] operator[SEP] identifier[createTempDirectory] operator[SEP] identifier[tempDirectory] , identifier[prefix] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[AllureCommandException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.