code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
---|---|---|
private HttpResponse executeUploadInitiation(GenericUrl initiationRequestUrl) throws IOException {
updateStateAndNotifyListener(UploadState.INITIATION_STARTED);
initiationRequestUrl.put("uploadType", "resumable");
HttpContent content = metadata == null ? new EmptyContent() : metadata;
HttpRequest request =
requestFactory.buildRequest(initiationRequestMethod, initiationRequestUrl, content);
initiationHeaders.set(CONTENT_TYPE_HEADER, mediaContent.getType());
if (isMediaLengthKnown()) {
initiationHeaders.set(CONTENT_LENGTH_HEADER, getMediaContentLength());
}
request.getHeaders().putAll(initiationHeaders);
HttpResponse response = executeCurrentRequest(request);
boolean notificationCompleted = false;
try {
updateStateAndNotifyListener(UploadState.INITIATION_COMPLETE);
notificationCompleted = true;
} finally {
if (!notificationCompleted) {
response.disconnect();
}
}
return response;
} | class class_name[name] begin[{]
method[executeUploadInitiation, return_type[type[HttpResponse]], modifier[private], parameter[initiationRequestUrl]] begin[{]
call[.updateStateAndNotifyListener, parameter[member[UploadState.INITIATION_STARTED]]]
call[initiationRequestUrl.put, parameter[literal["uploadType"], literal["resumable"]]]
local_variable[type[HttpContent], content]
local_variable[type[HttpRequest], request]
call[initiationHeaders.set, parameter[member[.CONTENT_TYPE_HEADER], call[mediaContent.getType, parameter[]]]]
if[call[.isMediaLengthKnown, parameter[]]] begin[{]
call[initiationHeaders.set, parameter[member[.CONTENT_LENGTH_HEADER], call[.getMediaContentLength, parameter[]]]]
else begin[{]
None
end[}]
call[request.getHeaders, parameter[]]
local_variable[type[HttpResponse], response]
local_variable[type[boolean], notificationCompleted]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INITIATION_COMPLETE, postfix_operators=[], prefix_operators=[], qualifier=UploadState, selectors=[])], member=updateStateAndNotifyListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=notificationCompleted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=None, finally_block=[IfStatement(condition=MemberReference(member=notificationCompleted, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=disconnect, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None)
return[member[.response]]
end[}]
END[}] | Keyword[private] identifier[HttpResponse] identifier[executeUploadInitiation] operator[SEP] identifier[GenericUrl] identifier[initiationRequestUrl] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[updateStateAndNotifyListener] operator[SEP] identifier[UploadState] operator[SEP] identifier[INITIATION_STARTED] operator[SEP] operator[SEP] identifier[initiationRequestUrl] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[HttpContent] identifier[content] operator[=] identifier[metadata] operator[==] Other[null] operator[?] Keyword[new] identifier[EmptyContent] operator[SEP] operator[SEP] operator[:] identifier[metadata] operator[SEP] identifier[HttpRequest] identifier[request] operator[=] identifier[requestFactory] operator[SEP] identifier[buildRequest] operator[SEP] identifier[initiationRequestMethod] , identifier[initiationRequestUrl] , identifier[content] operator[SEP] operator[SEP] identifier[initiationHeaders] operator[SEP] identifier[set] operator[SEP] identifier[CONTENT_TYPE_HEADER] , identifier[mediaContent] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isMediaLengthKnown] operator[SEP] operator[SEP] operator[SEP] {
identifier[initiationHeaders] operator[SEP] identifier[set] operator[SEP] identifier[CONTENT_LENGTH_HEADER] , identifier[getMediaContentLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[request] operator[SEP] identifier[getHeaders] operator[SEP] operator[SEP] operator[SEP] identifier[putAll] operator[SEP] identifier[initiationHeaders] operator[SEP] operator[SEP] identifier[HttpResponse] identifier[response] operator[=] identifier[executeCurrentRequest] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[boolean] identifier[notificationCompleted] operator[=] literal[boolean] operator[SEP] Keyword[try] {
identifier[updateStateAndNotifyListener] operator[SEP] identifier[UploadState] operator[SEP] identifier[INITIATION_COMPLETE] operator[SEP] operator[SEP] identifier[notificationCompleted] operator[=] literal[boolean] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] operator[!] identifier[notificationCompleted] operator[SEP] {
identifier[response] operator[SEP] identifier[disconnect] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[response] operator[SEP]
}
|
private Optional<String> get(String key, Set<String> processingKeys) {
for (ConfigurationSource configurationSource : config.getConfigurationSources()) {
Optional<String> value = configurationSource.get(key);
if (value.isPresent()) {
return Optional.of(interpolateString(
key, ConfigurationDecoderUtils.decodeConfigValueIfEncoded(key, value.get()), processingKeys));
}
}
return Optional.empty();
} | class class_name[name] begin[{]
method[get, return_type[type[Optional]], modifier[private], parameter[key, processingKeys]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=configurationSource, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Optional, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isPresent, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], member=decodeConfigValueIfEncoded, postfix_operators=[], prefix_operators=[], qualifier=ConfigurationDecoderUtils, selectors=[], type_arguments=None), MemberReference(member=processingKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=interpolateString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=of, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getConfigurationSources, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=configurationSource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConfigurationSource, sub_type=None))), label=None)
return[call[Optional.empty, parameter[]]]
end[}]
END[}] | Keyword[private] identifier[Optional] operator[<] identifier[String] operator[>] identifier[get] operator[SEP] identifier[String] identifier[key] , identifier[Set] operator[<] identifier[String] operator[>] identifier[processingKeys] operator[SEP] {
Keyword[for] operator[SEP] identifier[ConfigurationSource] identifier[configurationSource] operator[:] identifier[config] operator[SEP] identifier[getConfigurationSources] operator[SEP] operator[SEP] operator[SEP] {
identifier[Optional] operator[<] identifier[String] operator[>] identifier[value] operator[=] identifier[configurationSource] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[interpolateString] operator[SEP] identifier[key] , identifier[ConfigurationDecoderUtils] operator[SEP] identifier[decodeConfigValueIfEncoded] operator[SEP] identifier[key] , identifier[value] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] , identifier[processingKeys] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP]
}
|
private void recordMount(SlotReference slot) {
if (mediaMounts.add(slot)) {
deliverMountUpdate(slot, true);
}
if (!mediaDetails.containsKey(slot)) {
try {
VirtualCdj.getInstance().sendMediaQuery(slot);
} catch (Exception e) {
logger.warn("Problem trying to request media details for " + slot, e);
}
}
} | class class_name[name] begin[{]
method[recordMount, return_type[void], modifier[private], parameter[slot]] begin[{]
if[call[mediaMounts.add, parameter[member[.slot]]]] begin[{]
call[.deliverMountUpdate, parameter[member[.slot], literal[true]]]
else begin[{]
None
end[}]
if[call[mediaDetails.containsKey, parameter[member[.slot]]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=VirtualCdj, selectors=[MethodInvocation(arguments=[MemberReference(member=slot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendMediaQuery, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Problem trying to request media details for "), operandr=MemberReference(member=slot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[recordMount] operator[SEP] identifier[SlotReference] identifier[slot] operator[SEP] {
Keyword[if] operator[SEP] identifier[mediaMounts] operator[SEP] identifier[add] operator[SEP] identifier[slot] operator[SEP] operator[SEP] {
identifier[deliverMountUpdate] operator[SEP] identifier[slot] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[mediaDetails] operator[SEP] identifier[containsKey] operator[SEP] identifier[slot] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[VirtualCdj] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[sendMediaQuery] operator[SEP] identifier[slot] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[slot] , identifier[e] operator[SEP] operator[SEP]
}
}
}
|
@Override
public GetRoomSkillParameterResult getRoomSkillParameter(GetRoomSkillParameterRequest request) {
request = beforeClientExecution(request);
return executeGetRoomSkillParameter(request);
} | class class_name[name] begin[{]
method[getRoomSkillParameter, return_type[type[GetRoomSkillParameterResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeGetRoomSkillParameter, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[GetRoomSkillParameterResult] identifier[getRoomSkillParameter] operator[SEP] identifier[GetRoomSkillParameterRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetRoomSkillParameter] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static AlipayOpenAuthTokenAppQueryResponse openAuthTokenAppQueryToResponse(
AlipayOpenAuthTokenAppQueryModel model) throws AlipayApiException {
AlipayOpenAuthTokenAppQueryRequest request = new AlipayOpenAuthTokenAppQueryRequest();
request.setBizModel(model);
return AliPayApiConfigKit.getAliPayApiConfig().getAlipayClient().execute(request);
} | class class_name[name] begin[{]
method[openAuthTokenAppQueryToResponse, return_type[type[AlipayOpenAuthTokenAppQueryResponse]], modifier[public static], parameter[model]] begin[{]
local_variable[type[AlipayOpenAuthTokenAppQueryRequest], request]
call[request.setBizModel, parameter[member[.model]]]
return[call[AliPayApiConfigKit.getAliPayApiConfig, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[AlipayOpenAuthTokenAppQueryResponse] identifier[openAuthTokenAppQueryToResponse] operator[SEP] identifier[AlipayOpenAuthTokenAppQueryModel] identifier[model] operator[SEP] Keyword[throws] identifier[AlipayApiException] {
identifier[AlipayOpenAuthTokenAppQueryRequest] identifier[request] operator[=] Keyword[new] identifier[AlipayOpenAuthTokenAppQueryRequest] operator[SEP] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setBizModel] operator[SEP] identifier[model] operator[SEP] operator[SEP] Keyword[return] identifier[AliPayApiConfigKit] operator[SEP] identifier[getAliPayApiConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getAlipayClient] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
private int registerBlockInstance() {
int blockInstNo = blockInstTabCnt++;
if (blockInstTab == null) {
blockInstTab = new BlockInstTabRec[64];
}
if (blockInstTabCnt > blockInstTab.length) {
blockInstTab = (BlockInstTabRec[]) MiniTemplatorParser.resizeArray(blockInstTab, 2 * blockInstTabCnt);
}
blockInstTab[blockInstNo] = new BlockInstTabRec();
return blockInstNo;
} | class class_name[name] begin[{]
method[registerBlockInstance, return_type[type[int]], modifier[private], parameter[]] begin[{]
local_variable[type[int], blockInstNo]
if[binary_operation[member[.blockInstTab], ==, literal[null]]] begin[{]
assign[member[.blockInstTab], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=64)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BlockInstTabRec, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.blockInstTabCnt], >, member[blockInstTab.length]]] begin[{]
assign[member[.blockInstTab], Cast(expression=MethodInvocation(arguments=[MemberReference(member=blockInstTab, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operandr=MemberReference(member=blockInstTabCnt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=resizeArray, postfix_operators=[], prefix_operators=[], qualifier=MiniTemplatorParser, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=BlockInstTabRec, sub_type=None))]
else begin[{]
None
end[}]
assign[member[.blockInstTab], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BlockInstTabRec, sub_type=None))]
return[member[.blockInstNo]]
end[}]
END[}] | Keyword[private] Keyword[int] identifier[registerBlockInstance] operator[SEP] operator[SEP] {
Keyword[int] identifier[blockInstNo] operator[=] identifier[blockInstTabCnt] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[blockInstTab] operator[==] Other[null] operator[SEP] {
identifier[blockInstTab] operator[=] Keyword[new] identifier[BlockInstTabRec] operator[SEP] Other[64] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[blockInstTabCnt] operator[>] identifier[blockInstTab] operator[SEP] identifier[length] operator[SEP] {
identifier[blockInstTab] operator[=] operator[SEP] identifier[BlockInstTabRec] operator[SEP] operator[SEP] operator[SEP] identifier[MiniTemplatorParser] operator[SEP] identifier[resizeArray] operator[SEP] identifier[blockInstTab] , Other[2] operator[*] identifier[blockInstTabCnt] operator[SEP] operator[SEP]
}
identifier[blockInstTab] operator[SEP] identifier[blockInstNo] operator[SEP] operator[=] Keyword[new] identifier[BlockInstTabRec] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[blockInstNo] operator[SEP]
}
|
void readMeta() {
final int check = buffer.getInt();
if(check != MAGIC) {
throw new AbortException("File does not start with expected magic.");
}
final int nummeta = buffer.getInt();
assert (nummeta > 0) : "Empty bundle?";
meta = new BundleMeta(nummeta);
sers = new ByteBufferSerializer<?>[nummeta];
data = new Object[nummeta];
for(int i = 0; i < nummeta; i++) {
try {
@SuppressWarnings("unchecked")
SimpleTypeInformation<? extends Object> type = (SimpleTypeInformation<? extends Object>) TypeInformationSerializer.STATIC.fromByteBuffer(buffer);
sers[i] = type.getSerializer();
if(i == 0 && DBID.class.isAssignableFrom(type.getRestrictionClass())) {
hasids = true;
}
else {
meta.add(type);
}
}
catch(UnsupportedOperationException e) {
throw new AbortException("Deserialization failed: " + e.getMessage(), e);
}
catch(IOException e) {
throw new AbortException("IO error", e);
}
}
} | class class_name[name] begin[{]
method[readMeta, return_type[void], modifier[default], parameter[]] begin[{]
local_variable[type[int], check]
if[binary_operation[member[.check], !=, member[.MAGIC]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="File does not start with expected magic.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbortException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], nummeta]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=nummeta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Empty bundle?"))
assign[member[.meta], ClassCreator(arguments=[MemberReference(member=nummeta, 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=BundleMeta, sub_type=None))]
assign[member[.sers], ArrayCreator(dimensions=[MemberReference(member=nummeta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=None, name=ByteBufferSerializer, sub_type=None))]
assign[member[.data], ArrayCreator(dimensions=[MemberReference(member=nummeta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unchecked"), name=SuppressWarnings)], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromByteBuffer, postfix_operators=[], prefix_operators=[], qualifier=TypeInformationSerializer.STATIC, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=SimpleTypeInformation, sub_type=None)), name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=SimpleTypeInformation, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getSerializer, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRestrictionClass, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=DBID, sub_type=None)), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=meta, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hasids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Deserialization failed: "), 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=AbortException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedOperationException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IO error"), 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=AbortException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nummeta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[void] identifier[readMeta] operator[SEP] operator[SEP] {
Keyword[final] Keyword[int] identifier[check] operator[=] identifier[buffer] operator[SEP] identifier[getInt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[check] operator[!=] identifier[MAGIC] operator[SEP] {
Keyword[throw] Keyword[new] identifier[AbortException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[final] Keyword[int] identifier[nummeta] operator[=] identifier[buffer] operator[SEP] identifier[getInt] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[nummeta] operator[>] Other[0] operator[SEP] operator[:] literal[String] operator[SEP] identifier[meta] operator[=] Keyword[new] identifier[BundleMeta] operator[SEP] identifier[nummeta] operator[SEP] operator[SEP] identifier[sers] operator[=] Keyword[new] identifier[ByteBufferSerializer] operator[<] operator[?] operator[>] operator[SEP] identifier[nummeta] operator[SEP] operator[SEP] identifier[data] operator[=] Keyword[new] identifier[Object] operator[SEP] identifier[nummeta] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[nummeta] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[try] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[SimpleTypeInformation] operator[<] operator[?] Keyword[extends] identifier[Object] operator[>] identifier[type] operator[=] operator[SEP] identifier[SimpleTypeInformation] operator[<] operator[?] Keyword[extends] identifier[Object] operator[>] operator[SEP] identifier[TypeInformationSerializer] operator[SEP] identifier[STATIC] operator[SEP] identifier[fromByteBuffer] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] identifier[sers] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[type] operator[SEP] identifier[getSerializer] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[==] Other[0] operator[&&] identifier[DBID] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[type] operator[SEP] identifier[getRestrictionClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[hasids] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[meta] operator[SEP] identifier[add] operator[SEP] identifier[type] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[UnsupportedOperationException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[AbortException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[AbortException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
}
|
public void setTables(final List<Table> tables) {
this.tablesMap.clear();
for (final Table table : tables)
this.addTableConfig(table.getConfigEntry());
} | class class_name[name] begin[{]
method[setTables, return_type[void], modifier[public], parameter[tables]] begin[{]
THIS[member[None.tablesMap]call[None.clear, parameter[]]]
ForStatement(body=StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getConfigEntry, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None)], member=addTableConfig, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), control=EnhancedForControl(iterable=MemberReference(member=tables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=table)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Table, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setTables] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Table] operator[>] identifier[tables] operator[SEP] {
Keyword[this] operator[SEP] identifier[tablesMap] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Table] identifier[table] operator[:] identifier[tables] operator[SEP] Keyword[this] operator[SEP] identifier[addTableConfig] operator[SEP] identifier[table] operator[SEP] identifier[getConfigEntry] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void getNotifications(Patient patient, Collection<Notification> result) {
List<String> lst = null;
result.clear();
if (patient == null) {
lst = broker.callRPCList("RGCWXQ ALRLIST", null);
} else if (patient != null) {
lst = broker.callRPCList("RGCWXQ ALRLIST", null, patient.getIdElement().getIdPart());
}
if (lst != null) {
for (String item : lst) {
result.add(new Notification(item));
}
}
} | class class_name[name] begin[{]
method[getNotifications, return_type[void], modifier[public], parameter[patient, result]] begin[{]
local_variable[type[List], lst]
call[result.clear, parameter[]]
if[binary_operation[member[.patient], ==, literal[null]]] begin[{]
assign[member[.lst], call[broker.callRPCList, parameter[literal["RGCWXQ ALRLIST"], literal[null]]]]
else begin[{]
if[binary_operation[member[.patient], !=, literal[null]]] begin[{]
assign[member[.lst], call[broker.callRPCList, parameter[literal["RGCWXQ ALRLIST"], literal[null], call[patient.getIdElement, parameter[]]]]]
else begin[{]
None
end[}]
end[}]
if[binary_operation[member[.lst], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=item, 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=Notification, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=lst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[getNotifications] operator[SEP] identifier[Patient] identifier[patient] , identifier[Collection] operator[<] identifier[Notification] operator[>] identifier[result] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[lst] operator[=] Other[null] operator[SEP] identifier[result] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[patient] operator[==] Other[null] operator[SEP] {
identifier[lst] operator[=] identifier[broker] operator[SEP] identifier[callRPCList] operator[SEP] literal[String] , Other[null] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[patient] operator[!=] Other[null] operator[SEP] {
identifier[lst] operator[=] identifier[broker] operator[SEP] identifier[callRPCList] operator[SEP] literal[String] , Other[null] , identifier[patient] operator[SEP] identifier[getIdElement] operator[SEP] operator[SEP] operator[SEP] identifier[getIdPart] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[lst] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[item] operator[:] identifier[lst] operator[SEP] {
identifier[result] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Notification] operator[SEP] identifier[item] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
@Override
public int prepare(Xid xid) throws XAException {
if (logger.logDebug()) {
debug("preparing transaction xid = " + xid);
}
// Check preconditions
if (!currentXid.equals(xid)) {
throw new CloudSpannerXAException(CloudSpannerXAException.PREPARE_WITH_SAME,
Code.UNIMPLEMENTED, XAException.XAER_RMERR);
}
if (state != STATE_ENDED) {
throw new CloudSpannerXAException(CloudSpannerXAException.PREPARE_BEFORE_END,
Code.FAILED_PRECONDITION, XAException.XAER_INVAL);
}
state = STATE_IDLE;
currentXid = null;
try {
String s = RecoveredXid.xidToString(xid);
conn.prepareTransaction(s);
conn.setAutoCommit(localAutoCommitMode);
return XA_OK;
} catch (CloudSpannerSQLException ex) {
throw new CloudSpannerXAException(CloudSpannerXAException.ERROR_PREPARING, ex,
XAException.XAER_RMERR);
} catch (SQLException ex) {
throw new CloudSpannerXAException(CloudSpannerXAException.ERROR_PREPARING, ex, Code.UNKNOWN,
XAException.XAER_RMERR);
}
} | class class_name[name] begin[{]
method[prepare, return_type[type[int]], modifier[public], parameter[xid]] begin[{]
if[call[logger.logDebug, parameter[]]] begin[{]
call[.debug, parameter[binary_operation[literal["preparing transaction xid = "], +, member[.xid]]]]
else begin[{]
None
end[}]
if[call[currentXid.equals, parameter[member[.xid]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=PREPARE_WITH_SAME, postfix_operators=[], prefix_operators=[], qualifier=CloudSpannerXAException, selectors=[]), MemberReference(member=UNIMPLEMENTED, postfix_operators=[], prefix_operators=[], qualifier=Code, selectors=[]), MemberReference(member=XAER_RMERR, postfix_operators=[], prefix_operators=[], qualifier=XAException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CloudSpannerXAException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.state], !=, member[.STATE_ENDED]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=PREPARE_BEFORE_END, postfix_operators=[], prefix_operators=[], qualifier=CloudSpannerXAException, selectors=[]), MemberReference(member=FAILED_PRECONDITION, postfix_operators=[], prefix_operators=[], qualifier=Code, selectors=[]), MemberReference(member=XAER_INVAL, postfix_operators=[], prefix_operators=[], qualifier=XAException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CloudSpannerXAException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.state], member[.STATE_IDLE]]
assign[member[.currentXid], literal[null]]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=xid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=xidToString, postfix_operators=[], prefix_operators=[], qualifier=RecoveredXid, selectors=[], type_arguments=None), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=prepareTransaction, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=localAutoCommitMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAutoCommit, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=XA_OK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ERROR_PREPARING, postfix_operators=[], prefix_operators=[], qualifier=CloudSpannerXAException, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=XAER_RMERR, postfix_operators=[], prefix_operators=[], qualifier=XAException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CloudSpannerXAException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['CloudSpannerSQLException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ERROR_PREPARING, postfix_operators=[], prefix_operators=[], qualifier=CloudSpannerXAException, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UNKNOWN, postfix_operators=[], prefix_operators=[], qualifier=Code, selectors=[]), MemberReference(member=XAER_RMERR, postfix_operators=[], prefix_operators=[], qualifier=XAException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CloudSpannerXAException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SQLException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[prepare] operator[SEP] identifier[Xid] identifier[xid] operator[SEP] Keyword[throws] identifier[XAException] {
Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[logDebug] operator[SEP] operator[SEP] operator[SEP] {
identifier[debug] operator[SEP] literal[String] operator[+] identifier[xid] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[currentXid] operator[SEP] identifier[equals] operator[SEP] identifier[xid] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CloudSpannerXAException] operator[SEP] identifier[CloudSpannerXAException] operator[SEP] identifier[PREPARE_WITH_SAME] , identifier[Code] operator[SEP] identifier[UNIMPLEMENTED] , identifier[XAException] operator[SEP] identifier[XAER_RMERR] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[state] operator[!=] identifier[STATE_ENDED] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CloudSpannerXAException] operator[SEP] identifier[CloudSpannerXAException] operator[SEP] identifier[PREPARE_BEFORE_END] , identifier[Code] operator[SEP] identifier[FAILED_PRECONDITION] , identifier[XAException] operator[SEP] identifier[XAER_INVAL] operator[SEP] operator[SEP]
}
identifier[state] operator[=] identifier[STATE_IDLE] operator[SEP] identifier[currentXid] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[String] identifier[s] operator[=] identifier[RecoveredXid] operator[SEP] identifier[xidToString] operator[SEP] identifier[xid] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[prepareTransaction] operator[SEP] identifier[s] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[setAutoCommit] operator[SEP] identifier[localAutoCommitMode] operator[SEP] operator[SEP] Keyword[return] identifier[XA_OK] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CloudSpannerSQLException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CloudSpannerXAException] operator[SEP] identifier[CloudSpannerXAException] operator[SEP] identifier[ERROR_PREPARING] , identifier[ex] , identifier[XAException] operator[SEP] identifier[XAER_RMERR] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SQLException] identifier[ex] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CloudSpannerXAException] operator[SEP] identifier[CloudSpannerXAException] operator[SEP] identifier[ERROR_PREPARING] , identifier[ex] , identifier[Code] operator[SEP] identifier[UNKNOWN] , identifier[XAException] operator[SEP] identifier[XAER_RMERR] operator[SEP] operator[SEP]
}
}
|
public static <K, V> Map<K, V> asDeepMap(Map<K, V> map) {
return from(map).deepLook().map();
} | class class_name[name] begin[{]
method[asDeepMap, return_type[type[Map]], modifier[public static], parameter[map]] begin[{]
return[call[.from, parameter[member[.map]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[asDeepMap] operator[SEP] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[map] operator[SEP] {
Keyword[return] identifier[from] operator[SEP] identifier[map] operator[SEP] operator[SEP] identifier[deepLook] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] operator[SEP] operator[SEP]
}
|
public static byte[] decode( byte[] source ){
byte[] decoded = null;
try {
decoded = decode( source, 0, source.length, Base64.NO_OPTIONS );
} catch( java.io.IOException ex ) {
assert false : "IOExceptions only come from GZipping, which is turned off: " + ex.getMessage();
}
return decoded;
} | class class_name[name] begin[{]
method[decode, return_type[type[byte]], modifier[public static], parameter[source]] begin[{]
local_variable[type[byte], decoded]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=decoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[]), MemberReference(member=NO_OPTIONS, postfix_operators=[], prefix_operators=[], qualifier=Base64, selectors=[])], member=decode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[AssertStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IOExceptions only come from GZipping, which is turned off: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), operator=+))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['java.io.IOException']))], finally_block=None, label=None, resources=None)
return[member[.decoded]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[decode] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[source] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[decoded] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[decoded] operator[=] identifier[decode] operator[SEP] identifier[source] , Other[0] , identifier[source] operator[SEP] identifier[length] , identifier[Base64] operator[SEP] identifier[NO_OPTIONS] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] {
Keyword[assert] literal[boolean] operator[:] literal[String] operator[+] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[decoded] operator[SEP]
}
|
public static boolean safeCloseAll(Iterable<? extends Closeable> closeables) {
final Iterator<? extends Closeable> it = closeables.iterator();
boolean result = true;
while (it.hasNext()) {
result &= safeClose(it.next());
}
return result;
} | class class_name[name] begin[{]
method[safeCloseAll, return_type[type[boolean]], modifier[public static], parameter[closeables]] begin[{]
local_variable[type[Iterator], it]
local_variable[type[boolean], result]
while[call[it.hasNext, parameter[]]] begin[{]
assign[member[.result], call[.safeClose, parameter[call[it.next, parameter[]]]]]
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[safeCloseAll] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[Closeable] operator[>] identifier[closeables] operator[SEP] {
Keyword[final] identifier[Iterator] operator[<] operator[?] Keyword[extends] identifier[Closeable] operator[>] identifier[it] operator[=] identifier[closeables] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[result] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[result] operator[&=] identifier[safeClose] operator[SEP] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
private ArrayList obtainCandidateList(String[] tTokens, String[] uTokens,
double[] tIdfArray, double[] uIdfArray) {
ArrayList candidateList = new ArrayList();
double minStringSize = getMinStringSize(tTokens, uTokens);
for (int t = 0; t < tTokens.length; t++) {
int lastTr = -1;
for (int u = 0, flag = 0; u < uTokens.length && flag == 0; u++) {
int tr = Math.abs(t - u);
if (lastTr >= 0 && lastTr < tr) {
flag = 1;
}
else {
String tTok = tTokens[t], uTok = uTokens[u];
double innerScore = tokenDistance.score(tTok,
uTok);
if (innerScore >= 0.0) {
double matched = 0.0;
if (innerScore == 1.0) {
matched = tTokens[t].length();
}
else {
matched = ( (TagLinkToken) tokenDistance).getMatched();
}
double weightMatched = matched / minStringSize,
weightTFIDF = tIdfArray[t] * uIdfArray[u],
weight = (weightTFIDF + weightMatched) / 2.0;
if (innerScore == 1) {
lastTr = tr;
}
candidateList.add(new Candidates(t, u, innerScore * weight));
}
}
}
}
return candidateList;
} | class class_name[name] begin[{]
method[obtainCandidateList, return_type[type[ArrayList]], modifier[private], parameter[tTokens, uTokens, tIdfArray, uIdfArray]] begin[{]
local_variable[type[ArrayList], candidateList]
local_variable[type[double], minStringSize]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), name=lastTr)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=tr)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lastTr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=lastTr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=tr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=&&), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=tTokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=tTok), VariableDeclarator(dimensions=[], initializer=MemberReference(member=uTokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=uTok)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=tTok, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uTok, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=score, postfix_operators=[], prefix_operators=[], qualifier=tokenDistance, selectors=[], type_arguments=None), name=innerScore)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=innerScore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0), name=matched)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=innerScore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matched, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=tokenDistance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TagLinkToken, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matched, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=tTokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=matched, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=minStringSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), name=weightMatched), VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=tIdfArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=uIdfArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*), name=weightTFIDF), VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=weightTFIDF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=weightMatched, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2.0), operator=/), name=weight)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=innerScore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastTr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=tr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=innerScore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=weight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Candidates, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=candidateList, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=flag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=uTokens, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=flag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=&&), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=u), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=flag)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=u, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tTokens, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=t)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=t, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.candidateList]]
end[}]
END[}] | Keyword[private] identifier[ArrayList] identifier[obtainCandidateList] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[tTokens] , identifier[String] operator[SEP] operator[SEP] identifier[uTokens] , Keyword[double] operator[SEP] operator[SEP] identifier[tIdfArray] , Keyword[double] operator[SEP] operator[SEP] identifier[uIdfArray] operator[SEP] {
identifier[ArrayList] identifier[candidateList] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[minStringSize] operator[=] identifier[getMinStringSize] operator[SEP] identifier[tTokens] , identifier[uTokens] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[t] operator[=] Other[0] operator[SEP] identifier[t] operator[<] identifier[tTokens] operator[SEP] identifier[length] operator[SEP] identifier[t] operator[++] operator[SEP] {
Keyword[int] identifier[lastTr] operator[=] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[u] operator[=] Other[0] , identifier[flag] operator[=] Other[0] operator[SEP] identifier[u] operator[<] identifier[uTokens] operator[SEP] identifier[length] operator[&&] identifier[flag] operator[==] Other[0] operator[SEP] identifier[u] operator[++] operator[SEP] {
Keyword[int] identifier[tr] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[t] operator[-] identifier[u] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastTr] operator[>=] Other[0] operator[&&] identifier[lastTr] operator[<] identifier[tr] operator[SEP] {
identifier[flag] operator[=] Other[1] operator[SEP]
}
Keyword[else] {
identifier[String] identifier[tTok] operator[=] identifier[tTokens] operator[SEP] identifier[t] operator[SEP] , identifier[uTok] operator[=] identifier[uTokens] operator[SEP] identifier[u] operator[SEP] operator[SEP] Keyword[double] identifier[innerScore] operator[=] identifier[tokenDistance] operator[SEP] identifier[score] operator[SEP] identifier[tTok] , identifier[uTok] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[innerScore] operator[>=] literal[Float] operator[SEP] {
Keyword[double] identifier[matched] operator[=] literal[Float] operator[SEP] Keyword[if] operator[SEP] identifier[innerScore] operator[==] literal[Float] operator[SEP] {
identifier[matched] operator[=] identifier[tTokens] operator[SEP] identifier[t] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[matched] operator[=] operator[SEP] operator[SEP] identifier[TagLinkToken] operator[SEP] identifier[tokenDistance] operator[SEP] operator[SEP] identifier[getMatched] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[double] identifier[weightMatched] operator[=] identifier[matched] operator[/] identifier[minStringSize] , identifier[weightTFIDF] operator[=] identifier[tIdfArray] operator[SEP] identifier[t] operator[SEP] operator[*] identifier[uIdfArray] operator[SEP] identifier[u] operator[SEP] , identifier[weight] operator[=] operator[SEP] identifier[weightTFIDF] operator[+] identifier[weightMatched] operator[SEP] operator[/] literal[Float] operator[SEP] Keyword[if] operator[SEP] identifier[innerScore] operator[==] Other[1] operator[SEP] {
identifier[lastTr] operator[=] identifier[tr] operator[SEP]
}
identifier[candidateList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Candidates] operator[SEP] identifier[t] , identifier[u] , identifier[innerScore] operator[*] identifier[weight] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
Keyword[return] identifier[candidateList] operator[SEP]
}
|
public static WsByteBuffer allocateByteBuffer(int size, boolean allocateDirect) {
WsByteBuffer newBuffer = null;
// Allocate based on the input parameter.
if (allocateDirect) {
newBuffer = ChannelFrameworkFactory.getBufferManager().allocateDirect(size);
} else {
newBuffer = ChannelFrameworkFactory.getBufferManager().allocate(size);
}
// Shift the limit to the capacity to maximize the space available in the buffer.
newBuffer.limit(newBuffer.capacity());
return newBuffer;
} | class class_name[name] begin[{]
method[allocateByteBuffer, return_type[type[WsByteBuffer]], modifier[public static], parameter[size, allocateDirect]] begin[{]
local_variable[type[WsByteBuffer], newBuffer]
if[member[.allocateDirect]] begin[{]
assign[member[.newBuffer], call[ChannelFrameworkFactory.getBufferManager, parameter[]]]
else begin[{]
assign[member[.newBuffer], call[ChannelFrameworkFactory.getBufferManager, parameter[]]]
end[}]
call[newBuffer.limit, parameter[call[newBuffer.capacity, parameter[]]]]
return[member[.newBuffer]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[WsByteBuffer] identifier[allocateByteBuffer] operator[SEP] Keyword[int] identifier[size] , Keyword[boolean] identifier[allocateDirect] operator[SEP] {
identifier[WsByteBuffer] identifier[newBuffer] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[allocateDirect] operator[SEP] {
identifier[newBuffer] operator[=] identifier[ChannelFrameworkFactory] operator[SEP] identifier[getBufferManager] operator[SEP] operator[SEP] operator[SEP] identifier[allocateDirect] operator[SEP] identifier[size] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[newBuffer] operator[=] identifier[ChannelFrameworkFactory] operator[SEP] identifier[getBufferManager] operator[SEP] operator[SEP] operator[SEP] identifier[allocate] operator[SEP] identifier[size] operator[SEP] operator[SEP]
}
identifier[newBuffer] operator[SEP] identifier[limit] operator[SEP] identifier[newBuffer] operator[SEP] identifier[capacity] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[newBuffer] operator[SEP]
}
|
@Override
public SendObjectMessage recipients(Iterable<String> recipients) {
this.recipients.addAll(Sets.newHashSet(recipients));
return this;
} | class class_name[name] begin[{]
method[recipients, return_type[type[SendObjectMessage]], modifier[public], parameter[recipients]] begin[{]
THIS[member[None.recipients]call[None.addAll, parameter[call[Sets.newHashSet, parameter[member[.recipients]]]]]]
return[THIS[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[SendObjectMessage] identifier[recipients] operator[SEP] identifier[Iterable] operator[<] identifier[String] operator[>] identifier[recipients] operator[SEP] {
Keyword[this] operator[SEP] identifier[recipients] operator[SEP] identifier[addAll] operator[SEP] identifier[Sets] operator[SEP] identifier[newHashSet] operator[SEP] identifier[recipients] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public <T extends RestTemplate> T build(Class<T> restTemplateClass) {
return configure(BeanUtils.instantiateClass(restTemplateClass));
} | class class_name[name] begin[{]
method[build, return_type[type[T]], modifier[public], parameter[restTemplateClass]] begin[{]
return[call[.configure, parameter[call[BeanUtils.instantiateClass, parameter[member[.restTemplateClass]]]]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[RestTemplate] operator[>] identifier[T] identifier[build] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[restTemplateClass] operator[SEP] {
Keyword[return] identifier[configure] operator[SEP] identifier[BeanUtils] operator[SEP] identifier[instantiateClass] operator[SEP] identifier[restTemplateClass] operator[SEP] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("unchecked")
private void doMessage(final JsonObject message) {
Object value = deserializer.deserialize(message);
if (value != null && messageHandler != null) {
if (log.isDebugEnabled()) {
log.debug(String.format("%s - Received: Message[id=%d, value=%s]", this, message.getLong("id"), value));
}
messageHandler.handle(value);
}
for (InputHook hook : hooks) {
hook.handleReceive(value);
}
} | class class_name[name] begin[{]
method[doMessage, return_type[void], modifier[private], parameter[message]] begin[{]
local_variable[type[Object], value]
if[binary_operation[binary_operation[member[.value], !=, literal[null]], &&, binary_operation[member[.messageHandler], !=, literal[null]]]] begin[{]
if[call[log.isDebugEnabled, parameter[]]] begin[{]
call[log.debug, parameter[call[String.format, parameter[literal["%s - Received: Message[id=%d, value=%s]"], THIS[], call[message.getLong, parameter[literal["id"]]], member[.value]]]]]
else begin[{]
None
end[}]
call[messageHandler.handle, parameter[member[.value]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleReceive, postfix_operators=[], prefix_operators=[], qualifier=hook, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=hooks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=hook)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputHook, sub_type=None))), label=None)
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[void] identifier[doMessage] operator[SEP] Keyword[final] identifier[JsonObject] identifier[message] operator[SEP] {
identifier[Object] identifier[value] operator[=] identifier[deserializer] operator[SEP] identifier[deserialize] operator[SEP] identifier[message] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[&&] identifier[messageHandler] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[this] , identifier[message] operator[SEP] identifier[getLong] operator[SEP] literal[String] operator[SEP] , identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
identifier[messageHandler] operator[SEP] identifier[handle] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[InputHook] identifier[hook] operator[:] identifier[hooks] operator[SEP] {
identifier[hook] operator[SEP] identifier[handleReceive] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
|
public void close() throws OpenViduJavaClientException, OpenViduHttpException {
HttpDelete request = new HttpDelete(OpenVidu.urlOpenViduServer + OpenVidu.API_SESSIONS + "/" + this.sessionId);
request.setHeader(HttpHeaders.CONTENT_TYPE, "application/x-www-form-urlencoded");
HttpResponse response;
try {
response = OpenVidu.httpClient.execute(request);
} catch (IOException e) {
throw new OpenViduJavaClientException(e.getMessage(), e.getCause());
}
try {
int statusCode = response.getStatusLine().getStatusCode();
if ((statusCode == org.apache.http.HttpStatus.SC_NO_CONTENT)) {
OpenVidu.activeSessions.remove(this.sessionId);
log.info("Session {} closed", this.sessionId);
} else {
throw new OpenViduHttpException(statusCode);
}
} finally {
EntityUtils.consumeQuietly(response.getEntity());
}
} | class class_name[name] begin[{]
method[close, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[HttpDelete], request]
call[request.setHeader, parameter[member[HttpHeaders.CONTENT_TYPE], literal["application/x-www-form-urlencoded"]]]
local_variable[type[HttpResponse], response]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=OpenVidu.httpClient, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OpenViduJavaClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getStatusLine, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[MethodInvocation(arguments=[], member=getStatusCode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=statusCode)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=statusCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SC_NO_CONTENT, postfix_operators=[], prefix_operators=[], qualifier=org.apache.http.HttpStatus, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=statusCode, 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=OpenViduHttpException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sessionId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=OpenVidu.activeSessions, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Session {} closed"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sessionId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEntity, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None)], member=consumeQuietly, postfix_operators=[], prefix_operators=[], qualifier=EntityUtils, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] Keyword[throws] identifier[OpenViduJavaClientException] , identifier[OpenViduHttpException] {
identifier[HttpDelete] identifier[request] operator[=] Keyword[new] identifier[HttpDelete] operator[SEP] identifier[OpenVidu] operator[SEP] identifier[urlOpenViduServer] operator[+] identifier[OpenVidu] operator[SEP] identifier[API_SESSIONS] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setHeader] operator[SEP] identifier[HttpHeaders] operator[SEP] identifier[CONTENT_TYPE] , literal[String] operator[SEP] operator[SEP] identifier[HttpResponse] identifier[response] operator[SEP] Keyword[try] {
identifier[response] operator[=] identifier[OpenVidu] operator[SEP] identifier[httpClient] operator[SEP] identifier[execute] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[OpenViduJavaClientException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[try] {
Keyword[int] identifier[statusCode] operator[=] identifier[response] operator[SEP] identifier[getStatusLine] operator[SEP] operator[SEP] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[statusCode] operator[==] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[http] operator[SEP] identifier[HttpStatus] operator[SEP] identifier[SC_NO_CONTENT] operator[SEP] operator[SEP] {
identifier[OpenVidu] operator[SEP] identifier[activeSessions] operator[SEP] identifier[remove] operator[SEP] Keyword[this] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[OpenViduHttpException] operator[SEP] identifier[statusCode] operator[SEP] operator[SEP]
}
}
Keyword[finally] {
identifier[EntityUtils] operator[SEP] identifier[consumeQuietly] operator[SEP] identifier[response] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static void forceDelete(File file) {
if (file.exists()) {
// If the File instance to delete is a directory, delete all it's
// contents.
if (file.isDirectory()) {
for (File contentFile : file.listFiles()) {
forceDelete(contentFile);
}
}
if (file.delete()) {
log.d("File " + file.getPath() + " was succesfully deleted.");
} else {
log.w("File " + file.getPath() + " couldn't be deleted.");
}
}
} | class class_name[name] begin[{]
method[forceDelete, return_type[void], modifier[public static], parameter[file]] begin[{]
if[call[file.exists, parameter[]]] begin[{]
if[call[file.isDirectory, parameter[]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=contentFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forceDelete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=listFiles, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=contentFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None)
else begin[{]
None
end[}]
if[call[file.delete, parameter[]]] begin[{]
call[log.d, parameter[binary_operation[binary_operation[literal["File "], +, call[file.getPath, parameter[]]], +, literal[" was succesfully deleted."]]]]
else begin[{]
call[log.w, parameter[binary_operation[binary_operation[literal["File "], +, call[file.getPath, parameter[]]], +, literal[" couldn't be deleted."]]]]
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[forceDelete] operator[SEP] identifier[File] identifier[file] operator[SEP] {
Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[File] identifier[contentFile] operator[:] identifier[file] operator[SEP] identifier[listFiles] operator[SEP] operator[SEP] operator[SEP] {
identifier[forceDelete] operator[SEP] identifier[contentFile] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[d] operator[SEP] literal[String] operator[+] identifier[file] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[log] operator[SEP] identifier[w] operator[SEP] literal[String] operator[+] identifier[file] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
}
|
public TopicRecord retrieveCallbackFromConnectionIndex(
ConnectionImpl connection,
ConsumerSetChangeCallback callback)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"retrieveCallbackFromConnectionIndex",
new Object[] {connection, callback });
TopicRecord tRecord = null;
if(_callbackIndex.containsKey(connection))
{
// Have found registered callbacks for this connection
Map connMap = (HashMap)_callbackIndex.get(connection);
// Locate the specific callback
tRecord = (TopicRecord)connMap.get(callback);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "retrieveCallbackFromConnectionIndex", tRecord);
return tRecord;
} | class class_name[name] begin[{]
method[retrieveCallbackFromConnectionIndex, return_type[type[TopicRecord]], modifier[public], parameter[connection, callback]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["retrieveCallbackFromConnectionIndex"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=callback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
else begin[{]
None
end[}]
local_variable[type[TopicRecord], tRecord]
if[call[_callbackIndex.containsKey, parameter[member[.connection]]]] begin[{]
local_variable[type[Map], connMap]
assign[member[.tRecord], Cast(expression=MethodInvocation(arguments=[MemberReference(member=callback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=connMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=TopicRecord, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["retrieveCallbackFromConnectionIndex"], member[.tRecord]]]
else begin[{]
None
end[}]
return[member[.tRecord]]
end[}]
END[}] | Keyword[public] identifier[TopicRecord] identifier[retrieveCallbackFromConnectionIndex] operator[SEP] identifier[ConnectionImpl] identifier[connection] , identifier[ConsumerSetChangeCallback] identifier[callback] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[connection] , identifier[callback]
} operator[SEP] operator[SEP] identifier[TopicRecord] identifier[tRecord] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[_callbackIndex] operator[SEP] identifier[containsKey] operator[SEP] identifier[connection] operator[SEP] operator[SEP] {
identifier[Map] identifier[connMap] operator[=] operator[SEP] identifier[HashMap] operator[SEP] identifier[_callbackIndex] operator[SEP] identifier[get] operator[SEP] identifier[connection] operator[SEP] operator[SEP] identifier[tRecord] operator[=] operator[SEP] identifier[TopicRecord] operator[SEP] identifier[connMap] operator[SEP] identifier[get] operator[SEP] identifier[callback] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[tRecord] operator[SEP] operator[SEP] Keyword[return] identifier[tRecord] operator[SEP]
}
|
protected void resize(int newCapacity) {
parent = Arrays.copyOf(parent, newCapacity);
left = Arrays.copyOf(left, newCapacity);
right = Arrays.copyOf(right, newCapacity);
depth = Arrays.copyOf(depth, newCapacity);
} | class class_name[name] begin[{]
method[resize, return_type[void], modifier[protected], parameter[newCapacity]] begin[{]
assign[member[.parent], call[Arrays.copyOf, parameter[member[.parent], member[.newCapacity]]]]
assign[member[.left], call[Arrays.copyOf, parameter[member[.left], member[.newCapacity]]]]
assign[member[.right], call[Arrays.copyOf, parameter[member[.right], member[.newCapacity]]]]
assign[member[.depth], call[Arrays.copyOf, parameter[member[.depth], member[.newCapacity]]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[resize] operator[SEP] Keyword[int] identifier[newCapacity] operator[SEP] {
identifier[parent] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] identifier[parent] , identifier[newCapacity] operator[SEP] operator[SEP] identifier[left] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] identifier[left] , identifier[newCapacity] operator[SEP] operator[SEP] identifier[right] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] identifier[right] , identifier[newCapacity] operator[SEP] operator[SEP] identifier[depth] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] identifier[depth] , identifier[newCapacity] operator[SEP] operator[SEP]
}
|
@Override
public String getTemplateURI(GroovyObject controller, String templateName) {
return getTemplateURI(getLogicalControllerName(controller), templateName);
} | class class_name[name] begin[{]
method[getTemplateURI, return_type[type[String]], modifier[public], parameter[controller, templateName]] begin[{]
return[call[.getTemplateURI, parameter[call[.getLogicalControllerName, parameter[member[.controller]]], member[.templateName]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getTemplateURI] operator[SEP] identifier[GroovyObject] identifier[controller] , identifier[String] identifier[templateName] operator[SEP] {
Keyword[return] identifier[getTemplateURI] operator[SEP] identifier[getLogicalControllerName] operator[SEP] identifier[controller] operator[SEP] , identifier[templateName] operator[SEP] operator[SEP]
}
|
public void insert( int index , int value ) {
if( size == data.length ) {
int temp[] = new int[ size * 2];
System.arraycopy(data,0,temp,0,index);
temp[index] = value;
System.arraycopy(data,index,temp,index+1,size-index);
this.data = temp;
size++;
} else {
size++;
for( int i = size-1; i > index; i-- ) {
data[i] = data[i-1];
}
data[index] = value;
}
} | class class_name[name] begin[{]
method[insert, return_type[void], modifier[public], parameter[index, value]] begin[{]
if[binary_operation[member[.size], ==, member[data.length]]] begin[{]
local_variable[type[int], temp]
call[System.arraycopy, parameter[member[.data], literal[0], member[.temp], literal[0], member[.index]]]
assign[member[.temp], member[.value]]
call[System.arraycopy, parameter[member[.data], member[.index], member[.temp], binary_operation[member[.index], +, literal[1]], binary_operation[member[.size], -, member[.index]]]]
assign[THIS[member[None.data]], member[.temp]]
member[.size]
else begin[{]
member[.size]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=size, 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)
assign[member[.data], member[.value]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[insert] operator[SEP] Keyword[int] identifier[index] , Keyword[int] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[size] operator[==] identifier[data] operator[SEP] identifier[length] operator[SEP] {
Keyword[int] identifier[temp] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[size] operator[*] Other[2] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[data] , Other[0] , identifier[temp] , Other[0] , identifier[index] operator[SEP] operator[SEP] identifier[temp] operator[SEP] identifier[index] operator[SEP] operator[=] identifier[value] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[data] , identifier[index] , identifier[temp] , identifier[index] operator[+] Other[1] , identifier[size] operator[-] identifier[index] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[data] operator[=] identifier[temp] operator[SEP] identifier[size] operator[++] operator[SEP]
}
Keyword[else] {
identifier[size] operator[++] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[size] operator[-] Other[1] operator[SEP] identifier[i] operator[>] identifier[index] operator[SEP] identifier[i] operator[--] operator[SEP] {
identifier[data] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[data] operator[SEP] identifier[i] operator[-] Other[1] operator[SEP] operator[SEP]
}
identifier[data] operator[SEP] identifier[index] operator[SEP] operator[=] identifier[value] operator[SEP]
}
}
|
public Object execute(final Object dataIn) throws DevFailed {
xlogger.entry(name);
Object result;
try {
result = behavior.execute(dataIn);
} catch (final DevFailed e) {
lastError = e;
throw e;
}
xlogger.exit(name);
return result;
} | class class_name[name] begin[{]
method[execute, return_type[type[Object]], modifier[public], parameter[dataIn]] begin[{]
call[xlogger.entry, parameter[member[.name]]]
local_variable[type[Object], result]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=dataIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=behavior, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DevFailed']))], finally_block=None, label=None, resources=None)
call[xlogger.exit, parameter[member[.name]]]
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[execute] operator[SEP] Keyword[final] identifier[Object] identifier[dataIn] operator[SEP] Keyword[throws] identifier[DevFailed] {
identifier[xlogger] operator[SEP] identifier[entry] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[Object] identifier[result] operator[SEP] Keyword[try] {
identifier[result] operator[=] identifier[behavior] operator[SEP] identifier[execute] operator[SEP] identifier[dataIn] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[DevFailed] identifier[e] operator[SEP] {
identifier[lastError] operator[=] identifier[e] operator[SEP] Keyword[throw] identifier[e] operator[SEP]
}
identifier[xlogger] operator[SEP] identifier[exit] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
@Override
public Long decrBy(final byte[] key, final long decrement) {
checkIsInMultiOrPipeline();
client.decrBy(key, decrement);
return client.getIntegerReply();
} | class class_name[name] begin[{]
method[decrBy, return_type[type[Long]], modifier[public], parameter[key, decrement]] begin[{]
call[.checkIsInMultiOrPipeline, parameter[]]
call[client.decrBy, parameter[member[.key], member[.decrement]]]
return[call[client.getIntegerReply, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Long] identifier[decrBy] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[key] , Keyword[final] Keyword[long] identifier[decrement] operator[SEP] {
identifier[checkIsInMultiOrPipeline] operator[SEP] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[decrBy] operator[SEP] identifier[key] , identifier[decrement] operator[SEP] operator[SEP] Keyword[return] identifier[client] operator[SEP] identifier[getIntegerReply] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String concatPathAndFilename(final String path, final String filename, final String separator) {
checkNotNull("filename", filename);
checkNotNull("separator", separator);
checkNotEmpty("separator", separator);
if (path == null) {
return filename;
}
final String trimmedPath = path.trim();
if (trimmedPath.length() == 0) {
return filename;
}
final String trimmedFilename = filename.trim();
if (trimmedPath.endsWith(separator)) {
return trimmedPath + trimmedFilename;
}
return trimmedPath + separator + trimmedFilename;
} | class class_name[name] begin[{]
method[concatPathAndFilename, return_type[type[String]], modifier[public static], parameter[path, filename, separator]] begin[{]
call[.checkNotNull, parameter[literal["filename"], member[.filename]]]
call[.checkNotNull, parameter[literal["separator"], member[.separator]]]
call[.checkNotEmpty, parameter[literal["separator"], member[.separator]]]
if[binary_operation[member[.path], ==, literal[null]]] begin[{]
return[member[.filename]]
else begin[{]
None
end[}]
local_variable[type[String], trimmedPath]
if[binary_operation[call[trimmedPath.length, parameter[]], ==, literal[0]]] begin[{]
return[member[.filename]]
else begin[{]
None
end[}]
local_variable[type[String], trimmedFilename]
if[call[trimmedPath.endsWith, parameter[member[.separator]]]] begin[{]
return[binary_operation[member[.trimmedPath], +, member[.trimmedFilename]]]
else begin[{]
None
end[}]
return[binary_operation[binary_operation[member[.trimmedPath], +, member[.separator]], +, member[.trimmedFilename]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[concatPathAndFilename] operator[SEP] Keyword[final] identifier[String] identifier[path] , Keyword[final] identifier[String] identifier[filename] , Keyword[final] identifier[String] identifier[separator] operator[SEP] {
identifier[checkNotNull] operator[SEP] literal[String] , identifier[filename] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] literal[String] , identifier[separator] operator[SEP] operator[SEP] identifier[checkNotEmpty] operator[SEP] literal[String] , identifier[separator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[filename] operator[SEP]
}
Keyword[final] identifier[String] identifier[trimmedPath] operator[=] identifier[path] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trimmedPath] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[return] identifier[filename] operator[SEP]
}
Keyword[final] identifier[String] identifier[trimmedFilename] operator[=] identifier[filename] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trimmedPath] operator[SEP] identifier[endsWith] operator[SEP] identifier[separator] operator[SEP] operator[SEP] {
Keyword[return] identifier[trimmedPath] operator[+] identifier[trimmedFilename] operator[SEP]
}
Keyword[return] identifier[trimmedPath] operator[+] identifier[separator] operator[+] identifier[trimmedFilename] operator[SEP]
}
|
public int compare(Point2D other) {
return y < other.y ? -1 : (y > other.y ? 1 : (x < other.x ? -1
: (x > other.x ? 1 : 0)));
} | class class_name[name] begin[{]
method[compare, return_type[type[int]], modifier[public], parameter[other]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), operator=<), if_false=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), operator=>), if_false=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), operator=<), if_false=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), operator=>), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), if_true=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), if_true=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1))]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[compare] operator[SEP] identifier[Point2D] identifier[other] operator[SEP] {
Keyword[return] identifier[y] operator[<] identifier[other] operator[SEP] identifier[y] operator[?] operator[-] Other[1] operator[:] operator[SEP] identifier[y] operator[>] identifier[other] operator[SEP] identifier[y] operator[?] Other[1] operator[:] operator[SEP] identifier[x] operator[<] identifier[other] operator[SEP] identifier[x] operator[?] operator[-] Other[1] operator[:] operator[SEP] identifier[x] operator[>] identifier[other] operator[SEP] identifier[x] operator[?] Other[1] operator[:] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public OutlierResult run(Relation<V> relation) {
final DBIDs ids = relation.getDBIDs();
KNNQuery<V> knnQuery = QueryUtil.getKNNQuery(relation, getDistanceFunction(), k + 1);
final int dim = RelationUtil.dimensionality(relation);
if(k <= dim + 1) {
LOG.warning("PCA is underspecified with a too low k! k should be at much larger than " + dim);
}
WritableDoubleDataStore cop_score = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_STATIC);
WritableDataStore<double[]> cop_err_v = models ? DataStoreUtil.makeStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_STATIC, double[].class) : null;
WritableIntegerDataStore cop_dim = models ? DataStoreUtil.makeIntegerStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_STATIC, -1) : null;
// compute neighbors of each db object
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Correlation Outlier Probabilities", relation.size(), LOG) : null;
double[] centroid = new double[dim];
double[] scores = new double[dim];
ModifiableDBIDs nids = DBIDUtil.newHashSet(k + 10);
for(DBIDIter id = ids.iter(); id.valid(); id.advance()) {
nids.clear();
nids.addDBIDs(knnQuery.getKNNForDBID(id, k + 1));
nids.remove(id); // Do not use query object
computeCentroid(centroid, relation, nids);
PCAResult pcares = pca.processIds(nids, relation);
double[][] tevecs = pcares.getEigenvectors();
double[] evs = pcares.getEigenvalues();
double[] projected = times(tevecs, minusEquals(relation.get(id).toArray(), centroid));
if(dist == DistanceDist.CHISQUARED) {
double sqdevs = 0;
for(int d = 0; d < dim; d++) {
double dev = projected[d];
// Scale with variance and accumulate
sqdevs += dev * dev / evs[d];
scores[d] = 1 - ChiSquaredDistribution.cdf(sqdevs, d + 1);
}
}
else {
assert (dist == DistanceDist.GAMMA);
double[][] dists = new double[dim][nids.size()];
int j = 0;
double[] srel = new double[dim];
for(DBIDIter s = nids.iter(); s.valid() && j < nids.size(); s.advance(), j++) {
V vec = relation.get(s);
for(int d = 0; d < dim; d++) {
srel[d] = vec.doubleValue(d) - centroid[d];
}
double sqdist = 0.0;
for(int d = 0; d < dim; d++) {
double serrd = transposeTimes(tevecs[d], srel);
dists[d][j] = (sqdist += serrd * serrd / evs[d]);
}
}
double sqdevs = 0;
for(int d = 0; d < dim; d++) {
// Scale with Stddev
final double dev = projected[d];
// Accumulate
sqdevs += dev * dev / evs[d];
// Sort, so we can trim the top 15% below.
Arrays.sort(dists[d]);
// Evaluate
scores[d] = 1 - GammaChoiWetteEstimator.STATIC.estimate(dists[d], SHORTENED_ARRAY).cdf(sqdevs);
}
}
// Find best score
double min = Double.POSITIVE_INFINITY;
int vdim = dim - 1;
for(int d = 0; d < dim; d++) {
double v = scores[d];
if(v < min) {
min = v;
vdim = d;
}
}
// Normalize the value
final double prob = expect * (1 - min) / (expect + min);
cop_score.putDouble(id, prob);
if(models) {
// Construct the error vector:
Arrays.fill(projected, vdim + 1, dim, 0.);
cop_err_v.put(id, timesEquals(transposeTimes(tevecs, projected), -prob));
cop_dim.putInt(id, dim - vdim);
}
LOG.incrementProcessed(prog);
}
LOG.ensureCompleted(prog);
// combine results.
DoubleRelation scoreResult = new MaterializedDoubleRelation("Correlation Outlier Probabilities", COP_SCORES, cop_score, ids);
OutlierScoreMeta scoreMeta = new ProbabilisticOutlierScore();
OutlierResult result = new OutlierResult(scoreMeta, scoreResult);
if(models) {
result.addChildResult(new MaterializedRelation<>("Local Dimensionality", COP_DIM, TypeUtil.INTEGER, cop_dim, ids));
result.addChildResult(new MaterializedRelation<>("Error vectors", COP_ERRORVEC, TypeUtil.DOUBLE_ARRAY, cop_err_v, ids));
}
return result;
} | class class_name[name] begin[{]
method[run, return_type[type[OutlierResult]], modifier[public], parameter[relation]] begin[{]
local_variable[type[DBIDs], ids]
local_variable[type[KNNQuery], knnQuery]
local_variable[type[int], dim]
if[binary_operation[member[.k], <=, binary_operation[member[.dim], +, literal[1]]]] begin[{]
call[LOG.warning, parameter[binary_operation[literal["PCA is underspecified with a too low k! k should be at much larger than "], +, member[.dim]]]]
else begin[{]
None
end[}]
local_variable[type[WritableDoubleDataStore], cop_score]
local_variable[type[WritableDataStore], cop_err_v]
local_variable[type[WritableIntegerDataStore], cop_dim]
local_variable[type[FiniteProgress], prog]
local_variable[type[double], centroid]
local_variable[type[double], scores]
local_variable[type[ModifiableDBIDs], nids]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=nids, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=getKNNForDBID, postfix_operators=[], prefix_operators=[], qualifier=knnQuery, selectors=[], type_arguments=None)], member=addDBIDs, postfix_operators=[], prefix_operators=[], qualifier=nids, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=nids, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=centroid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=relation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=computeCentroid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=nids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=relation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processIds, postfix_operators=[], prefix_operators=[], qualifier=pca, selectors=[], type_arguments=None), name=pcares)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PCAResult, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEigenvectors, postfix_operators=[], prefix_operators=[], qualifier=pcares, selectors=[], type_arguments=None), name=tevecs)], modifiers=set(), type=BasicType(dimensions=[None, None], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEigenvalues, postfix_operators=[], prefix_operators=[], qualifier=pcares, selectors=[], type_arguments=None), name=evs)], modifiers=set(), type=BasicType(dimensions=[None], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=tevecs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=relation, selectors=[MethodInvocation(arguments=[], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=centroid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=minusEquals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=times, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=projected)], modifiers=set(), type=BasicType(dimensions=[None], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=CHISQUARED, postfix_operators=[], prefix_operators=[], qualifier=DistanceDist, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=GAMMA, postfix_operators=[], prefix_operators=[], qualifier=DistanceDist, selectors=[]), operator===), label=None, value=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=nids, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double)), name=dists)], modifiers=set(), type=BasicType(dimensions=[None, None], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double)), name=srel)], modifiers=set(), type=BasicType(dimensions=[None], name=double)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=relation, selectors=[], type_arguments=None), name=vec)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=srel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=vec, selectors=[], type_arguments=None), operandr=MemberReference(member=centroid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=-)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dim, 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=d)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0), name=sqdist)], modifiers=set(), type=BasicType(dimensions=[], name=double)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=tevecs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=srel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transposeTimes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=serrd)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dists, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Assignment(expressionl=MemberReference(member=sqdist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=serrd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=serrd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=evs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=/))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dim, 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=d)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=valid, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=nids, selectors=[], type_arguments=None), operator=<), operator=&&), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iter, postfix_operators=[], prefix_operators=[], qualifier=nids, selectors=[], type_arguments=None), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DBIDIter, sub_type=None)), update=[MethodInvocation(arguments=[], member=advance, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=sqdevs)], modifiers=set(), type=BasicType(dimensions=[], name=double)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=projected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=dev)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sqdevs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=dev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=evs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=/)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dists, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=sort, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=scores, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MethodInvocation(arguments=[MemberReference(member=dists, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=SHORTENED_ARRAY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=estimate, postfix_operators=[], prefix_operators=[], qualifier=GammaChoiWetteEstimator.STATIC, selectors=[MethodInvocation(arguments=[MemberReference(member=sqdevs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cdf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=-)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dim, 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=d)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=sqdevs)], modifiers=set(), type=BasicType(dimensions=[], name=double)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=projected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=dev)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sqdevs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=dev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=evs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=/)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=scores, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MethodInvocation(arguments=[MemberReference(member=sqdevs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=cdf, postfix_operators=[], prefix_operators=[], qualifier=ChiSquaredDistribution, selectors=[], type_arguments=None), operator=-)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dim, 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=d)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=POSITIVE_INFINITY, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[]), name=min)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=vdim)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=scores, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=v)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=vdim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dim, 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=d)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=expect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=expect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operator=/), name=prob)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prob, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putDouble, postfix_operators=[], prefix_operators=[], qualifier=cop_score, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=models, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=projected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=vdim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.)], member=fill, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=tevecs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=projected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transposeTimes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=prob, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[])], member=timesEquals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=cop_err_v, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=vdim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=putInt, postfix_operators=[], prefix_operators=[], qualifier=cop_dim, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=incrementProcessed, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=valid, postfix_operators=[], prefix_operators=[], qualifier=id, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iter, postfix_operators=[], prefix_operators=[], qualifier=ids, selectors=[], type_arguments=None), name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DBIDIter, sub_type=None)), update=[MethodInvocation(arguments=[], member=advance, postfix_operators=[], prefix_operators=[], qualifier=id, selectors=[], type_arguments=None)]), label=None)
call[LOG.ensureCompleted, parameter[member[.prog]]]
local_variable[type[DoubleRelation], scoreResult]
local_variable[type[OutlierScoreMeta], scoreMeta]
local_variable[type[OutlierResult], result]
if[member[.models]] begin[{]
call[result.addChildResult, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Local Dimensionality"), MemberReference(member=COP_DIM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=INTEGER, postfix_operators=[], prefix_operators=[], qualifier=TypeUtil, selectors=[]), MemberReference(member=cop_dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ids, 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=MaterializedRelation, sub_type=None))]]
call[result.addChildResult, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error vectors"), MemberReference(member=COP_ERRORVEC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DOUBLE_ARRAY, postfix_operators=[], prefix_operators=[], qualifier=TypeUtil, selectors=[]), MemberReference(member=cop_err_v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ids, 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=MaterializedRelation, sub_type=None))]]
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[OutlierResult] identifier[run] operator[SEP] identifier[Relation] operator[<] identifier[V] operator[>] identifier[relation] operator[SEP] {
Keyword[final] identifier[DBIDs] identifier[ids] operator[=] identifier[relation] operator[SEP] identifier[getDBIDs] operator[SEP] operator[SEP] operator[SEP] identifier[KNNQuery] operator[<] identifier[V] operator[>] identifier[knnQuery] operator[=] identifier[QueryUtil] operator[SEP] identifier[getKNNQuery] operator[SEP] identifier[relation] , identifier[getDistanceFunction] operator[SEP] operator[SEP] , identifier[k] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[dim] operator[=] identifier[RelationUtil] operator[SEP] identifier[dimensionality] operator[SEP] identifier[relation] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[k] operator[<=] identifier[dim] operator[+] Other[1] operator[SEP] {
identifier[LOG] operator[SEP] identifier[warning] operator[SEP] literal[String] operator[+] identifier[dim] operator[SEP] operator[SEP]
}
identifier[WritableDoubleDataStore] identifier[cop_score] operator[=] identifier[DataStoreUtil] operator[SEP] identifier[makeDoubleStorage] operator[SEP] identifier[ids] , identifier[DataStoreFactory] operator[SEP] identifier[HINT_HOT] operator[|] identifier[DataStoreFactory] operator[SEP] identifier[HINT_STATIC] operator[SEP] operator[SEP] identifier[WritableDataStore] operator[<] Keyword[double] operator[SEP] operator[SEP] operator[>] identifier[cop_err_v] operator[=] identifier[models] operator[?] identifier[DataStoreUtil] operator[SEP] identifier[makeStorage] operator[SEP] identifier[ids] , identifier[DataStoreFactory] operator[SEP] identifier[HINT_HOT] operator[|] identifier[DataStoreFactory] operator[SEP] identifier[HINT_STATIC] , Keyword[double] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[:] Other[null] operator[SEP] identifier[WritableIntegerDataStore] identifier[cop_dim] operator[=] identifier[models] operator[?] identifier[DataStoreUtil] operator[SEP] identifier[makeIntegerStorage] operator[SEP] identifier[ids] , identifier[DataStoreFactory] operator[SEP] identifier[HINT_HOT] operator[|] identifier[DataStoreFactory] operator[SEP] identifier[HINT_STATIC] , operator[-] Other[1] operator[SEP] operator[:] Other[null] operator[SEP] identifier[FiniteProgress] identifier[prog] operator[=] identifier[LOG] operator[SEP] identifier[isVerbose] operator[SEP] operator[SEP] operator[?] Keyword[new] identifier[FiniteProgress] operator[SEP] literal[String] , identifier[relation] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[LOG] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[centroid] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[dim] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[scores] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[dim] operator[SEP] operator[SEP] identifier[ModifiableDBIDs] identifier[nids] operator[=] identifier[DBIDUtil] operator[SEP] identifier[newHashSet] operator[SEP] identifier[k] operator[+] Other[10] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DBIDIter] identifier[id] operator[=] identifier[ids] operator[SEP] identifier[iter] operator[SEP] operator[SEP] operator[SEP] identifier[id] operator[SEP] identifier[valid] operator[SEP] operator[SEP] operator[SEP] identifier[id] operator[SEP] identifier[advance] operator[SEP] operator[SEP] operator[SEP] {
identifier[nids] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[nids] operator[SEP] identifier[addDBIDs] operator[SEP] identifier[knnQuery] operator[SEP] identifier[getKNNForDBID] operator[SEP] identifier[id] , identifier[k] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[nids] operator[SEP] identifier[remove] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[computeCentroid] operator[SEP] identifier[centroid] , identifier[relation] , identifier[nids] operator[SEP] operator[SEP] identifier[PCAResult] identifier[pcares] operator[=] identifier[pca] operator[SEP] identifier[processIds] operator[SEP] identifier[nids] , identifier[relation] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tevecs] operator[=] identifier[pcares] operator[SEP] identifier[getEigenvectors] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[evs] operator[=] identifier[pcares] operator[SEP] identifier[getEigenvalues] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[projected] operator[=] identifier[times] operator[SEP] identifier[tevecs] , identifier[minusEquals] operator[SEP] identifier[relation] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] , identifier[centroid] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dist] operator[==] identifier[DistanceDist] operator[SEP] identifier[CHISQUARED] operator[SEP] {
Keyword[double] identifier[sqdevs] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[d] operator[=] Other[0] operator[SEP] identifier[d] operator[<] identifier[dim] operator[SEP] identifier[d] operator[++] operator[SEP] {
Keyword[double] identifier[dev] operator[=] identifier[projected] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[sqdevs] operator[+=] identifier[dev] operator[*] identifier[dev] operator[/] identifier[evs] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[scores] operator[SEP] identifier[d] operator[SEP] operator[=] Other[1] operator[-] identifier[ChiSquaredDistribution] operator[SEP] identifier[cdf] operator[SEP] identifier[sqdevs] , identifier[d] operator[+] Other[1] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[assert] operator[SEP] identifier[dist] operator[==] identifier[DistanceDist] operator[SEP] identifier[GAMMA] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dists] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[dim] operator[SEP] operator[SEP] identifier[nids] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[srel] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[dim] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DBIDIter] identifier[s] operator[=] identifier[nids] operator[SEP] identifier[iter] operator[SEP] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[valid] operator[SEP] operator[SEP] operator[&&] identifier[j] operator[<] identifier[nids] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[advance] operator[SEP] operator[SEP] , identifier[j] operator[++] operator[SEP] {
identifier[V] identifier[vec] operator[=] identifier[relation] operator[SEP] identifier[get] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[d] operator[=] Other[0] operator[SEP] identifier[d] operator[<] identifier[dim] operator[SEP] identifier[d] operator[++] operator[SEP] {
identifier[srel] operator[SEP] identifier[d] operator[SEP] operator[=] identifier[vec] operator[SEP] identifier[doubleValue] operator[SEP] identifier[d] operator[SEP] operator[-] identifier[centroid] operator[SEP] identifier[d] operator[SEP] operator[SEP]
}
Keyword[double] identifier[sqdist] operator[=] literal[Float] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[d] operator[=] Other[0] operator[SEP] identifier[d] operator[<] identifier[dim] operator[SEP] identifier[d] operator[++] operator[SEP] {
Keyword[double] identifier[serrd] operator[=] identifier[transposeTimes] operator[SEP] identifier[tevecs] operator[SEP] identifier[d] operator[SEP] , identifier[srel] operator[SEP] operator[SEP] identifier[dists] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[=] operator[SEP] identifier[sqdist] operator[+=] identifier[serrd] operator[*] identifier[serrd] operator[/] identifier[evs] operator[SEP] identifier[d] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[double] identifier[sqdevs] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[d] operator[=] Other[0] operator[SEP] identifier[d] operator[<] identifier[dim] operator[SEP] identifier[d] operator[++] operator[SEP] {
Keyword[final] Keyword[double] identifier[dev] operator[=] identifier[projected] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[sqdevs] operator[+=] identifier[dev] operator[*] identifier[dev] operator[/] identifier[evs] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[dists] operator[SEP] identifier[d] operator[SEP] operator[SEP] operator[SEP] identifier[scores] operator[SEP] identifier[d] operator[SEP] operator[=] Other[1] operator[-] identifier[GammaChoiWetteEstimator] operator[SEP] identifier[STATIC] operator[SEP] identifier[estimate] operator[SEP] identifier[dists] operator[SEP] identifier[d] operator[SEP] , identifier[SHORTENED_ARRAY] operator[SEP] operator[SEP] identifier[cdf] operator[SEP] identifier[sqdevs] operator[SEP] operator[SEP]
}
}
Keyword[double] identifier[min] operator[=] identifier[Double] operator[SEP] identifier[POSITIVE_INFINITY] operator[SEP] Keyword[int] identifier[vdim] operator[=] identifier[dim] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[d] operator[=] Other[0] operator[SEP] identifier[d] operator[<] identifier[dim] operator[SEP] identifier[d] operator[++] operator[SEP] {
Keyword[double] identifier[v] operator[=] identifier[scores] operator[SEP] identifier[d] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[<] identifier[min] operator[SEP] {
identifier[min] operator[=] identifier[v] operator[SEP] identifier[vdim] operator[=] identifier[d] operator[SEP]
}
}
Keyword[final] Keyword[double] identifier[prob] operator[=] identifier[expect] operator[*] operator[SEP] Other[1] operator[-] identifier[min] operator[SEP] operator[/] operator[SEP] identifier[expect] operator[+] identifier[min] operator[SEP] operator[SEP] identifier[cop_score] operator[SEP] identifier[putDouble] operator[SEP] identifier[id] , identifier[prob] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[models] operator[SEP] {
identifier[Arrays] operator[SEP] identifier[fill] operator[SEP] identifier[projected] , identifier[vdim] operator[+] Other[1] , identifier[dim] , literal[Float] operator[SEP] operator[SEP] identifier[cop_err_v] operator[SEP] identifier[put] operator[SEP] identifier[id] , identifier[timesEquals] operator[SEP] identifier[transposeTimes] operator[SEP] identifier[tevecs] , identifier[projected] operator[SEP] , operator[-] identifier[prob] operator[SEP] operator[SEP] operator[SEP] identifier[cop_dim] operator[SEP] identifier[putInt] operator[SEP] identifier[id] , identifier[dim] operator[-] identifier[vdim] operator[SEP] operator[SEP]
}
identifier[LOG] operator[SEP] identifier[incrementProcessed] operator[SEP] identifier[prog] operator[SEP] operator[SEP]
}
identifier[LOG] operator[SEP] identifier[ensureCompleted] operator[SEP] identifier[prog] operator[SEP] operator[SEP] identifier[DoubleRelation] identifier[scoreResult] operator[=] Keyword[new] identifier[MaterializedDoubleRelation] operator[SEP] literal[String] , identifier[COP_SCORES] , identifier[cop_score] , identifier[ids] operator[SEP] operator[SEP] identifier[OutlierScoreMeta] identifier[scoreMeta] operator[=] Keyword[new] identifier[ProbabilisticOutlierScore] operator[SEP] operator[SEP] operator[SEP] identifier[OutlierResult] identifier[result] operator[=] Keyword[new] identifier[OutlierResult] operator[SEP] identifier[scoreMeta] , identifier[scoreResult] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[models] operator[SEP] {
identifier[result] operator[SEP] identifier[addChildResult] operator[SEP] Keyword[new] identifier[MaterializedRelation] operator[<] operator[>] operator[SEP] literal[String] , identifier[COP_DIM] , identifier[TypeUtil] operator[SEP] identifier[INTEGER] , identifier[cop_dim] , identifier[ids] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addChildResult] operator[SEP] Keyword[new] identifier[MaterializedRelation] operator[<] operator[>] operator[SEP] literal[String] , identifier[COP_ERRORVEC] , identifier[TypeUtil] operator[SEP] identifier[DOUBLE_ARRAY] , identifier[cop_err_v] , identifier[ids] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public void marshall(GetBulkPublishDetailsRequest getBulkPublishDetailsRequest, ProtocolMarshaller protocolMarshaller) {
if (getBulkPublishDetailsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(getBulkPublishDetailsRequest.getIdentityPoolId(), IDENTITYPOOLID_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[getBulkPublishDetailsRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.getBulkPublishDetailsRequest], ==, 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=getIdentityPoolId, postfix_operators=[], prefix_operators=[], qualifier=getBulkPublishDetailsRequest, selectors=[], type_arguments=None), MemberReference(member=IDENTITYPOOLID_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[GetBulkPublishDetailsRequest] identifier[getBulkPublishDetailsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[getBulkPublishDetailsRequest] 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[getBulkPublishDetailsRequest] operator[SEP] identifier[getIdentityPoolId] operator[SEP] operator[SEP] , identifier[IDENTITYPOOLID_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 static HiveColumnHandle bucketColumnHandle()
{
return new HiveColumnHandle(BUCKET_COLUMN_NAME, BUCKET_HIVE_TYPE, BUCKET_TYPE_SIGNATURE, BUCKET_COLUMN_INDEX, SYNTHESIZED, Optional.empty());
} | class class_name[name] begin[{]
method[bucketColumnHandle, return_type[type[HiveColumnHandle]], modifier[public static], parameter[]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=BUCKET_COLUMN_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=BUCKET_HIVE_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=BUCKET_TYPE_SIGNATURE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=BUCKET_COLUMN_INDEX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SYNTHESIZED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=empty, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HiveColumnHandle, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[HiveColumnHandle] identifier[bucketColumnHandle] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[HiveColumnHandle] operator[SEP] identifier[BUCKET_COLUMN_NAME] , identifier[BUCKET_HIVE_TYPE] , identifier[BUCKET_TYPE_SIGNATURE] , identifier[BUCKET_COLUMN_INDEX] , identifier[SYNTHESIZED] , identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static AuditEntryBean policiesReordered(ApiVersionBean apiVersion, PolicyType policyType,
ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(apiVersion.getApi().getOrganization().getId(), AuditEntityType.Api, securityContext);
entry.setEntityId(apiVersion.getApi().getId());
entry.setEntityVersion(apiVersion.getVersion());
entry.setWhat(AuditEntryType.ReorderPolicies);
return entry;
} | class class_name[name] begin[{]
method[policiesReordered, return_type[type[AuditEntryBean]], modifier[public static], parameter[apiVersion, policyType, securityContext]] begin[{]
local_variable[type[AuditEntryBean], entry]
call[entry.setEntityId, parameter[call[apiVersion.getApi, parameter[]]]]
call[entry.setEntityVersion, parameter[call[apiVersion.getVersion, parameter[]]]]
call[entry.setWhat, parameter[member[AuditEntryType.ReorderPolicies]]]
return[member[.entry]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[AuditEntryBean] identifier[policiesReordered] operator[SEP] identifier[ApiVersionBean] identifier[apiVersion] , identifier[PolicyType] identifier[policyType] , identifier[ISecurityContext] identifier[securityContext] operator[SEP] {
identifier[AuditEntryBean] identifier[entry] operator[=] identifier[newEntry] operator[SEP] identifier[apiVersion] operator[SEP] identifier[getApi] operator[SEP] operator[SEP] operator[SEP] identifier[getOrganization] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[AuditEntityType] operator[SEP] identifier[Api] , identifier[securityContext] operator[SEP] operator[SEP] identifier[entry] operator[SEP] identifier[setEntityId] operator[SEP] identifier[apiVersion] operator[SEP] identifier[getApi] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[entry] operator[SEP] identifier[setEntityVersion] operator[SEP] identifier[apiVersion] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[entry] operator[SEP] identifier[setWhat] operator[SEP] identifier[AuditEntryType] operator[SEP] identifier[ReorderPolicies] operator[SEP] operator[SEP] Keyword[return] identifier[entry] operator[SEP]
}
|
private void moveClassLevelUp(Outline outline, JDefinedClass clazz) {
// Modify the container so it now refers the class. Container can be a class or package.
JDefinedClass parent = (JDefinedClass) clazz.parentContainer();
JClassContainer grandParent = parent.parentContainer();
Map<String, JDefinedClass> classes;
// FIXME: Pending https://java.net/jira/browse/JAXB-957
if (grandParent.isClass()) {
// Element class should be added as its container child:
JDefinedClass grandParentClass = (JDefinedClass) grandParent;
writeSummary("\tMoving inner class " + clazz.fullName() + " to class " + grandParentClass.fullName());
classes = getPrivateField(grandParentClass, "classes");
}
else {
JPackage grandParentPackage = (JPackage) grandParent;
writeSummary("\tMoving inner class " + clazz.fullName() + " to package " + grandParentPackage.name());
classes = getPrivateField(grandParentPackage, "classes");
// In this scenario class should have "static" modifier reset otherwise it won't compile:
setPrivateField(clazz.mods(), "mods", Integer.valueOf(clazz.mods().getValue() & ~JMod.STATIC));
for (ClassOutline classOutline : outline.getClasses()) {
if (classOutline.implClass == clazz) {
XSComponent sc = classOutline.target.getSchemaComponent();
// FIXME: Inner class is always a local declaration.
assert (sc instanceof XSDeclaration && ((XSDeclaration) sc).isLocal());
setPrivateField(sc, "anonymous", Boolean.FALSE);
break;
}
}
}
if (classes.containsKey(clazz.name())) {
writeSummary("\tRenaming class " + clazz.fullName() + " to class " + parent.name() + clazz.name());
setPrivateField(clazz, "name", parent.name() + clazz.name());
}
classes.put(clazz.name(), clazz);
// Finally modify the class so that it refers back the container:
setPrivateField(clazz, "outer", grandParent);
} | class class_name[name] begin[{]
method[moveClassLevelUp, return_type[void], modifier[private], parameter[outline, clazz]] begin[{]
local_variable[type[JDefinedClass], parent]
local_variable[type[JClassContainer], grandParent]
local_variable[type[Map], classes]
if[call[grandParent.isClass, parameter[]]] begin[{]
local_variable[type[JDefinedClass], grandParentClass]
call[.writeSummary, parameter[binary_operation[binary_operation[binary_operation[literal["\tMoving inner class "], +, call[clazz.fullName, parameter[]]], +, literal[" to class "]], +, call[grandParentClass.fullName, parameter[]]]]]
assign[member[.classes], call[.getPrivateField, parameter[member[.grandParentClass], literal["classes"]]]]
else begin[{]
local_variable[type[JPackage], grandParentPackage]
call[.writeSummary, parameter[binary_operation[binary_operation[binary_operation[literal["\tMoving inner class "], +, call[clazz.fullName, parameter[]]], +, literal[" to package "]], +, call[grandParentPackage.name, parameter[]]]]]
assign[member[.classes], call[.getPrivateField, parameter[member[.grandParentPackage], literal["classes"]]]]
call[.setPrivateField, parameter[call[clazz.mods, parameter[]], literal["mods"], call[Integer.valueOf, parameter[binary_operation[call[clazz.mods, parameter[]], &, member[JMod.STATIC]]]]]]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=implClass, postfix_operators=[], prefix_operators=[], qualifier=classOutline, selectors=[]), operandr=MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSchemaComponent, postfix_operators=[], prefix_operators=[], qualifier=classOutline.target, selectors=[], type_arguments=None), name=sc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XSComponent, sub_type=None)), AssertStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=sc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=XSDeclaration, sub_type=None), operator=instanceof), operandr=Cast(expression=MemberReference(member=sc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=XSDeclaration, sub_type=None)), operator=&&), label=None, value=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="anonymous"), MemberReference(member=FALSE, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[])], member=setPrivateField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getClasses, postfix_operators=[], prefix_operators=[], qualifier=outline, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=classOutline)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClassOutline, sub_type=None))), label=None)
end[}]
if[call[classes.containsKey, parameter[call[clazz.name, parameter[]]]]] begin[{]
call[.writeSummary, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["\tRenaming class "], +, call[clazz.fullName, parameter[]]], +, literal[" to class "]], +, call[parent.name, parameter[]]], +, call[clazz.name, parameter[]]]]]
call[.setPrivateField, parameter[member[.clazz], literal["name"], binary_operation[call[parent.name, parameter[]], +, call[clazz.name, parameter[]]]]]
else begin[{]
None
end[}]
call[classes.put, parameter[call[clazz.name, parameter[]], member[.clazz]]]
call[.setPrivateField, parameter[member[.clazz], literal["outer"], member[.grandParent]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[moveClassLevelUp] operator[SEP] identifier[Outline] identifier[outline] , identifier[JDefinedClass] identifier[clazz] operator[SEP] {
identifier[JDefinedClass] identifier[parent] operator[=] operator[SEP] identifier[JDefinedClass] operator[SEP] identifier[clazz] operator[SEP] identifier[parentContainer] operator[SEP] operator[SEP] operator[SEP] identifier[JClassContainer] identifier[grandParent] operator[=] identifier[parent] operator[SEP] identifier[parentContainer] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[JDefinedClass] operator[>] identifier[classes] operator[SEP] Keyword[if] operator[SEP] identifier[grandParent] operator[SEP] identifier[isClass] operator[SEP] operator[SEP] operator[SEP] {
identifier[JDefinedClass] identifier[grandParentClass] operator[=] operator[SEP] identifier[JDefinedClass] operator[SEP] identifier[grandParent] operator[SEP] identifier[writeSummary] operator[SEP] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[fullName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[grandParentClass] operator[SEP] identifier[fullName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[classes] operator[=] identifier[getPrivateField] operator[SEP] identifier[grandParentClass] , literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[JPackage] identifier[grandParentPackage] operator[=] operator[SEP] identifier[JPackage] operator[SEP] identifier[grandParent] operator[SEP] identifier[writeSummary] operator[SEP] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[fullName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[grandParentPackage] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[classes] operator[=] identifier[getPrivateField] operator[SEP] identifier[grandParentPackage] , literal[String] operator[SEP] operator[SEP] identifier[setPrivateField] operator[SEP] identifier[clazz] operator[SEP] identifier[mods] operator[SEP] operator[SEP] , literal[String] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[clazz] operator[SEP] identifier[mods] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[&] operator[~] identifier[JMod] operator[SEP] identifier[STATIC] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ClassOutline] identifier[classOutline] operator[:] identifier[outline] operator[SEP] identifier[getClasses] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[classOutline] operator[SEP] identifier[implClass] operator[==] identifier[clazz] operator[SEP] {
identifier[XSComponent] identifier[sc] operator[=] identifier[classOutline] operator[SEP] identifier[target] operator[SEP] identifier[getSchemaComponent] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[sc] Keyword[instanceof] identifier[XSDeclaration] operator[&&] operator[SEP] operator[SEP] identifier[XSDeclaration] operator[SEP] identifier[sc] operator[SEP] operator[SEP] identifier[isLocal] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setPrivateField] operator[SEP] identifier[sc] , literal[String] , identifier[Boolean] operator[SEP] identifier[FALSE] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[classes] operator[SEP] identifier[containsKey] operator[SEP] identifier[clazz] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[writeSummary] operator[SEP] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[fullName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[parent] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[+] identifier[clazz] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setPrivateField] operator[SEP] identifier[clazz] , literal[String] , identifier[parent] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[+] identifier[clazz] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[classes] operator[SEP] identifier[put] operator[SEP] identifier[clazz] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[clazz] operator[SEP] operator[SEP] identifier[setPrivateField] operator[SEP] identifier[clazz] , literal[String] , identifier[grandParent] operator[SEP] operator[SEP]
}
|
public void logIfNeeded(boolean granted, AccessControlEntry ace) {
Assert.notNull(ace, "AccessControlEntry required");
if (ace instanceof AuditableAccessControlEntry) {
AuditableAccessControlEntry auditableAce = (AuditableAccessControlEntry) ace;
if (granted && auditableAce.isAuditSuccess()) {
System.out.println("GRANTED due to ACE: " + ace);
}
else if (!granted && auditableAce.isAuditFailure()) {
System.out.println("DENIED due to ACE: " + ace);
}
}
} | class class_name[name] begin[{]
method[logIfNeeded, return_type[void], modifier[public], parameter[granted, ace]] begin[{]
call[Assert.notNull, parameter[member[.ace], literal["AccessControlEntry required"]]]
if[binary_operation[member[.ace], instanceof, type[AuditableAccessControlEntry]]] begin[{]
local_variable[type[AuditableAccessControlEntry], auditableAce]
if[binary_operation[member[.granted], &&, call[auditableAce.isAuditSuccess, parameter[]]]] begin[{]
call[System.out.println, parameter[binary_operation[literal["GRANTED due to ACE: "], +, member[.ace]]]]
else begin[{]
if[binary_operation[member[.granted], &&, call[auditableAce.isAuditFailure, parameter[]]]] begin[{]
call[System.out.println, parameter[binary_operation[literal["DENIED due to ACE: "], +, member[.ace]]]]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[logIfNeeded] operator[SEP] Keyword[boolean] identifier[granted] , identifier[AccessControlEntry] identifier[ace] operator[SEP] {
identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[ace] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ace] Keyword[instanceof] identifier[AuditableAccessControlEntry] operator[SEP] {
identifier[AuditableAccessControlEntry] identifier[auditableAce] operator[=] operator[SEP] identifier[AuditableAccessControlEntry] operator[SEP] identifier[ace] operator[SEP] Keyword[if] operator[SEP] identifier[granted] operator[&&] identifier[auditableAce] operator[SEP] identifier[isAuditSuccess] operator[SEP] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[ace] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[granted] operator[&&] identifier[auditableAce] operator[SEP] identifier[isAuditFailure] operator[SEP] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[ace] operator[SEP] operator[SEP]
}
}
}
|
@Override
public void actionPerformed(ActionEvent e) {
int row = table.convertRowIndexToModel(table.getEditingRow());
fireEditingStopped();
// Invoke the Action
ActionEvent event = new ActionEvent(
table,
ActionEvent.ACTION_PERFORMED,
Integer.toString(row));
action.actionPerformed(event);
} | class class_name[name] begin[{]
method[actionPerformed, return_type[void], modifier[public], parameter[e]] begin[{]
local_variable[type[int], row]
call[.fireEditingStopped, parameter[]]
local_variable[type[ActionEvent], event]
call[action.actionPerformed, parameter[member[.event]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[actionPerformed] operator[SEP] identifier[ActionEvent] identifier[e] operator[SEP] {
Keyword[int] identifier[row] operator[=] identifier[table] operator[SEP] identifier[convertRowIndexToModel] operator[SEP] identifier[table] operator[SEP] identifier[getEditingRow] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[fireEditingStopped] operator[SEP] operator[SEP] operator[SEP] identifier[ActionEvent] identifier[event] operator[=] Keyword[new] identifier[ActionEvent] operator[SEP] identifier[table] , identifier[ActionEvent] operator[SEP] identifier[ACTION_PERFORMED] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[row] operator[SEP] operator[SEP] operator[SEP] identifier[action] operator[SEP] identifier[actionPerformed] operator[SEP] identifier[event] operator[SEP] operator[SEP]
}
|
public void setPrefixLists(java.util.Collection<PrefixList> prefixLists) {
if (prefixLists == null) {
this.prefixLists = null;
return;
}
this.prefixLists = new com.amazonaws.internal.SdkInternalList<PrefixList>(prefixLists);
} | class class_name[name] begin[{]
method[setPrefixLists, return_type[void], modifier[public], parameter[prefixLists]] begin[{]
if[binary_operation[member[.prefixLists], ==, literal[null]]] begin[{]
assign[THIS[member[None.prefixLists]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.prefixLists]], ClassCreator(arguments=[MemberReference(member=prefixLists, 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=PrefixList, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setPrefixLists] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[PrefixList] operator[>] identifier[prefixLists] operator[SEP] {
Keyword[if] operator[SEP] identifier[prefixLists] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[prefixLists] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[prefixLists] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[PrefixList] operator[>] operator[SEP] identifier[prefixLists] operator[SEP] operator[SEP]
}
|
private ClassLoader createPluginClassLoader() throws CliExecutionException {
ClassLoader parentClassLoader = Task.class.getClassLoader();
File homeDirectory = getHomeDirectory();
if (homeDirectory != null) {
File pluginDirectory = new File(homeDirectory, DIRECTORY_PLUGINS);
if (pluginDirectory.exists()) {
final List<URL> urls = new ArrayList<>();
final Path pluginDirectoryPath = pluginDirectory.toPath();
SimpleFileVisitor<Path> visitor = new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
if (file.toFile().getName().endsWith(".jar")) {
urls.add(file.toFile().toURI().toURL());
}
return FileVisitResult.CONTINUE;
}
};
try {
Files.walkFileTree(pluginDirectoryPath, visitor);
} catch (IOException e) {
throw new CliExecutionException("Cannot read plugin directory.", e);
}
LOGGER.debug("Using plugin URLs: " + urls);
return new com.buschmais.jqassistant.commandline.PluginClassLoader(urls, parentClassLoader);
}
}
return parentClassLoader;
} | class class_name[name] begin[{]
method[createPluginClassLoader, return_type[type[ClassLoader]], modifier[private], parameter[]] begin[{]
local_variable[type[ClassLoader], parentClassLoader]
local_variable[type[File], homeDirectory]
if[binary_operation[member[.homeDirectory], !=, literal[null]]] begin[{]
local_variable[type[File], pluginDirectory]
if[call[pluginDirectory.exists, parameter[]]] begin[{]
local_variable[type[List], urls]
local_variable[type[Path], pluginDirectoryPath]
local_variable[type[SimpleFileVisitor], visitor]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pluginDirectoryPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=visitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=walkFileTree, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot read plugin directory."), 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=CliExecutionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
call[LOGGER.debug, parameter[binary_operation[literal["Using plugin URLs: "], +, member[.urls]]]]
return[ClassCreator(arguments=[MemberReference(member=urls, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parentClassLoader, 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=buschmais, sub_type=ReferenceType(arguments=None, dimensions=None, name=jqassistant, sub_type=ReferenceType(arguments=None, dimensions=None, name=commandline, sub_type=ReferenceType(arguments=None, dimensions=None, name=PluginClassLoader, sub_type=None))))))]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.parentClassLoader]]
end[}]
END[}] | Keyword[private] identifier[ClassLoader] identifier[createPluginClassLoader] operator[SEP] operator[SEP] Keyword[throws] identifier[CliExecutionException] {
identifier[ClassLoader] identifier[parentClassLoader] operator[=] identifier[Task] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[homeDirectory] operator[=] identifier[getHomeDirectory] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[homeDirectory] operator[!=] Other[null] operator[SEP] {
identifier[File] identifier[pluginDirectory] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[homeDirectory] , identifier[DIRECTORY_PLUGINS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pluginDirectory] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[List] operator[<] identifier[URL] operator[>] identifier[urls] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Path] identifier[pluginDirectoryPath] operator[=] identifier[pluginDirectory] operator[SEP] identifier[toPath] operator[SEP] operator[SEP] operator[SEP] identifier[SimpleFileVisitor] operator[<] identifier[Path] operator[>] identifier[visitor] operator[=] Keyword[new] identifier[SimpleFileVisitor] operator[<] identifier[Path] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[FileVisitResult] identifier[visitFile] operator[SEP] identifier[Path] identifier[file] , identifier[BasicFileAttributes] identifier[attrs] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[toFile] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[urls] operator[SEP] identifier[add] operator[SEP] identifier[file] operator[SEP] identifier[toFile] operator[SEP] operator[SEP] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] identifier[toURL] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[FileVisitResult] operator[SEP] identifier[CONTINUE] operator[SEP]
}
} operator[SEP] Keyword[try] {
identifier[Files] operator[SEP] identifier[walkFileTree] operator[SEP] identifier[pluginDirectoryPath] , identifier[visitor] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CliExecutionException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[urls] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[com] operator[SEP] identifier[buschmais] operator[SEP] identifier[jqassistant] operator[SEP] identifier[commandline] operator[SEP] identifier[PluginClassLoader] operator[SEP] identifier[urls] , identifier[parentClassLoader] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[parentClassLoader] operator[SEP]
}
|
public JRecordExtractor<T, double[]> extractWithSettingsDouble(String settings) {
return new JRecordExtractor<>(JavaOps.extractWithSettingsDouble(self, settings));
} | class class_name[name] begin[{]
method[extractWithSettingsDouble, return_type[type[JRecordExtractor]], modifier[public], parameter[settings]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=self, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=settings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extractWithSettingsDouble, postfix_operators=[], prefix_operators=[], qualifier=JavaOps, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=JRecordExtractor, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[JRecordExtractor] operator[<] identifier[T] , Keyword[double] operator[SEP] operator[SEP] operator[>] identifier[extractWithSettingsDouble] operator[SEP] identifier[String] identifier[settings] operator[SEP] {
Keyword[return] Keyword[new] identifier[JRecordExtractor] operator[<] operator[>] operator[SEP] identifier[JavaOps] operator[SEP] identifier[extractWithSettingsDouble] operator[SEP] identifier[self] , identifier[settings] operator[SEP] operator[SEP] operator[SEP]
}
|
public static BufferedImage colorizeGradient(GrayS16 derivX, GrayS16 derivY, int maxAbsValue, BufferedImage output) {
InputSanityCheck.checkSameShape(derivX,derivY);
if( output == null )
output = new BufferedImage(derivX.width,derivX.height,BufferedImage.TYPE_INT_RGB);
WritableRaster raster = output.getRaster();
DataBufferInt buffer = (DataBufferInt)raster.getDataBuffer();
int[] outData = buffer.getData();
int outOffset = ConvertRaster.getOffset(raster);
if( maxAbsValue < 0 ) {
maxAbsValue = ImageStatistics.maxAbs(derivX);
maxAbsValue = Math.max(maxAbsValue, ImageStatistics.maxAbs(derivY));
}
if( maxAbsValue == 0 )
return output;
int indexOut = outOffset;
for( int y = 0; y < derivX.height; y++ ) {
int indexX = derivX.startIndex + y*derivX.stride;
int indexY = derivY.startIndex + y*derivY.stride;
for( int x = 0; x < derivX.width; x++ ) {
int valueX = derivX.data[ indexX++ ];
int valueY = derivY.data[ indexY++ ];
int r=0,g=0,b=0;
if( valueX > 0 ) {
r = 255*valueX/maxAbsValue;
} else {
g = -255*valueX/maxAbsValue;
}
if( valueY > 0 ) {
b = 255*valueY/maxAbsValue;
} else {
int v = -255*valueY/maxAbsValue;
r += v;
g += v;
if( r > 255 ) r = 255;
if( g > 255 ) g = 255;
}
outData[indexOut++] = r << 16 | g << 8 | b;
}
}
return output;
} | class class_name[name] begin[{]
method[colorizeGradient, return_type[type[BufferedImage]], modifier[public static], parameter[derivX, derivY, maxAbsValue, output]] begin[{]
call[InputSanityCheck.checkSameShape, parameter[member[.derivX], member[.derivY]]]
if[binary_operation[member[.output], ==, literal[null]]] begin[{]
assign[member[.output], ClassCreator(arguments=[MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=derivX, selectors=[]), MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=derivX, selectors=[]), MemberReference(member=TYPE_INT_RGB, postfix_operators=[], prefix_operators=[], qualifier=BufferedImage, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedImage, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[WritableRaster], raster]
local_variable[type[DataBufferInt], buffer]
local_variable[type[int], outData]
local_variable[type[int], outOffset]
if[binary_operation[member[.maxAbsValue], <, literal[0]]] begin[{]
assign[member[.maxAbsValue], call[ImageStatistics.maxAbs, parameter[member[.derivX]]]]
assign[member[.maxAbsValue], call[Math.max, parameter[member[.maxAbsValue], call[ImageStatistics.maxAbs, parameter[member[.derivY]]]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.maxAbsValue], ==, literal[0]]] begin[{]
return[member[.output]]
else begin[{]
None
end[}]
local_variable[type[int], indexOut]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=derivX, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=stride, postfix_operators=[], prefix_operators=[], qualifier=derivX, selectors=[]), operator=*), operator=+), name=indexX)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=derivY, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=stride, postfix_operators=[], prefix_operators=[], qualifier=derivY, selectors=[]), operator=*), operator=+), name=indexY)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=derivX, selectors=[ArraySelector(index=MemberReference(member=indexX, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), name=valueX)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=derivY, selectors=[ArraySelector(index=MemberReference(member=indexY, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), name=valueY)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=r), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=g), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=b)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=valueX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=255), operandr=MemberReference(member=valueX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=maxAbsValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=255), operandr=MemberReference(member=valueX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=maxAbsValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=valueY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=255), operandr=MemberReference(member=valueY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=maxAbsValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), name=v)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=255), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=255)), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=255), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=255)), label=None))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=255), operandr=MemberReference(member=valueY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=maxAbsValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=outData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=indexOut, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=<<), operandr=BinaryOperation(operandl=MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operator=|), operandr=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|)), 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=derivX, 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=derivX, 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)
return[member[.output]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[BufferedImage] identifier[colorizeGradient] operator[SEP] identifier[GrayS16] identifier[derivX] , identifier[GrayS16] identifier[derivY] , Keyword[int] identifier[maxAbsValue] , identifier[BufferedImage] identifier[output] operator[SEP] {
identifier[InputSanityCheck] operator[SEP] identifier[checkSameShape] operator[SEP] identifier[derivX] , identifier[derivY] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[output] operator[==] Other[null] operator[SEP] identifier[output] operator[=] Keyword[new] identifier[BufferedImage] operator[SEP] identifier[derivX] operator[SEP] identifier[width] , identifier[derivX] operator[SEP] identifier[height] , identifier[BufferedImage] operator[SEP] identifier[TYPE_INT_RGB] operator[SEP] operator[SEP] identifier[WritableRaster] identifier[raster] operator[=] identifier[output] operator[SEP] identifier[getRaster] operator[SEP] operator[SEP] operator[SEP] identifier[DataBufferInt] identifier[buffer] operator[=] operator[SEP] identifier[DataBufferInt] operator[SEP] identifier[raster] operator[SEP] identifier[getDataBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[outData] operator[=] identifier[buffer] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[outOffset] operator[=] identifier[ConvertRaster] operator[SEP] identifier[getOffset] operator[SEP] identifier[raster] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[maxAbsValue] operator[<] Other[0] operator[SEP] {
identifier[maxAbsValue] operator[=] identifier[ImageStatistics] operator[SEP] identifier[maxAbs] operator[SEP] identifier[derivX] operator[SEP] operator[SEP] identifier[maxAbsValue] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[maxAbsValue] , identifier[ImageStatistics] operator[SEP] identifier[maxAbs] operator[SEP] identifier[derivY] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[maxAbsValue] operator[==] Other[0] operator[SEP] Keyword[return] identifier[output] operator[SEP] Keyword[int] identifier[indexOut] operator[=] identifier[outOffset] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[derivX] operator[SEP] identifier[height] operator[SEP] identifier[y] operator[++] operator[SEP] {
Keyword[int] identifier[indexX] operator[=] identifier[derivX] operator[SEP] identifier[startIndex] operator[+] identifier[y] operator[*] identifier[derivX] operator[SEP] identifier[stride] operator[SEP] Keyword[int] identifier[indexY] operator[=] identifier[derivY] operator[SEP] identifier[startIndex] operator[+] identifier[y] operator[*] identifier[derivY] operator[SEP] identifier[stride] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[derivX] operator[SEP] identifier[width] operator[SEP] identifier[x] operator[++] operator[SEP] {
Keyword[int] identifier[valueX] operator[=] identifier[derivX] operator[SEP] identifier[data] operator[SEP] identifier[indexX] operator[++] operator[SEP] operator[SEP] Keyword[int] identifier[valueY] operator[=] identifier[derivY] operator[SEP] identifier[data] operator[SEP] identifier[indexY] operator[++] operator[SEP] operator[SEP] Keyword[int] identifier[r] operator[=] Other[0] , identifier[g] operator[=] Other[0] , identifier[b] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[valueX] operator[>] Other[0] operator[SEP] {
identifier[r] operator[=] Other[255] operator[*] identifier[valueX] operator[/] identifier[maxAbsValue] operator[SEP]
}
Keyword[else] {
identifier[g] operator[=] operator[-] Other[255] operator[*] identifier[valueX] operator[/] identifier[maxAbsValue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[valueY] operator[>] Other[0] operator[SEP] {
identifier[b] operator[=] Other[255] operator[*] identifier[valueY] operator[/] identifier[maxAbsValue] operator[SEP]
}
Keyword[else] {
Keyword[int] identifier[v] operator[=] operator[-] Other[255] operator[*] identifier[valueY] operator[/] identifier[maxAbsValue] operator[SEP] identifier[r] operator[+=] identifier[v] operator[SEP] identifier[g] operator[+=] identifier[v] operator[SEP] Keyword[if] operator[SEP] identifier[r] operator[>] Other[255] operator[SEP] identifier[r] operator[=] Other[255] operator[SEP] Keyword[if] operator[SEP] identifier[g] operator[>] Other[255] operator[SEP] identifier[g] operator[=] Other[255] operator[SEP]
}
identifier[outData] operator[SEP] identifier[indexOut] operator[++] operator[SEP] operator[=] identifier[r] operator[<<] Other[16] operator[|] identifier[g] operator[<<] Other[8] operator[|] identifier[b] operator[SEP]
}
}
Keyword[return] identifier[output] operator[SEP]
}
|
public FeatureMap getParameterValueGroup() {
return (FeatureMap)getGroup().<FeatureMap.Entry>list(BpsimPackage.Literals.ENUM_PARAMETER_TYPE__PARAMETER_VALUE_GROUP);
} | class class_name[name] begin[{]
method[getParameterValueGroup, return_type[type[FeatureMap]], modifier[public], parameter[]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[], member=getGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=ENUM_PARAMETER_TYPE__PARAMETER_VALUE_GROUP, postfix_operators=[], prefix_operators=[], qualifier=BpsimPackage.Literals, selectors=[])], member=list, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=FeatureMap, sub_type=ReferenceType(arguments=None, dimensions=None, name=Entry, sub_type=None)))])], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=FeatureMap, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[FeatureMap] identifier[getParameterValueGroup] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[FeatureMap] operator[SEP] identifier[getGroup] operator[SEP] operator[SEP] operator[SEP] operator[<] identifier[FeatureMap] operator[SEP] identifier[Entry] operator[>] identifier[list] operator[SEP] identifier[BpsimPackage] operator[SEP] identifier[Literals] operator[SEP] identifier[ENUM_PARAMETER_TYPE__PARAMETER_VALUE_GROUP] operator[SEP] operator[SEP]
}
|
@Override
public void setStartTime(Date startTime) {
if (startTime == null) {
throw new IllegalArgumentException("Start time cannot be null");
}
Date eTime = getEndTime();
if (eTime != null && startTime != null && eTime.before(startTime)) {
throw new IllegalArgumentException("End time cannot be before start time");
}
this.startTime = startTime;
} | class class_name[name] begin[{]
method[setStartTime, return_type[void], modifier[public], parameter[startTime]] begin[{]
if[binary_operation[member[.startTime], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Start time cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[Date], eTime]
if[binary_operation[binary_operation[binary_operation[member[.eTime], !=, literal[null]], &&, binary_operation[member[.startTime], !=, literal[null]]], &&, call[eTime.before, parameter[member[.startTime]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="End time cannot be before start time")], 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.startTime]], member[.startTime]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setStartTime] operator[SEP] identifier[Date] identifier[startTime] operator[SEP] {
Keyword[if] operator[SEP] identifier[startTime] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[Date] identifier[eTime] operator[=] identifier[getEndTime] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eTime] operator[!=] Other[null] operator[&&] identifier[startTime] operator[!=] Other[null] operator[&&] identifier[eTime] operator[SEP] identifier[before] operator[SEP] identifier[startTime] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[startTime] operator[=] identifier[startTime] operator[SEP]
}
|
@GET
@Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON})
@Path("/{gavc}" + ServerAPI.GET_ORGANIZATION)
public Response getOrganization(@PathParam("gavc") final String gavc, @Context final UriInfo uriInfo){
if(LOG.isInfoEnabled()) {
LOG.info(String.format("Got a get artifact's organization request [%s]", gavc));
}
final ArtifactHandler artifactHandler = getArtifactHandler();
final DbArtifact artifact = artifactHandler.getArtifact(gavc);
final DbModule module = artifactHandler.getModule(artifact);
if(module == null || module.getOrganization().isEmpty()) {
return Response.noContent().build();
}
final DbOrganization organization = getOrganizationHandler().getOrganization(module.getOrganization());
final OrganizationView view = new OrganizationView(getModelMapper().getOrganization(organization));
return Response.ok(view).build();
} | class class_name[name] begin[{]
method[getOrganization, return_type[type[Response]], modifier[public], parameter[gavc, uriInfo]] begin[{]
if[call[LOG.isInfoEnabled, parameter[]]] begin[{]
call[LOG.info, parameter[call[String.format, parameter[literal["Got a get artifact's organization request [%s]"], member[.gavc]]]]]
else begin[{]
None
end[}]
local_variable[type[ArtifactHandler], artifactHandler]
local_variable[type[DbArtifact], artifact]
local_variable[type[DbModule], module]
if[binary_operation[binary_operation[member[.module], ==, literal[null]], ||, call[module.getOrganization, parameter[]]]] begin[{]
return[call[Response.noContent, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[DbOrganization], organization]
local_variable[type[OrganizationView], view]
return[call[Response.ok, parameter[member[.view]]]]
end[}]
END[}] | annotation[@] identifier[GET] annotation[@] identifier[Produces] operator[SEP] {
identifier[MediaType] operator[SEP] identifier[TEXT_HTML] , identifier[MediaType] operator[SEP] identifier[APPLICATION_JSON]
} operator[SEP] annotation[@] identifier[Path] operator[SEP] literal[String] operator[+] identifier[ServerAPI] operator[SEP] identifier[GET_ORGANIZATION] operator[SEP] Keyword[public] identifier[Response] identifier[getOrganization] operator[SEP] annotation[@] identifier[PathParam] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[String] identifier[gavc] , annotation[@] identifier[Context] Keyword[final] identifier[UriInfo] identifier[uriInfo] operator[SEP] {
Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[gavc] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] identifier[ArtifactHandler] identifier[artifactHandler] operator[=] identifier[getArtifactHandler] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[DbArtifact] identifier[artifact] operator[=] identifier[artifactHandler] operator[SEP] identifier[getArtifact] operator[SEP] identifier[gavc] operator[SEP] operator[SEP] Keyword[final] identifier[DbModule] identifier[module] operator[=] identifier[artifactHandler] operator[SEP] identifier[getModule] operator[SEP] identifier[artifact] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[module] operator[==] Other[null] operator[||] identifier[module] operator[SEP] identifier[getOrganization] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[Response] operator[SEP] identifier[noContent] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] identifier[DbOrganization] identifier[organization] operator[=] identifier[getOrganizationHandler] operator[SEP] operator[SEP] operator[SEP] identifier[getOrganization] operator[SEP] identifier[module] operator[SEP] identifier[getOrganization] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[OrganizationView] identifier[view] operator[=] Keyword[new] identifier[OrganizationView] operator[SEP] identifier[getModelMapper] operator[SEP] operator[SEP] operator[SEP] identifier[getOrganization] operator[SEP] identifier[organization] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Response] operator[SEP] identifier[ok] operator[SEP] identifier[view] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
private static Thread createAsyncStreamThread(final InputStream input,
final StringBuilder processOutputStringBuilder,
final boolean isVerbose) {
Thread thread = new Thread() {
@Override
public void run() {
// do not buffer
LOG.log(Level.FINE, "Process output (stdout+stderr):");
BufferedReader reader = new BufferedReader(new InputStreamReader(input), 1);
while (true) {
String line = null;
try {
line = reader.readLine();
} catch (IOException e) {
LOG.log(Level.SEVERE, "Error when reading line from subprocess", e);
}
if (line == null) {
break;
} else {
if (isVerbose) {
System.err.println(line);
}
if (processOutputStringBuilder != null) {
processOutputStringBuilder.append(line);
}
}
}
try {
input.close();
} catch (IOException e) {
LOG.log(Level.WARNING, "Failed to close the input stream", e);
}
}
};
thread.setDaemon(true);
return thread;
} | class class_name[name] begin[{]
method[createAsyncStreamThread, return_type[type[Thread]], modifier[private static], parameter[input, processOutputStringBuilder, isVerbose]] begin[{]
local_variable[type[Thread], thread]
call[thread.setDaemon, parameter[literal[true]]]
return[member[.thread]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Thread] identifier[createAsyncStreamThread] operator[SEP] Keyword[final] identifier[InputStream] identifier[input] , Keyword[final] identifier[StringBuilder] identifier[processOutputStringBuilder] , Keyword[final] Keyword[boolean] identifier[isVerbose] operator[SEP] {
identifier[Thread] identifier[thread] operator[=] Keyword[new] identifier[Thread] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] operator[SEP] operator[SEP] identifier[BufferedReader] identifier[reader] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[input] operator[SEP] , Other[1] operator[SEP] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
identifier[String] identifier[line] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[line] operator[=] identifier[reader] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[line] operator[==] Other[null] operator[SEP] {
Keyword[break] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[isVerbose] operator[SEP] {
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] identifier[line] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[processOutputStringBuilder] operator[!=] Other[null] operator[SEP] {
identifier[processOutputStringBuilder] operator[SEP] identifier[append] operator[SEP] identifier[line] operator[SEP] operator[SEP]
}
}
}
Keyword[try] {
identifier[input] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
} operator[SEP] identifier[thread] operator[SEP] identifier[setDaemon] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[thread] operator[SEP]
}
|
public static Histogram joinHistogram(Histogram hist1, Histogram hist2,
String fldName1, String fldName2) {
Histogram prodHist = ProductPlan.productHistogram(hist1, hist2);
Set<String> group = new HashSet<String>();
group.add(fldName1);
group.add(fldName2);
return SelectPlan.joinFieldsHistogram(prodHist, group);
} | class class_name[name] begin[{]
method[joinHistogram, return_type[type[Histogram]], modifier[public static], parameter[hist1, hist2, fldName1, fldName2]] begin[{]
local_variable[type[Histogram], prodHist]
local_variable[type[Set], group]
call[group.add, parameter[member[.fldName1]]]
call[group.add, parameter[member[.fldName2]]]
return[call[SelectPlan.joinFieldsHistogram, parameter[member[.prodHist], member[.group]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Histogram] identifier[joinHistogram] operator[SEP] identifier[Histogram] identifier[hist1] , identifier[Histogram] identifier[hist2] , identifier[String] identifier[fldName1] , identifier[String] identifier[fldName2] operator[SEP] {
identifier[Histogram] identifier[prodHist] operator[=] identifier[ProductPlan] operator[SEP] identifier[productHistogram] operator[SEP] identifier[hist1] , identifier[hist2] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[group] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[group] operator[SEP] identifier[add] operator[SEP] identifier[fldName1] operator[SEP] operator[SEP] identifier[group] operator[SEP] identifier[add] operator[SEP] identifier[fldName2] operator[SEP] operator[SEP] Keyword[return] identifier[SelectPlan] operator[SEP] identifier[joinFieldsHistogram] operator[SEP] identifier[prodHist] , identifier[group] operator[SEP] operator[SEP]
}
|
DictionaryPage readDictionary(ColumnChunkMetaData meta) throws IOException {
if (!meta.getEncodings().contains(Encoding.PLAIN_DICTIONARY) &&
!meta.getEncodings().contains(Encoding.RLE_DICTIONARY)) {
return null;
}
// TODO: this should use getDictionaryPageOffset() but it isn't reliable.
if (f.getPos() != meta.getStartingPos()) {
f.seek(meta.getStartingPos());
}
PageHeader pageHeader = Util.readPageHeader(f);
if (!pageHeader.isSetDictionary_page_header()) {
return null; // TODO: should this complain?
}
DictionaryPage compressedPage = readCompressedDictionary(pageHeader, f);
BytesInputDecompressor decompressor = options.getCodecFactory().getDecompressor(meta.getCodec());
return new DictionaryPage(
decompressor.decompress(compressedPage.getBytes(), compressedPage.getUncompressedSize()),
compressedPage.getDictionarySize(),
compressedPage.getEncoding());
} | class class_name[name] begin[{]
method[readDictionary, return_type[type[DictionaryPage]], modifier[default], parameter[meta]] begin[{]
if[binary_operation[call[meta.getEncodings, parameter[]], &&, call[meta.getEncodings, parameter[]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[call[f.getPos, parameter[]], !=, call[meta.getStartingPos, parameter[]]]] begin[{]
call[f.seek, parameter[call[meta.getStartingPos, parameter[]]]]
else begin[{]
None
end[}]
local_variable[type[PageHeader], pageHeader]
if[call[pageHeader.isSetDictionary_page_header, parameter[]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[DictionaryPage], compressedPage]
local_variable[type[BytesInputDecompressor], decompressor]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=compressedPage, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getUncompressedSize, postfix_operators=[], prefix_operators=[], qualifier=compressedPage, selectors=[], type_arguments=None)], member=decompress, postfix_operators=[], prefix_operators=[], qualifier=decompressor, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getDictionarySize, postfix_operators=[], prefix_operators=[], qualifier=compressedPage, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getEncoding, postfix_operators=[], prefix_operators=[], qualifier=compressedPage, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DictionaryPage, sub_type=None))]
end[}]
END[}] | identifier[DictionaryPage] identifier[readDictionary] operator[SEP] identifier[ColumnChunkMetaData] identifier[meta] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] operator[!] identifier[meta] operator[SEP] identifier[getEncodings] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[Encoding] operator[SEP] identifier[PLAIN_DICTIONARY] operator[SEP] operator[&&] operator[!] identifier[meta] operator[SEP] identifier[getEncodings] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[Encoding] operator[SEP] identifier[RLE_DICTIONARY] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[f] operator[SEP] identifier[getPos] operator[SEP] operator[SEP] operator[!=] identifier[meta] operator[SEP] identifier[getStartingPos] operator[SEP] operator[SEP] operator[SEP] {
identifier[f] operator[SEP] identifier[seek] operator[SEP] identifier[meta] operator[SEP] identifier[getStartingPos] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[PageHeader] identifier[pageHeader] operator[=] identifier[Util] operator[SEP] identifier[readPageHeader] operator[SEP] identifier[f] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[pageHeader] operator[SEP] identifier[isSetDictionary_page_header] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[DictionaryPage] identifier[compressedPage] operator[=] identifier[readCompressedDictionary] operator[SEP] identifier[pageHeader] , identifier[f] operator[SEP] operator[SEP] identifier[BytesInputDecompressor] identifier[decompressor] operator[=] identifier[options] operator[SEP] identifier[getCodecFactory] operator[SEP] operator[SEP] operator[SEP] identifier[getDecompressor] operator[SEP] identifier[meta] operator[SEP] identifier[getCodec] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[DictionaryPage] operator[SEP] identifier[decompressor] operator[SEP] identifier[decompress] operator[SEP] identifier[compressedPage] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] , identifier[compressedPage] operator[SEP] identifier[getUncompressedSize] operator[SEP] operator[SEP] operator[SEP] , identifier[compressedPage] operator[SEP] identifier[getDictionarySize] operator[SEP] operator[SEP] , identifier[compressedPage] operator[SEP] identifier[getEncoding] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static CuratorFramework startCuratorFramework(Configuration configuration) {
Preconditions.checkNotNull(configuration, "configuration");
String zkQuorum = configuration.getValue(HighAvailabilityOptions.HA_ZOOKEEPER_QUORUM);
if (zkQuorum == null || StringUtils.isBlank(zkQuorum)) {
throw new RuntimeException("No valid ZooKeeper quorum has been specified. " +
"You can specify the quorum via the configuration key '" +
HighAvailabilityOptions.HA_ZOOKEEPER_QUORUM.key() + "'.");
}
int sessionTimeout = configuration.getInteger(HighAvailabilityOptions.ZOOKEEPER_SESSION_TIMEOUT);
int connectionTimeout = configuration.getInteger(HighAvailabilityOptions.ZOOKEEPER_CONNECTION_TIMEOUT);
int retryWait = configuration.getInteger(HighAvailabilityOptions.ZOOKEEPER_RETRY_WAIT);
int maxRetryAttempts = configuration.getInteger(HighAvailabilityOptions.ZOOKEEPER_MAX_RETRY_ATTEMPTS);
String root = configuration.getValue(HighAvailabilityOptions.HA_ZOOKEEPER_ROOT);
String namespace = configuration.getValue(HighAvailabilityOptions.HA_CLUSTER_ID);
boolean disableSaslClient = configuration.getBoolean(SecurityOptions.ZOOKEEPER_SASL_DISABLE);
ACLProvider aclProvider;
ZkClientACLMode aclMode = ZkClientACLMode.fromConfig(configuration);
if (disableSaslClient && aclMode == ZkClientACLMode.CREATOR) {
String errorMessage = "Cannot set ACL role to " + aclMode + " since SASL authentication is " +
"disabled through the " + SecurityOptions.ZOOKEEPER_SASL_DISABLE.key() + " property";
LOG.warn(errorMessage);
throw new IllegalConfigurationException(errorMessage);
}
if (aclMode == ZkClientACLMode.CREATOR) {
LOG.info("Enforcing creator for ZK connections");
aclProvider = new SecureAclProvider();
} else {
LOG.info("Enforcing default ACL for ZK connections");
aclProvider = new DefaultACLProvider();
}
String rootWithNamespace = generateZookeeperPath(root, namespace);
LOG.info("Using '{}' as Zookeeper namespace.", rootWithNamespace);
CuratorFramework cf = CuratorFrameworkFactory.builder()
.connectString(zkQuorum)
.sessionTimeoutMs(sessionTimeout)
.connectionTimeoutMs(connectionTimeout)
.retryPolicy(new ExponentialBackoffRetry(retryWait, maxRetryAttempts))
// Curator prepends a '/' manually and throws an Exception if the
// namespace starts with a '/'.
.namespace(rootWithNamespace.startsWith("/") ? rootWithNamespace.substring(1) : rootWithNamespace)
.aclProvider(aclProvider)
.build();
cf.start();
return cf;
} | class class_name[name] begin[{]
method[startCuratorFramework, return_type[type[CuratorFramework]], modifier[public static], parameter[configuration]] begin[{]
call[Preconditions.checkNotNull, parameter[member[.configuration], literal["configuration"]]]
local_variable[type[String], zkQuorum]
if[binary_operation[binary_operation[member[.zkQuorum], ==, literal[null]], ||, call[StringUtils.isBlank, parameter[member[.zkQuorum]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No valid ZooKeeper quorum has been specified. "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You can specify the quorum via the configuration key '"), operator=+), operandr=MethodInvocation(arguments=[], member=key, postfix_operators=[], prefix_operators=[], qualifier=HighAvailabilityOptions.HA_ZOOKEEPER_QUORUM, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], sessionTimeout]
local_variable[type[int], connectionTimeout]
local_variable[type[int], retryWait]
local_variable[type[int], maxRetryAttempts]
local_variable[type[String], root]
local_variable[type[String], namespace]
local_variable[type[boolean], disableSaslClient]
local_variable[type[ACLProvider], aclProvider]
local_variable[type[ZkClientACLMode], aclMode]
if[binary_operation[member[.disableSaslClient], &&, binary_operation[member[.aclMode], ==, member[ZkClientACLMode.CREATOR]]]] begin[{]
local_variable[type[String], errorMessage]
call[LOG.warn, parameter[member[.errorMessage]]]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=errorMessage, 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=IllegalConfigurationException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.aclMode], ==, member[ZkClientACLMode.CREATOR]]] begin[{]
call[LOG.info, parameter[literal["Enforcing creator for ZK connections"]]]
assign[member[.aclProvider], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SecureAclProvider, sub_type=None))]
else begin[{]
call[LOG.info, parameter[literal["Enforcing default ACL for ZK connections"]]]
assign[member[.aclProvider], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultACLProvider, sub_type=None))]
end[}]
local_variable[type[String], rootWithNamespace]
call[LOG.info, parameter[literal["Using '{}' as Zookeeper namespace."], member[.rootWithNamespace]]]
local_variable[type[CuratorFramework], cf]
call[cf.start, parameter[]]
return[member[.cf]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[CuratorFramework] identifier[startCuratorFramework] operator[SEP] identifier[Configuration] identifier[configuration] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[configuration] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[zkQuorum] operator[=] identifier[configuration] operator[SEP] identifier[getValue] operator[SEP] identifier[HighAvailabilityOptions] operator[SEP] identifier[HA_ZOOKEEPER_QUORUM] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[zkQuorum] operator[==] Other[null] operator[||] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[zkQuorum] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] literal[String] operator[+] identifier[HighAvailabilityOptions] operator[SEP] identifier[HA_ZOOKEEPER_QUORUM] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[int] identifier[sessionTimeout] operator[=] identifier[configuration] operator[SEP] identifier[getInteger] operator[SEP] identifier[HighAvailabilityOptions] operator[SEP] identifier[ZOOKEEPER_SESSION_TIMEOUT] operator[SEP] operator[SEP] Keyword[int] identifier[connectionTimeout] operator[=] identifier[configuration] operator[SEP] identifier[getInteger] operator[SEP] identifier[HighAvailabilityOptions] operator[SEP] identifier[ZOOKEEPER_CONNECTION_TIMEOUT] operator[SEP] operator[SEP] Keyword[int] identifier[retryWait] operator[=] identifier[configuration] operator[SEP] identifier[getInteger] operator[SEP] identifier[HighAvailabilityOptions] operator[SEP] identifier[ZOOKEEPER_RETRY_WAIT] operator[SEP] operator[SEP] Keyword[int] identifier[maxRetryAttempts] operator[=] identifier[configuration] operator[SEP] identifier[getInteger] operator[SEP] identifier[HighAvailabilityOptions] operator[SEP] identifier[ZOOKEEPER_MAX_RETRY_ATTEMPTS] operator[SEP] operator[SEP] identifier[String] identifier[root] operator[=] identifier[configuration] operator[SEP] identifier[getValue] operator[SEP] identifier[HighAvailabilityOptions] operator[SEP] identifier[HA_ZOOKEEPER_ROOT] operator[SEP] operator[SEP] identifier[String] identifier[namespace] operator[=] identifier[configuration] operator[SEP] identifier[getValue] operator[SEP] identifier[HighAvailabilityOptions] operator[SEP] identifier[HA_CLUSTER_ID] operator[SEP] operator[SEP] Keyword[boolean] identifier[disableSaslClient] operator[=] identifier[configuration] operator[SEP] identifier[getBoolean] operator[SEP] identifier[SecurityOptions] operator[SEP] identifier[ZOOKEEPER_SASL_DISABLE] operator[SEP] operator[SEP] identifier[ACLProvider] identifier[aclProvider] operator[SEP] identifier[ZkClientACLMode] identifier[aclMode] operator[=] identifier[ZkClientACLMode] operator[SEP] identifier[fromConfig] operator[SEP] identifier[configuration] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[disableSaslClient] operator[&&] identifier[aclMode] operator[==] identifier[ZkClientACLMode] operator[SEP] identifier[CREATOR] operator[SEP] {
identifier[String] identifier[errorMessage] operator[=] literal[String] operator[+] identifier[aclMode] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[SecurityOptions] operator[SEP] identifier[ZOOKEEPER_SASL_DISABLE] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] identifier[LOG] operator[SEP] identifier[warn] operator[SEP] identifier[errorMessage] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalConfigurationException] operator[SEP] identifier[errorMessage] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[aclMode] operator[==] identifier[ZkClientACLMode] operator[SEP] identifier[CREATOR] operator[SEP] {
identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[aclProvider] operator[=] Keyword[new] identifier[SecureAclProvider] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[aclProvider] operator[=] Keyword[new] identifier[DefaultACLProvider] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[rootWithNamespace] operator[=] identifier[generateZookeeperPath] operator[SEP] identifier[root] , identifier[namespace] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[rootWithNamespace] operator[SEP] operator[SEP] identifier[CuratorFramework] identifier[cf] operator[=] identifier[CuratorFrameworkFactory] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[connectString] operator[SEP] identifier[zkQuorum] operator[SEP] operator[SEP] identifier[sessionTimeoutMs] operator[SEP] identifier[sessionTimeout] operator[SEP] operator[SEP] identifier[connectionTimeoutMs] operator[SEP] identifier[connectionTimeout] operator[SEP] operator[SEP] identifier[retryPolicy] operator[SEP] Keyword[new] identifier[ExponentialBackoffRetry] operator[SEP] identifier[retryWait] , identifier[maxRetryAttempts] operator[SEP] operator[SEP] operator[SEP] identifier[namespace] operator[SEP] identifier[rootWithNamespace] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[?] identifier[rootWithNamespace] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[:] identifier[rootWithNamespace] operator[SEP] operator[SEP] identifier[aclProvider] operator[SEP] identifier[aclProvider] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[cf] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[cf] operator[SEP]
}
|
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{
return (XString)getArg0AsString(xctxt);
} | class class_name[name] begin[{]
method[execute, return_type[type[XObject]], modifier[public], parameter[xctxt]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=xctxt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getArg0AsString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=XString, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[XObject] identifier[execute] operator[SEP] identifier[XPathContext] identifier[xctxt] operator[SEP] Keyword[throws] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[transform] operator[SEP] identifier[TransformerException] {
Keyword[return] operator[SEP] identifier[XString] operator[SEP] identifier[getArg0AsString] operator[SEP] identifier[xctxt] operator[SEP] operator[SEP]
}
|
public void setValidTable(TableCandidate tc)
{
/**
* TODO [improve]: Table/TableCandidate not match
* */
this.setHeight(tc.getHeight());
this.setWidth(tc.getWidth());
this.setCaption(tc.getCaption());
this.setRowNumber(tc.getRows().size());
this.setColumnNumber(tc.getColumnNum_thisTable());
this.setRefTextList(tc.getRefText());
this.setFootNote(tc.getFootnoteText());
this.setHeading(tc.getColumnHeadings());
this.setBody(tc.getTableContent());
} | class class_name[name] begin[{]
method[setValidTable, return_type[void], modifier[public], parameter[tc]] begin[{]
THIS[call[None.setHeight, parameter[call[tc.getHeight, parameter[]]]]]
THIS[call[None.setWidth, parameter[call[tc.getWidth, parameter[]]]]]
THIS[call[None.setCaption, parameter[call[tc.getCaption, parameter[]]]]]
THIS[call[None.setRowNumber, parameter[call[tc.getRows, parameter[]]]]]
THIS[call[None.setColumnNumber, parameter[call[tc.getColumnNum_thisTable, parameter[]]]]]
THIS[call[None.setRefTextList, parameter[call[tc.getRefText, parameter[]]]]]
THIS[call[None.setFootNote, parameter[call[tc.getFootnoteText, parameter[]]]]]
THIS[call[None.setHeading, parameter[call[tc.getColumnHeadings, parameter[]]]]]
THIS[call[None.setBody, parameter[call[tc.getTableContent, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setValidTable] operator[SEP] identifier[TableCandidate] identifier[tc] operator[SEP] {
Keyword[this] operator[SEP] identifier[setHeight] operator[SEP] identifier[tc] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setWidth] operator[SEP] identifier[tc] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setCaption] operator[SEP] identifier[tc] operator[SEP] identifier[getCaption] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setRowNumber] operator[SEP] identifier[tc] operator[SEP] identifier[getRows] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setColumnNumber] operator[SEP] identifier[tc] operator[SEP] identifier[getColumnNum_thisTable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setRefTextList] operator[SEP] identifier[tc] operator[SEP] identifier[getRefText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setFootNote] operator[SEP] identifier[tc] operator[SEP] identifier[getFootnoteText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setHeading] operator[SEP] identifier[tc] operator[SEP] identifier[getColumnHeadings] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setBody] operator[SEP] identifier[tc] operator[SEP] identifier[getTableContent] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String decodeURN(String urn) {
String publicId = "";
if (urn.startsWith("urn:publicid:")) {
publicId = urn.substring(13);
} else {
return urn;
}
publicId = PublicId.stringReplace(publicId, "%2F", "/");
publicId = PublicId.stringReplace(publicId, ":", "//");
publicId = PublicId.stringReplace(publicId, "%3A", ":");
publicId = PublicId.stringReplace(publicId, ";", "::");
publicId = PublicId.stringReplace(publicId, "+", " ");
publicId = PublicId.stringReplace(publicId, "%2B", "+");
publicId = PublicId.stringReplace(publicId, "%23", "#");
publicId = PublicId.stringReplace(publicId, "%3F", "?");
publicId = PublicId.stringReplace(publicId, "%27", "'");
publicId = PublicId.stringReplace(publicId, "%3B", ";");
publicId = PublicId.stringReplace(publicId, "%25", "%");
return publicId;
} | class class_name[name] begin[{]
method[decodeURN, return_type[type[String]], modifier[public static], parameter[urn]] begin[{]
local_variable[type[String], publicId]
if[call[urn.startsWith, parameter[literal["urn:publicid:"]]]] begin[{]
assign[member[.publicId], call[urn.substring, parameter[literal[13]]]]
else begin[{]
return[member[.urn]]
end[}]
assign[member[.publicId], call[PublicId.stringReplace, parameter[member[.publicId], literal["%2F"], literal["/"]]]]
assign[member[.publicId], call[PublicId.stringReplace, parameter[member[.publicId], literal[":"], literal["//"]]]]
assign[member[.publicId], call[PublicId.stringReplace, parameter[member[.publicId], literal["%3A"], literal[":"]]]]
assign[member[.publicId], call[PublicId.stringReplace, parameter[member[.publicId], literal[";"], literal["::"]]]]
assign[member[.publicId], call[PublicId.stringReplace, parameter[member[.publicId], literal["+"], literal[" "]]]]
assign[member[.publicId], call[PublicId.stringReplace, parameter[member[.publicId], literal["%2B"], literal["+"]]]]
assign[member[.publicId], call[PublicId.stringReplace, parameter[member[.publicId], literal["%23"], literal["#"]]]]
assign[member[.publicId], call[PublicId.stringReplace, parameter[member[.publicId], literal["%3F"], literal["?"]]]]
assign[member[.publicId], call[PublicId.stringReplace, parameter[member[.publicId], literal["%27"], literal["'"]]]]
assign[member[.publicId], call[PublicId.stringReplace, parameter[member[.publicId], literal["%3B"], literal[";"]]]]
assign[member[.publicId], call[PublicId.stringReplace, parameter[member[.publicId], literal["%25"], literal["%"]]]]
return[member[.publicId]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[decodeURN] operator[SEP] identifier[String] identifier[urn] operator[SEP] {
identifier[String] identifier[publicId] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[urn] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[publicId] operator[=] identifier[urn] operator[SEP] identifier[substring] operator[SEP] Other[13] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[urn] operator[SEP]
}
identifier[publicId] operator[=] identifier[PublicId] operator[SEP] identifier[stringReplace] operator[SEP] identifier[publicId] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[publicId] operator[=] identifier[PublicId] operator[SEP] identifier[stringReplace] operator[SEP] identifier[publicId] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[publicId] operator[=] identifier[PublicId] operator[SEP] identifier[stringReplace] operator[SEP] identifier[publicId] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[publicId] operator[=] identifier[PublicId] operator[SEP] identifier[stringReplace] operator[SEP] identifier[publicId] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[publicId] operator[=] identifier[PublicId] operator[SEP] identifier[stringReplace] operator[SEP] identifier[publicId] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[publicId] operator[=] identifier[PublicId] operator[SEP] identifier[stringReplace] operator[SEP] identifier[publicId] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[publicId] operator[=] identifier[PublicId] operator[SEP] identifier[stringReplace] operator[SEP] identifier[publicId] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[publicId] operator[=] identifier[PublicId] operator[SEP] identifier[stringReplace] operator[SEP] identifier[publicId] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[publicId] operator[=] identifier[PublicId] operator[SEP] identifier[stringReplace] operator[SEP] identifier[publicId] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[publicId] operator[=] identifier[PublicId] operator[SEP] identifier[stringReplace] operator[SEP] identifier[publicId] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[publicId] operator[=] identifier[PublicId] operator[SEP] identifier[stringReplace] operator[SEP] identifier[publicId] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[publicId] operator[SEP]
}
|
public void syncStorageKeys(String resourceGroupName, String mediaServiceName, String id) {
syncStorageKeysWithServiceResponseAsync(resourceGroupName, mediaServiceName, id).toBlocking().single().body();
} | class class_name[name] begin[{]
method[syncStorageKeys, return_type[void], modifier[public], parameter[resourceGroupName, mediaServiceName, id]] begin[{]
call[.syncStorageKeysWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.mediaServiceName], member[.id]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[syncStorageKeys] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[mediaServiceName] , identifier[String] identifier[id] operator[SEP] {
identifier[syncStorageKeysWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[mediaServiceName] , identifier[id] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
|
public String getSnippetContent(Integer snippetId) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "snippets", snippetId, "raw");
return (response.readEntity(String.class));
} | class class_name[name] begin[{]
method[getSnippetContent, return_type[type[String]], modifier[public], parameter[snippetId]] begin[{]
local_variable[type[Response], response]
return[call[response.readEntity, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getSnippetContent] operator[SEP] identifier[Integer] identifier[snippetId] operator[SEP] Keyword[throws] identifier[GitLabApiException] {
identifier[Response] identifier[response] operator[=] identifier[get] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[OK] , Other[null] , literal[String] , identifier[snippetId] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[response] operator[SEP] identifier[readEntity] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case SarlPackage.SARL_CAPACITY_USES__CAPACITIES:
getCapacities().clear();
getCapacities().addAll((Collection<? extends JvmParameterizedTypeReference>)newValue);
return;
}
super.eSet(featureID, newValue);
} | class class_name[name] begin[{]
method[eSet, return_type[void], modifier[public], parameter[featureID, newValue]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=SARL_CAPACITY_USES__CAPACITIES, postfix_operators=[], prefix_operators=[], qualifier=SarlPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getCapacities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=clear, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getCapacities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=JvmParameterizedTypeReference, sub_type=None))], dimensions=[], name=Collection, sub_type=None))], member=addAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eSet] operator[SEP] Keyword[int] identifier[featureID] , identifier[Object] identifier[newValue] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[SarlPackage] operator[SEP] identifier[SARL_CAPACITY_USES__CAPACITIES] operator[:] identifier[getCapacities] operator[SEP] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[getCapacities] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] operator[SEP] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[JvmParameterizedTypeReference] operator[>] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[super] operator[SEP] identifier[eSet] operator[SEP] identifier[featureID] , identifier[newValue] operator[SEP] operator[SEP]
}
|
@Override
public void addEmptyTag(String tagName, String attrName, String attrValue)
{
_xml.addXML(_indent.toString());
_xml.addEmptyTag(tagName, attrName, attrValue);
_xml.addXML("\n");
} | class class_name[name] begin[{]
method[addEmptyTag, return_type[void], modifier[public], parameter[tagName, attrName, attrValue]] begin[{]
call[_xml.addXML, parameter[call[_indent.toString, parameter[]]]]
call[_xml.addEmptyTag, parameter[member[.tagName], member[.attrName], member[.attrValue]]]
call[_xml.addXML, parameter[literal["\n"]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[addEmptyTag] operator[SEP] identifier[String] identifier[tagName] , identifier[String] identifier[attrName] , identifier[String] identifier[attrValue] operator[SEP] {
identifier[_xml] operator[SEP] identifier[addXML] operator[SEP] identifier[_indent] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[_xml] operator[SEP] identifier[addEmptyTag] operator[SEP] identifier[tagName] , identifier[attrName] , identifier[attrValue] operator[SEP] operator[SEP] identifier[_xml] operator[SEP] identifier[addXML] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
private void lifeCycleExceptionHandler(Throwable t, EJBModuleMetaDataImpl mmd) // F743-14982
{
if (t instanceof RuntimeException) {
// Is the RuntimeException an application exception?
RuntimeException rtex = (RuntimeException) t;
if (mmd.getApplicationExceptionRollback(rtex) != null) // F743-14982
{
// Yes it is, which is not valid for lifecycle callback
// methods. So turn this into a system runtime exception.
InterceptorProxy w = ivInterceptorProxies[ivNextIndex - 1];
String lifeCycle = w.getMethodGenericString();
EJBException ex = ExceptionUtil.EJBException(lifeCycle
+ " is not allowed to throw an application exception", rtex);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "lifeCycleExceptionHandler throwing EJBException", ex);
}
throw ex;
} else {
// Not an application exception, so let the mapping
// strategy handle this system runtime exception.
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "lifeCycleExceptionHandler is rethrowing RuntimeException "
+ "from lifecycle callback method: " + t,
t);
}
throw rtex;
}
} else if (t instanceof Error) {
// Let the mapping strategy handle this unchecked exception.
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "lifeCycleExceptionHandler is rethrowing Error from "
+ "lifecycle callback method: " + t,
t);
}
throw (Error) t;
} else {
// Must be a checked exception, which should never happen since
// InterceptorMetaDataFactory throws EJBConfigurationException
// and does a Tr.error using message key of INVALID_LIFECYCLE_SIGNATURE_CNTR0231E
// if interceptor method throws clause is not empty. But if
// it does happen, wrap the exception in a special EJBException
// that does not include EJB container in the exception stack.
InterceptorProxy w = ivInterceptorProxies[ivNextIndex - 1]; // d367572.7
String lifeCycle = w.getMethodGenericString(); // d367572.7
EJBException ex = ExceptionUtil.EJBException(lifeCycle
+ " is not allowed to throw a checked exception", t);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) // d367572.7
{
Tr.debug(tc, "lifeCycleExceptionHandler throwing EJBException", ex);
}
throw ex;
}
} | class class_name[name] begin[{]
method[lifeCycleExceptionHandler, return_type[void], modifier[private], parameter[t, mmd]] begin[{]
if[binary_operation[member[.t], instanceof, type[RuntimeException]]] begin[{]
local_variable[type[RuntimeException], rtex]
if[binary_operation[call[mmd.getApplicationExceptionRollback, parameter[member[.rtex]]], !=, literal[null]]] begin[{]
local_variable[type[InterceptorProxy], w]
local_variable[type[String], lifeCycle]
local_variable[type[EJBException], ex]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], literal["lifeCycleExceptionHandler throwing EJBException"], member[.ex]]]
else begin[{]
None
end[}]
ThrowStatement(expression=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
else begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[literal["lifeCycleExceptionHandler is rethrowing RuntimeException "], +, literal["from lifecycle callback method: "]], +, member[.t]], member[.t]]]
else begin[{]
None
end[}]
ThrowStatement(expression=MemberReference(member=rtex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
else begin[{]
if[binary_operation[member[.t], instanceof, type[Error]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[literal["lifeCycleExceptionHandler is rethrowing Error from "], +, literal["lifecycle callback method: "]], +, member[.t]], member[.t]]]
else begin[{]
None
end[}]
ThrowStatement(expression=Cast(expression=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Error, sub_type=None)), label=None)
else begin[{]
local_variable[type[InterceptorProxy], w]
local_variable[type[String], lifeCycle]
local_variable[type[EJBException], ex]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], literal["lifeCycleExceptionHandler throwing EJBException"], member[.ex]]]
else begin[{]
None
end[}]
ThrowStatement(expression=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[lifeCycleExceptionHandler] operator[SEP] identifier[Throwable] identifier[t] , identifier[EJBModuleMetaDataImpl] identifier[mmd] operator[SEP] {
Keyword[if] operator[SEP] identifier[t] Keyword[instanceof] identifier[RuntimeException] operator[SEP] {
identifier[RuntimeException] identifier[rtex] operator[=] operator[SEP] identifier[RuntimeException] operator[SEP] identifier[t] operator[SEP] Keyword[if] operator[SEP] identifier[mmd] operator[SEP] identifier[getApplicationExceptionRollback] operator[SEP] identifier[rtex] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[InterceptorProxy] identifier[w] operator[=] identifier[ivInterceptorProxies] operator[SEP] identifier[ivNextIndex] operator[-] Other[1] operator[SEP] operator[SEP] identifier[String] identifier[lifeCycle] operator[=] identifier[w] operator[SEP] identifier[getMethodGenericString] operator[SEP] operator[SEP] operator[SEP] identifier[EJBException] identifier[ex] operator[=] identifier[ExceptionUtil] operator[SEP] identifier[EJBException] operator[SEP] identifier[lifeCycle] operator[+] literal[String] , identifier[rtex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , identifier[ex] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[ex] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] literal[String] operator[+] identifier[t] , identifier[t] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[rtex] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[t] Keyword[instanceof] identifier[Error] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] literal[String] operator[+] identifier[t] , identifier[t] operator[SEP] operator[SEP]
}
Keyword[throw] operator[SEP] identifier[Error] operator[SEP] identifier[t] operator[SEP]
}
Keyword[else] {
identifier[InterceptorProxy] identifier[w] operator[=] identifier[ivInterceptorProxies] operator[SEP] identifier[ivNextIndex] operator[-] Other[1] operator[SEP] operator[SEP] identifier[String] identifier[lifeCycle] operator[=] identifier[w] operator[SEP] identifier[getMethodGenericString] operator[SEP] operator[SEP] operator[SEP] identifier[EJBException] identifier[ex] operator[=] identifier[ExceptionUtil] operator[SEP] identifier[EJBException] operator[SEP] identifier[lifeCycle] operator[+] literal[String] , identifier[t] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , identifier[ex] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[ex] operator[SEP]
}
}
|
protected void setMapProperty(Map<String, Object> map, String name, Object value, FormMappingOption option, Object parentBean,
String parentName) {
final boolean strArray = isMapValueStringArray(parentBean, parentName);
final Object registered;
if (value instanceof String[]) {
final String[] values = (String[]) value;
registered = strArray ? values : values.length > 0 ? values[0] : null;
} else {
registered = strArray ? (value != null ? new String[] { value.toString() } : EMPTY_STRING_ARRAY) : value;
}
map.put(name, filterIfSimpleText(registered, option, name, map.getClass()));
} | class class_name[name] begin[{]
method[setMapProperty, return_type[void], modifier[protected], parameter[map, name, value, option, parentBean, parentName]] begin[{]
local_variable[type[boolean], strArray]
local_variable[type[Object], registered]
if[binary_operation[member[.value], instanceof, type[String]]] begin[{]
local_variable[type[String], values]
assign[member[.registered], TernaryExpression(condition=MemberReference(member=strArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])), if_true=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
else begin[{]
assign[member[.registered], TernaryExpression(condition=MemberReference(member=strArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=EMPTY_STRING_ARRAY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))))]
end[}]
call[map.put, parameter[member[.name], call[.filterIfSimpleText, parameter[member[.registered], member[.option], member[.name], call[map.getClass, parameter[]]]]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[setMapProperty] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[map] , identifier[String] identifier[name] , identifier[Object] identifier[value] , identifier[FormMappingOption] identifier[option] , identifier[Object] identifier[parentBean] , identifier[String] identifier[parentName] operator[SEP] {
Keyword[final] Keyword[boolean] identifier[strArray] operator[=] identifier[isMapValueStringArray] operator[SEP] identifier[parentBean] , identifier[parentName] operator[SEP] operator[SEP] Keyword[final] identifier[Object] identifier[registered] operator[SEP] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[String] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[values] operator[=] operator[SEP] identifier[String] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[SEP] identifier[registered] operator[=] identifier[strArray] operator[?] identifier[values] operator[:] identifier[values] operator[SEP] identifier[length] operator[>] Other[0] operator[?] identifier[values] operator[SEP] Other[0] operator[SEP] operator[:] Other[null] operator[SEP]
}
Keyword[else] {
identifier[registered] operator[=] identifier[strArray] operator[?] operator[SEP] identifier[value] operator[!=] Other[null] operator[?] Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP]
} operator[:] identifier[EMPTY_STRING_ARRAY] operator[SEP] operator[:] identifier[value] operator[SEP]
}
identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[filterIfSimpleText] operator[SEP] identifier[registered] , identifier[option] , identifier[name] , identifier[map] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void e(String msg, Throwable tr) {
println(LogLevel.ERROR, msg, tr);
} | class class_name[name] begin[{]
method[e, return_type[void], modifier[public], parameter[msg, tr]] begin[{]
call[.println, parameter[member[LogLevel.ERROR], member[.msg], member[.tr]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[e] operator[SEP] identifier[String] identifier[msg] , identifier[Throwable] identifier[tr] operator[SEP] {
identifier[println] operator[SEP] identifier[LogLevel] operator[SEP] identifier[ERROR] , identifier[msg] , identifier[tr] operator[SEP] operator[SEP]
}
|
public int compareTo(Version ver)
{
int[] otherComponents = ver._components;
// work out the minimum length of the components for each version.
int mylen = _components.length;
int otherlen = otherComponents.length;
// work out if the other one is longer than this one.
boolean longer = (mylen < otherlen);
int minLen = (longer ? mylen : otherlen);
// loop around all the entries up to the minimum length
int i = 0;
for ( i=0; i < minLen; i++ )
{
int firstVal = _components[i];
int secondVal = otherComponents[i];
if ( firstVal < secondVal ) return -1;
if ( firstVal > secondVal ) return 1;
}
if (mylen != otherlen)
{
// if we are here then we know that so far they are equal.
// In order for them to be truly equal the longer one must
// contain only zeros. Otherwise the longer version is
// higher than the shorter version.
if (longer)
{
for (int j = i+1; j<otherlen; j++)
{
if (otherComponents[j] != 0) return -1;
}
}
else
{
for (int j = i+1; j<mylen; j++)
{
if (_components[j] != 0) return 1;
}
}
}
// if we get here then they are equal.
return 0;
} | class class_name[name] begin[{]
method[compareTo, return_type[type[int]], modifier[public], parameter[ver]] begin[{]
local_variable[type[int], otherComponents]
local_variable[type[int], mylen]
local_variable[type[int], otherlen]
local_variable[type[boolean], longer]
local_variable[type[int], minLen]
local_variable[type[int], i]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=_components, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=firstVal)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=otherComponents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=secondVal)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=firstVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=secondVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=firstVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=secondVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=minLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[binary_operation[member[.mylen], !=, member[.otherlen]]] begin[{]
if[member[.longer]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=otherComponents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=otherlen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_components, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mylen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
else begin[{]
None
end[}]
return[literal[0]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[compareTo] operator[SEP] identifier[Version] identifier[ver] operator[SEP] {
Keyword[int] operator[SEP] operator[SEP] identifier[otherComponents] operator[=] identifier[ver] operator[SEP] identifier[_components] operator[SEP] Keyword[int] identifier[mylen] operator[=] identifier[_components] operator[SEP] identifier[length] operator[SEP] Keyword[int] identifier[otherlen] operator[=] identifier[otherComponents] operator[SEP] identifier[length] operator[SEP] Keyword[boolean] identifier[longer] operator[=] operator[SEP] identifier[mylen] operator[<] identifier[otherlen] operator[SEP] operator[SEP] Keyword[int] identifier[minLen] operator[=] operator[SEP] identifier[longer] operator[?] identifier[mylen] operator[:] identifier[otherlen] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[minLen] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[int] identifier[firstVal] operator[=] identifier[_components] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[secondVal] operator[=] identifier[otherComponents] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[firstVal] operator[<] identifier[secondVal] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[firstVal] operator[>] identifier[secondVal] operator[SEP] Keyword[return] Other[1] operator[SEP]
}
Keyword[if] operator[SEP] identifier[mylen] operator[!=] identifier[otherlen] operator[SEP] {
Keyword[if] operator[SEP] identifier[longer] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[i] operator[+] Other[1] operator[SEP] identifier[j] operator[<] identifier[otherlen] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[otherComponents] operator[SEP] identifier[j] operator[SEP] operator[!=] Other[0] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP]
}
}
Keyword[else] {
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[i] operator[+] Other[1] operator[SEP] identifier[j] operator[<] identifier[mylen] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[_components] operator[SEP] identifier[j] operator[SEP] operator[!=] Other[0] operator[SEP] Keyword[return] Other[1] operator[SEP]
}
}
}
Keyword[return] Other[0] operator[SEP]
}
|
@Override
@Deprecated
public <T> List<ComponentDescriptor<T>> getComponentDescriptorList(Class<T> role)
{
return getComponentManager().getComponentDescriptorList(role);
} | class class_name[name] begin[{]
method[getComponentDescriptorList, return_type[type[List]], modifier[public], parameter[role]] begin[{]
return[call[.getComponentManager, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] annotation[@] identifier[Deprecated] Keyword[public] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[ComponentDescriptor] operator[<] identifier[T] operator[>] operator[>] identifier[getComponentDescriptorList] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[role] operator[SEP] {
Keyword[return] identifier[getComponentManager] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentDescriptorList] operator[SEP] identifier[role] operator[SEP] operator[SEP]
}
|
private boolean isClearShiroAnnotationPresent(Method method) {
Annotation a = method.getAnnotation(ClearShiro.class);
return a != null;
} | class class_name[name] begin[{]
method[isClearShiroAnnotationPresent, return_type[type[boolean]], modifier[private], parameter[method]] begin[{]
local_variable[type[Annotation], a]
return[binary_operation[member[.a], !=, literal[null]]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[isClearShiroAnnotationPresent] operator[SEP] identifier[Method] identifier[method] operator[SEP] {
identifier[Annotation] identifier[a] operator[=] identifier[method] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[ClearShiro] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[a] operator[!=] Other[null] operator[SEP]
}
|
protected void postLayoutChild(final int dataIndex) {
if (!mContainer.isDynamic()) {
boolean visibleInLayout = !mViewPort.isClippingEnabled() || inViewPort(dataIndex);
ViewPortVisibility visibility = visibleInLayout ?
ViewPortVisibility.FULLY_VISIBLE : ViewPortVisibility.INVISIBLE;
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "onLayout: child with dataId [%d] viewportVisibility = %s",
dataIndex, visibility);
Widget childWidget = mContainer.get(dataIndex);
if (childWidget != null) {
childWidget.setViewPortVisibility(visibility);
}
}
} | class class_name[name] begin[{]
method[postLayoutChild, return_type[void], modifier[protected], parameter[dataIndex]] begin[{]
if[call[mContainer.isDynamic, parameter[]]] begin[{]
local_variable[type[boolean], visibleInLayout]
local_variable[type[ViewPortVisibility], visibility]
call[Log.d, parameter[member[Log.SUBSYSTEM.LAYOUT], member[.TAG], literal["onLayout: child with dataId [%d] viewportVisibility = %s"], member[.dataIndex], member[.visibility]]]
local_variable[type[Widget], childWidget]
if[binary_operation[member[.childWidget], !=, literal[null]]] begin[{]
call[childWidget.setViewPortVisibility, parameter[member[.visibility]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[postLayoutChild] operator[SEP] Keyword[final] Keyword[int] identifier[dataIndex] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[mContainer] operator[SEP] identifier[isDynamic] operator[SEP] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[visibleInLayout] operator[=] operator[!] identifier[mViewPort] operator[SEP] identifier[isClippingEnabled] operator[SEP] operator[SEP] operator[||] identifier[inViewPort] operator[SEP] identifier[dataIndex] operator[SEP] operator[SEP] identifier[ViewPortVisibility] identifier[visibility] operator[=] identifier[visibleInLayout] operator[?] identifier[ViewPortVisibility] operator[SEP] identifier[FULLY_VISIBLE] operator[:] identifier[ViewPortVisibility] operator[SEP] identifier[INVISIBLE] operator[SEP] identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[Log] operator[SEP] identifier[SUBSYSTEM] operator[SEP] identifier[LAYOUT] , identifier[TAG] , literal[String] , identifier[dataIndex] , identifier[visibility] operator[SEP] operator[SEP] identifier[Widget] identifier[childWidget] operator[=] identifier[mContainer] operator[SEP] identifier[get] operator[SEP] identifier[dataIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[childWidget] operator[!=] Other[null] operator[SEP] {
identifier[childWidget] operator[SEP] identifier[setViewPortVisibility] operator[SEP] identifier[visibility] operator[SEP] operator[SEP]
}
}
}
|
public Rule longestString(final String first, final String second,
final String... others)
{
return trie(first, second, others);
} | class class_name[name] begin[{]
method[longestString, return_type[type[Rule]], modifier[public], parameter[first, second, others]] begin[{]
return[call[.trie, parameter[member[.first], member[.second], member[.others]]]]
end[}]
END[}] | Keyword[public] identifier[Rule] identifier[longestString] operator[SEP] Keyword[final] identifier[String] identifier[first] , Keyword[final] identifier[String] identifier[second] , Keyword[final] identifier[String] operator[...] identifier[others] operator[SEP] {
Keyword[return] identifier[trie] operator[SEP] identifier[first] , identifier[second] , identifier[others] operator[SEP] operator[SEP]
}
|
public synchronized EvernoteLinkedNotebookHelper getLinkedNotebookHelper(@NonNull LinkedNotebook linkedNotebook)
throws EDAMUserException, EDAMSystemException, EDAMNotFoundException, TException {
String key = linkedNotebook.getGuid();
EvernoteLinkedNotebookHelper notebookHelper = mLinkedNotebookHelpers.get(key);
if (notebookHelper == null) {
notebookHelper = createLinkedNotebookHelper(linkedNotebook);
mLinkedNotebookHelpers.put(key, notebookHelper);
}
return notebookHelper;
} | class class_name[name] begin[{]
method[getLinkedNotebookHelper, return_type[type[EvernoteLinkedNotebookHelper]], modifier[synchronized public], parameter[linkedNotebook]] begin[{]
local_variable[type[String], key]
local_variable[type[EvernoteLinkedNotebookHelper], notebookHelper]
if[binary_operation[member[.notebookHelper], ==, literal[null]]] begin[{]
assign[member[.notebookHelper], call[.createLinkedNotebookHelper, parameter[member[.linkedNotebook]]]]
call[mLinkedNotebookHelpers.put, parameter[member[.key], member[.notebookHelper]]]
else begin[{]
None
end[}]
return[member[.notebookHelper]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] identifier[EvernoteLinkedNotebookHelper] identifier[getLinkedNotebookHelper] operator[SEP] annotation[@] identifier[NonNull] identifier[LinkedNotebook] identifier[linkedNotebook] operator[SEP] Keyword[throws] identifier[EDAMUserException] , identifier[EDAMSystemException] , identifier[EDAMNotFoundException] , identifier[TException] {
identifier[String] identifier[key] operator[=] identifier[linkedNotebook] operator[SEP] identifier[getGuid] operator[SEP] operator[SEP] operator[SEP] identifier[EvernoteLinkedNotebookHelper] identifier[notebookHelper] operator[=] identifier[mLinkedNotebookHelpers] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[notebookHelper] operator[==] Other[null] operator[SEP] {
identifier[notebookHelper] operator[=] identifier[createLinkedNotebookHelper] operator[SEP] identifier[linkedNotebook] operator[SEP] operator[SEP] identifier[mLinkedNotebookHelpers] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[notebookHelper] operator[SEP] operator[SEP]
}
Keyword[return] identifier[notebookHelper] operator[SEP]
}
|
@GuardedBy("lock")
protected void move(int num_rows) {
if(num_rows <= 0 || num_rows > matrix.length)
return;
int target_index=0;
for(int i=num_rows; i < matrix.length; i++)
matrix[target_index++]=matrix[i];
for(int i=matrix.length - num_rows; i < matrix.length; i++)
matrix[i]=null;
num_moves++;
} | class class_name[name] begin[{]
method[move, return_type[void], modifier[protected], parameter[num_rows]] begin[{]
if[binary_operation[binary_operation[member[.num_rows], <=, literal[0]], ||, binary_operation[member[.num_rows], >, member[matrix.length]]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[int], target_index]
ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=target_index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=matrix, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=num_rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), 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=matrix, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=matrix, selectors=[]), operandr=MemberReference(member=num_rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
member[.num_moves]
end[}]
END[}] | annotation[@] identifier[GuardedBy] operator[SEP] literal[String] operator[SEP] Keyword[protected] Keyword[void] identifier[move] operator[SEP] Keyword[int] identifier[num_rows] operator[SEP] {
Keyword[if] operator[SEP] identifier[num_rows] operator[<=] Other[0] operator[||] identifier[num_rows] operator[>] identifier[matrix] operator[SEP] identifier[length] operator[SEP] Keyword[return] operator[SEP] Keyword[int] identifier[target_index] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[num_rows] operator[SEP] identifier[i] operator[<] identifier[matrix] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[matrix] operator[SEP] identifier[target_index] operator[++] operator[SEP] operator[=] identifier[matrix] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[matrix] operator[SEP] identifier[length] operator[-] identifier[num_rows] operator[SEP] identifier[i] operator[<] identifier[matrix] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[matrix] operator[SEP] identifier[i] operator[SEP] operator[=] Other[null] operator[SEP] identifier[num_moves] operator[++] operator[SEP]
}
|
@Override
public double[] getVotesForInstance(Instance inst)
{
double[] votes = {0.5, 0.5};
if(this.neighbourhood.size() > 2)
{
votes[1] = Math.pow(2.0, -1.0 * this.getAnomalyScore(inst) / this.tau);
votes[0] = 1.0 - votes[1];
}
return votes;
} | class class_name[name] begin[{]
method[getVotesForInstance, return_type[type[double]], modifier[public], parameter[inst]] begin[{]
local_variable[type[double], votes]
if[binary_operation[THIS[member[None.neighbourhood]call[None.size, parameter[]]], >, literal[2]]] begin[{]
assign[member[.votes], call[Math.pow, parameter[literal[2.0], binary_operation[binary_operation[literal[1.0], *, THIS[call[None.getAnomalyScore, parameter[member[.inst]]]]], /, THIS[member[None.tau]]]]]]
assign[member[.votes], binary_operation[literal[1.0], -, member[.votes]]]
else begin[{]
None
end[}]
return[member[.votes]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[double] operator[SEP] operator[SEP] identifier[getVotesForInstance] operator[SEP] identifier[Instance] identifier[inst] operator[SEP] {
Keyword[double] operator[SEP] operator[SEP] identifier[votes] operator[=] {
literal[Float] , literal[Float]
} operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[neighbourhood] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[2] operator[SEP] {
identifier[votes] operator[SEP] Other[1] operator[SEP] operator[=] identifier[Math] operator[SEP] identifier[pow] operator[SEP] literal[Float] , operator[-] literal[Float] operator[*] Keyword[this] operator[SEP] identifier[getAnomalyScore] operator[SEP] identifier[inst] operator[SEP] operator[/] Keyword[this] operator[SEP] identifier[tau] operator[SEP] operator[SEP] identifier[votes] operator[SEP] Other[0] operator[SEP] operator[=] literal[Float] operator[-] identifier[votes] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
Keyword[return] identifier[votes] operator[SEP]
}
|
public static boolean contains(String name, Iterable<String> patterns) {
String nameUpper = name.toUpperCase();
for (String pattern : patterns) {
String patternUpper = pattern.toUpperCase();
if (nameUpper.equals(patternUpper) || nameUpper.contains(patternUpper)) {
return true;
}
}
return false;
} | class class_name[name] begin[{]
method[contains, return_type[type[boolean]], modifier[public static], parameter[name, patterns]] begin[{]
local_variable[type[String], nameUpper]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), name=patternUpper)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=patternUpper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=nameUpper, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=patternUpper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=nameUpper, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=patterns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pattern)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[contains] operator[SEP] identifier[String] identifier[name] , identifier[Iterable] operator[<] identifier[String] operator[>] identifier[patterns] operator[SEP] {
identifier[String] identifier[nameUpper] operator[=] identifier[name] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[pattern] operator[:] identifier[patterns] operator[SEP] {
identifier[String] identifier[patternUpper] operator[=] identifier[pattern] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nameUpper] operator[SEP] identifier[equals] operator[SEP] identifier[patternUpper] operator[SEP] operator[||] identifier[nameUpper] operator[SEP] identifier[contains] operator[SEP] identifier[patternUpper] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public final List<T> findSortedByQuery(String query, String sort, Object... params) {
return this.findSortedByQuery(query, sort, (Integer) null, (Integer) null, params);
} | class class_name[name] begin[{]
method[findSortedByQuery, return_type[type[List]], modifier[final public], parameter[query, sort, params]] begin[{]
return[THIS[call[None.findSortedByQuery, parameter[member[.query], member[.sort], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), member[.params]]]]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[List] operator[<] identifier[T] operator[>] identifier[findSortedByQuery] operator[SEP] identifier[String] identifier[query] , identifier[String] identifier[sort] , identifier[Object] operator[...] identifier[params] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[findSortedByQuery] operator[SEP] identifier[query] , identifier[sort] , operator[SEP] identifier[Integer] operator[SEP] Other[null] , operator[SEP] identifier[Integer] operator[SEP] Other[null] , identifier[params] operator[SEP] operator[SEP]
}
|
@FFDCIgnore(IllegalArgumentException.class)
private void definePackage(final ByteResourceInformation classBytesResourceInformation, String packageName) {
/*
* We don't extend URL classloader so we automatically pass the manifest from the JAR to our supertype, still try to get hold of it though so that we can see if
* we can load the information ourselves from it
*/
Manifest manifest = classBytesResourceInformation.getManifest();
try {
if (manifest == null) {
definePackage(packageName, null, null, null, null, null, null, null);
} else {
String classResourceName = classBytesResourceInformation.getResourcePath();
/*
* Strip the class name off the end of the package, should always have at least one '/' as we have at least one . in the name, also end with a trailing
* '/' to match the name style for package definitions in manifest files
*/
String packageResourceName = classResourceName.substring(0, classResourceName.lastIndexOf('/') + 1);
// Default all of the package info to null
String specTitle = null;
String specVersion = null;
String specVendor = null;
String implTitle = null;
String implVersion = null;
String implVendor = null;
URL sealBaseUrl = null;
// See if there is a package defined in the manifest
Attributes packageAttributes = manifest.getAttributes(packageResourceName);
if (packageAttributes != null && !packageAttributes.isEmpty()) {
specTitle = packageAttributes.getValue(Attributes.Name.SPECIFICATION_TITLE);
specVersion = packageAttributes.getValue(Attributes.Name.SPECIFICATION_VERSION);
specVendor = packageAttributes.getValue(Attributes.Name.SPECIFICATION_VENDOR);
implTitle = packageAttributes.getValue(Attributes.Name.IMPLEMENTATION_TITLE);
implVersion = packageAttributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
implVendor = packageAttributes.getValue(Attributes.Name.IMPLEMENTATION_VENDOR);
String sealedValue = packageAttributes.getValue(Attributes.Name.SEALED);
if (sealedValue != null && Boolean.parseBoolean(sealedValue)) {
sealBaseUrl = classBytesResourceInformation.getResourceUrl();
}
}
definePackage(packageName, specTitle, specVersion, specVendor, implTitle, implVersion, implVendor, sealBaseUrl);
}
} catch (IllegalArgumentException ignored) {
// This happens if the package is already defined but it is hard to guard against this in a thread safe way. See:
// http://bugs.sun.com/view_bug.do?bug_id=4841786
}
} | class class_name[name] begin[{]
method[definePackage, return_type[void], modifier[private], parameter[classBytesResourceInformation, packageName]] begin[{]
local_variable[type[Manifest], manifest]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=manifest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResourcePath, postfix_operators=[], prefix_operators=[], qualifier=classBytesResourceInformation, selectors=[], type_arguments=None), name=classResourceName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/')], member=lastIndexOf, postfix_operators=[], prefix_operators=[], qualifier=classResourceName, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=classResourceName, selectors=[], type_arguments=None), name=packageResourceName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=specTitle)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=specVersion)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=specVendor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=implTitle)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=implVersion)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=implVendor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=sealBaseUrl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=packageResourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=manifest, selectors=[], type_arguments=None), name=packageAttributes)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attributes, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=packageAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=packageAttributes, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=specTitle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=SPECIFICATION_TITLE, postfix_operators=[], prefix_operators=[], qualifier=Attributes.Name, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=packageAttributes, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=specVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=SPECIFICATION_VERSION, postfix_operators=[], prefix_operators=[], qualifier=Attributes.Name, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=packageAttributes, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=specVendor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=SPECIFICATION_VENDOR, postfix_operators=[], prefix_operators=[], qualifier=Attributes.Name, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=packageAttributes, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=implTitle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=IMPLEMENTATION_TITLE, postfix_operators=[], prefix_operators=[], qualifier=Attributes.Name, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=packageAttributes, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=implVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=IMPLEMENTATION_VERSION, postfix_operators=[], prefix_operators=[], qualifier=Attributes.Name, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=packageAttributes, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=implVendor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=IMPLEMENTATION_VENDOR, postfix_operators=[], prefix_operators=[], qualifier=Attributes.Name, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=packageAttributes, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=SEALED, postfix_operators=[], prefix_operators=[], qualifier=Attributes.Name, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=packageAttributes, selectors=[], type_arguments=None), name=sealedValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=sealedValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=sealedValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseBoolean, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sealBaseUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getResourceUrl, postfix_operators=[], prefix_operators=[], qualifier=classBytesResourceInformation, selectors=[], type_arguments=None)), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=specTitle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=specVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=specVendor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=implTitle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=implVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=implVendor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sealBaseUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=definePackage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=packageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=definePackage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[FFDCIgnore] operator[SEP] identifier[IllegalArgumentException] operator[SEP] Keyword[class] operator[SEP] Keyword[private] Keyword[void] identifier[definePackage] operator[SEP] Keyword[final] identifier[ByteResourceInformation] identifier[classBytesResourceInformation] , identifier[String] identifier[packageName] operator[SEP] {
identifier[Manifest] identifier[manifest] operator[=] identifier[classBytesResourceInformation] operator[SEP] identifier[getManifest] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[manifest] operator[==] Other[null] operator[SEP] {
identifier[definePackage] operator[SEP] identifier[packageName] , Other[null] , Other[null] , Other[null] , Other[null] , Other[null] , Other[null] , Other[null] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[String] identifier[classResourceName] operator[=] identifier[classBytesResourceInformation] operator[SEP] identifier[getResourcePath] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[packageResourceName] operator[=] identifier[classResourceName] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[classResourceName] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] identifier[String] identifier[specTitle] operator[=] Other[null] operator[SEP] identifier[String] identifier[specVersion] operator[=] Other[null] operator[SEP] identifier[String] identifier[specVendor] operator[=] Other[null] operator[SEP] identifier[String] identifier[implTitle] operator[=] Other[null] operator[SEP] identifier[String] identifier[implVersion] operator[=] Other[null] operator[SEP] identifier[String] identifier[implVendor] operator[=] Other[null] operator[SEP] identifier[URL] identifier[sealBaseUrl] operator[=] Other[null] operator[SEP] identifier[Attributes] identifier[packageAttributes] operator[=] identifier[manifest] operator[SEP] identifier[getAttributes] operator[SEP] identifier[packageResourceName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[packageAttributes] operator[!=] Other[null] operator[&&] operator[!] identifier[packageAttributes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[specTitle] operator[=] identifier[packageAttributes] operator[SEP] identifier[getValue] operator[SEP] identifier[Attributes] operator[SEP] identifier[Name] operator[SEP] identifier[SPECIFICATION_TITLE] operator[SEP] operator[SEP] identifier[specVersion] operator[=] identifier[packageAttributes] operator[SEP] identifier[getValue] operator[SEP] identifier[Attributes] operator[SEP] identifier[Name] operator[SEP] identifier[SPECIFICATION_VERSION] operator[SEP] operator[SEP] identifier[specVendor] operator[=] identifier[packageAttributes] operator[SEP] identifier[getValue] operator[SEP] identifier[Attributes] operator[SEP] identifier[Name] operator[SEP] identifier[SPECIFICATION_VENDOR] operator[SEP] operator[SEP] identifier[implTitle] operator[=] identifier[packageAttributes] operator[SEP] identifier[getValue] operator[SEP] identifier[Attributes] operator[SEP] identifier[Name] operator[SEP] identifier[IMPLEMENTATION_TITLE] operator[SEP] operator[SEP] identifier[implVersion] operator[=] identifier[packageAttributes] operator[SEP] identifier[getValue] operator[SEP] identifier[Attributes] operator[SEP] identifier[Name] operator[SEP] identifier[IMPLEMENTATION_VERSION] operator[SEP] operator[SEP] identifier[implVendor] operator[=] identifier[packageAttributes] operator[SEP] identifier[getValue] operator[SEP] identifier[Attributes] operator[SEP] identifier[Name] operator[SEP] identifier[IMPLEMENTATION_VENDOR] operator[SEP] operator[SEP] identifier[String] identifier[sealedValue] operator[=] identifier[packageAttributes] operator[SEP] identifier[getValue] operator[SEP] identifier[Attributes] operator[SEP] identifier[Name] operator[SEP] identifier[SEALED] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sealedValue] operator[!=] Other[null] operator[&&] identifier[Boolean] operator[SEP] identifier[parseBoolean] operator[SEP] identifier[sealedValue] operator[SEP] operator[SEP] {
identifier[sealBaseUrl] operator[=] identifier[classBytesResourceInformation] operator[SEP] identifier[getResourceUrl] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[definePackage] operator[SEP] identifier[packageName] , identifier[specTitle] , identifier[specVersion] , identifier[specVendor] , identifier[implTitle] , identifier[implVersion] , identifier[implVendor] , identifier[sealBaseUrl] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[ignored] operator[SEP] {
}
}
|
private void addMVScalar() {
Set<String> values = new HashSet<>(m_dbObj.getFieldValues(m_fieldName));
String fieldValue = Utils.concatenate(values, CommonDefs.MV_SCALAR_SEP_CHAR);
m_dbTran.addScalarValueColumn(m_tableDef, m_dbObj.getObjectID(), m_fieldName, fieldValue);
addTermColumns(fieldValue);
} | class class_name[name] begin[{]
method[addMVScalar, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[Set], values]
local_variable[type[String], fieldValue]
call[m_dbTran.addScalarValueColumn, parameter[member[.m_tableDef], call[m_dbObj.getObjectID, parameter[]], member[.m_fieldName], member[.fieldValue]]]
call[.addTermColumns, parameter[member[.fieldValue]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[addMVScalar] operator[SEP] operator[SEP] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[values] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] identifier[m_dbObj] operator[SEP] identifier[getFieldValues] operator[SEP] identifier[m_fieldName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[fieldValue] operator[=] identifier[Utils] operator[SEP] identifier[concatenate] operator[SEP] identifier[values] , identifier[CommonDefs] operator[SEP] identifier[MV_SCALAR_SEP_CHAR] operator[SEP] operator[SEP] identifier[m_dbTran] operator[SEP] identifier[addScalarValueColumn] operator[SEP] identifier[m_tableDef] , identifier[m_dbObj] operator[SEP] identifier[getObjectID] operator[SEP] operator[SEP] , identifier[m_fieldName] , identifier[fieldValue] operator[SEP] operator[SEP] identifier[addTermColumns] operator[SEP] identifier[fieldValue] operator[SEP] operator[SEP]
}
|
public static SimpleAntlrFactory init()
{
try
{
SimpleAntlrFactory theSimpleAntlrFactory = (SimpleAntlrFactory)EPackage.Registry.INSTANCE.getEFactory(SimpleAntlrPackage.eNS_URI);
if (theSimpleAntlrFactory != null)
{
return theSimpleAntlrFactory;
}
}
catch (Exception exception)
{
EcorePlugin.INSTANCE.log(exception);
}
return new SimpleAntlrFactoryImpl();
} | class class_name[name] begin[{]
method[init, return_type[type[SimpleAntlrFactory]], modifier[public static], parameter[]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=SimpleAntlrPackage, selectors=[])], member=getEFactory, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SimpleAntlrFactory, sub_type=None)), name=theSimpleAntlrFactory)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SimpleAntlrFactory, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=theSimpleAntlrFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=theSimpleAntlrFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=EcorePlugin.INSTANCE, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['Exception']))], finally_block=None, label=None, resources=None)
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SimpleAntlrFactoryImpl, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[SimpleAntlrFactory] identifier[init] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[SimpleAntlrFactory] identifier[theSimpleAntlrFactory] operator[=] operator[SEP] identifier[SimpleAntlrFactory] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEFactory] operator[SEP] identifier[SimpleAntlrPackage] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[theSimpleAntlrFactory] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[theSimpleAntlrFactory] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[exception] operator[SEP] {
identifier[EcorePlugin] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[log] operator[SEP] identifier[exception] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[SimpleAntlrFactoryImpl] operator[SEP] operator[SEP] operator[SEP]
}
|
public float[] readData(RandomAccessFile raf, long drsPos) throws IOException {
raf.seek(drsPos);
Grib2SectionDataRepresentation drs = new Grib2SectionDataRepresentation(raf);
Grib2SectionBitMap bms = new Grib2SectionBitMap(raf);
Grib2SectionData dataSection = new Grib2SectionData(raf);
Grib2Gds gds = getGDS();
Grib2DataReader reader = new Grib2DataReader(drs.getDataTemplate(), gdss.getNumberPoints(), drs.getDataPoints(),
getScanMode(), gds.getNxRaw(), dataSection.getStartingPosition(), dataSection.getMsgLength());
Grib2Drs gdrs = drs.getDrs(raf);
float[] data = reader.getData(raf, bms, gdrs);
if (gds.isThin())
data = QuasiRegular.convertQuasiGrid(data, gds.getNptsInLine(), gds.getNxRaw(), gds.getNyRaw(), GribData.getInterpolationMethod());
lastRecordRead = this;
return data;
} | class class_name[name] begin[{]
method[readData, return_type[type[float]], modifier[public], parameter[raf, drsPos]] begin[{]
call[raf.seek, parameter[member[.drsPos]]]
local_variable[type[Grib2SectionDataRepresentation], drs]
local_variable[type[Grib2SectionBitMap], bms]
local_variable[type[Grib2SectionData], dataSection]
local_variable[type[Grib2Gds], gds]
local_variable[type[Grib2DataReader], reader]
local_variable[type[Grib2Drs], gdrs]
local_variable[type[float], data]
if[call[gds.isThin, parameter[]]] begin[{]
assign[member[.data], call[QuasiRegular.convertQuasiGrid, parameter[member[.data], call[gds.getNptsInLine, parameter[]], call[gds.getNxRaw, parameter[]], call[gds.getNyRaw, parameter[]], call[GribData.getInterpolationMethod, parameter[]]]]]
else begin[{]
None
end[}]
assign[member[.lastRecordRead], THIS[]]
return[member[.data]]
end[}]
END[}] | Keyword[public] Keyword[float] operator[SEP] operator[SEP] identifier[readData] operator[SEP] identifier[RandomAccessFile] identifier[raf] , Keyword[long] identifier[drsPos] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[raf] operator[SEP] identifier[seek] operator[SEP] identifier[drsPos] operator[SEP] operator[SEP] identifier[Grib2SectionDataRepresentation] identifier[drs] operator[=] Keyword[new] identifier[Grib2SectionDataRepresentation] operator[SEP] identifier[raf] operator[SEP] operator[SEP] identifier[Grib2SectionBitMap] identifier[bms] operator[=] Keyword[new] identifier[Grib2SectionBitMap] operator[SEP] identifier[raf] operator[SEP] operator[SEP] identifier[Grib2SectionData] identifier[dataSection] operator[=] Keyword[new] identifier[Grib2SectionData] operator[SEP] identifier[raf] operator[SEP] operator[SEP] identifier[Grib2Gds] identifier[gds] operator[=] identifier[getGDS] operator[SEP] operator[SEP] operator[SEP] identifier[Grib2DataReader] identifier[reader] operator[=] Keyword[new] identifier[Grib2DataReader] operator[SEP] identifier[drs] operator[SEP] identifier[getDataTemplate] operator[SEP] operator[SEP] , identifier[gdss] operator[SEP] identifier[getNumberPoints] operator[SEP] operator[SEP] , identifier[drs] operator[SEP] identifier[getDataPoints] operator[SEP] operator[SEP] , identifier[getScanMode] operator[SEP] operator[SEP] , identifier[gds] operator[SEP] identifier[getNxRaw] operator[SEP] operator[SEP] , identifier[dataSection] operator[SEP] identifier[getStartingPosition] operator[SEP] operator[SEP] , identifier[dataSection] operator[SEP] identifier[getMsgLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Grib2Drs] identifier[gdrs] operator[=] identifier[drs] operator[SEP] identifier[getDrs] operator[SEP] identifier[raf] operator[SEP] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[reader] operator[SEP] identifier[getData] operator[SEP] identifier[raf] , identifier[bms] , identifier[gdrs] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gds] operator[SEP] identifier[isThin] operator[SEP] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[QuasiRegular] operator[SEP] identifier[convertQuasiGrid] operator[SEP] identifier[data] , identifier[gds] operator[SEP] identifier[getNptsInLine] operator[SEP] operator[SEP] , identifier[gds] operator[SEP] identifier[getNxRaw] operator[SEP] operator[SEP] , identifier[gds] operator[SEP] identifier[getNyRaw] operator[SEP] operator[SEP] , identifier[GribData] operator[SEP] identifier[getInterpolationMethod] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[lastRecordRead] operator[=] Keyword[this] operator[SEP] Keyword[return] identifier[data] operator[SEP]
}
|
public Map<String, ChangeParameterMetaData> getSetParameters(Change change) {
Map<String, ChangeParameterMetaData> returnMap = new HashMap<>();
for (Map.Entry<String, ChangeParameterMetaData> entry : getParameters().entrySet()) {
if (entry.getValue().getCurrentValue(change) != null) {
returnMap.put(entry.getKey(), entry.getValue());
}
}
return Collections.unmodifiableMap(returnMap);
} | class class_name[name] begin[{]
method[getSetParameters, return_type[type[Map]], modifier[public], parameter[change]] begin[{]
local_variable[type[Map], returnMap]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[MemberReference(member=change, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCurrentValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=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=put, postfix_operators=[], prefix_operators=[], qualifier=returnMap, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=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=ChangeParameterMetaData, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
return[call[Collections.unmodifiableMap, parameter[member[.returnMap]]]]
end[}]
END[}] | Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[ChangeParameterMetaData] operator[>] identifier[getSetParameters] operator[SEP] identifier[Change] identifier[change] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[ChangeParameterMetaData] operator[>] identifier[returnMap] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[ChangeParameterMetaData] operator[>] identifier[entry] operator[:] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentValue] operator[SEP] identifier[change] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[returnMap] operator[SEP] identifier[put] 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]
}
}
Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableMap] operator[SEP] identifier[returnMap] operator[SEP] operator[SEP]
}
|
public VarValueDef addProperties( Collection<String> properties)
{
if( properties != null)
{
assertPropertyIdentifiers( properties);
properties_.addAll( properties);
}
return this;
} | class class_name[name] begin[{]
method[addProperties, return_type[type[VarValueDef]], modifier[public], parameter[properties]] begin[{]
if[binary_operation[member[.properties], !=, literal[null]]] begin[{]
call[.assertPropertyIdentifiers, parameter[member[.properties]]]
call[properties_.addAll, parameter[member[.properties]]]
else begin[{]
None
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[VarValueDef] identifier[addProperties] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[properties] operator[SEP] {
Keyword[if] operator[SEP] identifier[properties] operator[!=] Other[null] operator[SEP] {
identifier[assertPropertyIdentifiers] operator[SEP] identifier[properties] operator[SEP] operator[SEP] identifier[properties_] operator[SEP] identifier[addAll] operator[SEP] identifier[properties] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public static Object parse(final String s, final BSONCallback c) {
if (s == null || (s.trim()).equals("")) {
return null;
}
JSONParser p = new JSONParser(s, c);
return p.parse();
} | class class_name[name] begin[{]
method[parse, return_type[type[Object]], modifier[public static], parameter[s, c]] begin[{]
if[binary_operation[binary_operation[member[.s], ==, literal[null]], ||, call[s.trim, parameter[]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[JSONParser], p]
return[call[p.parse, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Object] identifier[parse] operator[SEP] Keyword[final] identifier[String] identifier[s] , Keyword[final] identifier[BSONCallback] identifier[c] operator[SEP] {
Keyword[if] operator[SEP] identifier[s] operator[==] Other[null] operator[||] operator[SEP] identifier[s] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[JSONParser] identifier[p] operator[=] Keyword[new] identifier[JSONParser] operator[SEP] identifier[s] , identifier[c] operator[SEP] operator[SEP] Keyword[return] identifier[p] operator[SEP] identifier[parse] operator[SEP] operator[SEP] operator[SEP]
}
|
public ApplicationPage createApplicationPage(ApplicationWindow window, PageDescriptor descriptor) {
if (reusePages) {
VLDockingApplicationPage page = findPage(window, descriptor);
if (page != null) {
return page;
}
}
VLDockingApplicationPage page = new VLDockingApplicationPage(window, descriptor);
if (reusePages) {
cachePage(page);
}
window.addPageListener(new PageListener() {
public void pageOpened(ApplicationPage page) {
// nothing to do here
}
public void pageClosed(ApplicationPage page) {
VLDockingApplicationPage vlDockingApplicationPage = (VLDockingApplicationPage) page;
saveDockingContext(vlDockingApplicationPage);
}
});
return page;
} | class class_name[name] begin[{]
method[createApplicationPage, return_type[type[ApplicationPage]], modifier[public], parameter[window, descriptor]] begin[{]
if[member[.reusePages]] begin[{]
local_variable[type[VLDockingApplicationPage], page]
if[binary_operation[member[.page], !=, literal[null]]] begin[{]
return[member[.page]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[VLDockingApplicationPage], page]
if[member[.reusePages]] begin[{]
call[.cachePage, parameter[member[.page]]]
else begin[{]
None
end[}]
call[window.addPageListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[], documentation=None, modifiers={'public'}, name=pageOpened, parameters=[FormalParameter(annotations=[], modifiers=set(), name=page, type=ReferenceType(arguments=None, dimensions=[], name=ApplicationPage, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=page, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=VLDockingApplicationPage, sub_type=None)), name=vlDockingApplicationPage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VLDockingApplicationPage, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=vlDockingApplicationPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=saveDockingContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=pageClosed, parameters=[FormalParameter(annotations=[], modifiers=set(), name=page, type=ReferenceType(arguments=None, dimensions=[], name=ApplicationPage, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PageListener, sub_type=None))]]
return[member[.page]]
end[}]
END[}] | Keyword[public] identifier[ApplicationPage] identifier[createApplicationPage] operator[SEP] identifier[ApplicationWindow] identifier[window] , identifier[PageDescriptor] identifier[descriptor] operator[SEP] {
Keyword[if] operator[SEP] identifier[reusePages] operator[SEP] {
identifier[VLDockingApplicationPage] identifier[page] operator[=] identifier[findPage] operator[SEP] identifier[window] , identifier[descriptor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[page] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[page] operator[SEP]
}
}
identifier[VLDockingApplicationPage] identifier[page] operator[=] Keyword[new] identifier[VLDockingApplicationPage] operator[SEP] identifier[window] , identifier[descriptor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reusePages] operator[SEP] {
identifier[cachePage] operator[SEP] identifier[page] operator[SEP] operator[SEP]
}
identifier[window] operator[SEP] identifier[addPageListener] operator[SEP] Keyword[new] identifier[PageListener] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[pageOpened] operator[SEP] identifier[ApplicationPage] identifier[page] operator[SEP] {
}
Keyword[public] Keyword[void] identifier[pageClosed] operator[SEP] identifier[ApplicationPage] identifier[page] operator[SEP] {
identifier[VLDockingApplicationPage] identifier[vlDockingApplicationPage] operator[=] operator[SEP] identifier[VLDockingApplicationPage] operator[SEP] identifier[page] operator[SEP] identifier[saveDockingContext] operator[SEP] identifier[vlDockingApplicationPage] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] Keyword[return] identifier[page] operator[SEP]
}
|
public void setEndDateTime(com.google.api.ads.admanager.axis.v201808.DateTime endDateTime) {
this.endDateTime = endDateTime;
} | class class_name[name] begin[{]
method[setEndDateTime, return_type[void], modifier[public], parameter[endDateTime]] begin[{]
assign[THIS[member[None.endDateTime]], member[.endDateTime]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setEndDateTime] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[admanager] operator[SEP] identifier[axis] operator[SEP] identifier[v201808] operator[SEP] identifier[DateTime] identifier[endDateTime] operator[SEP] {
Keyword[this] operator[SEP] identifier[endDateTime] operator[=] identifier[endDateTime] operator[SEP]
}
|
public static int getWrappedValue(int currentValue, int wrapValue,
int minValue, int maxValue) {
return getWrappedValue(currentValue + wrapValue, minValue, maxValue);
} | class class_name[name] begin[{]
method[getWrappedValue, return_type[type[int]], modifier[public static], parameter[currentValue, wrapValue, minValue, maxValue]] begin[{]
return[call[.getWrappedValue, parameter[binary_operation[member[.currentValue], +, member[.wrapValue]], member[.minValue], member[.maxValue]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[getWrappedValue] operator[SEP] Keyword[int] identifier[currentValue] , Keyword[int] identifier[wrapValue] , Keyword[int] identifier[minValue] , Keyword[int] identifier[maxValue] operator[SEP] {
Keyword[return] identifier[getWrappedValue] operator[SEP] identifier[currentValue] operator[+] identifier[wrapValue] , identifier[minValue] , identifier[maxValue] operator[SEP] operator[SEP]
}
|
@Override
public DescribeIamInstanceProfileAssociationsResult describeIamInstanceProfileAssociations(DescribeIamInstanceProfileAssociationsRequest request) {
request = beforeClientExecution(request);
return executeDescribeIamInstanceProfileAssociations(request);
} | class class_name[name] begin[{]
method[describeIamInstanceProfileAssociations, return_type[type[DescribeIamInstanceProfileAssociationsResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeDescribeIamInstanceProfileAssociations, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[DescribeIamInstanceProfileAssociationsResult] identifier[describeIamInstanceProfileAssociations] operator[SEP] identifier[DescribeIamInstanceProfileAssociationsRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDescribeIamInstanceProfileAssociations] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static <T extends Comparable<T>> Matcher<T> between(T min, T max) {
return allOf(greaterThan(min), lessThan(max));
} | class class_name[name] begin[{]
method[between, return_type[type[Matcher]], modifier[public static], parameter[min, max]] begin[{]
return[call[.allOf, parameter[call[.greaterThan, parameter[member[.min]]], call[.lessThan, parameter[member[.max]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Comparable] operator[<] identifier[T] operator[>] operator[>] identifier[Matcher] operator[<] identifier[T] operator[>] identifier[between] operator[SEP] identifier[T] identifier[min] , identifier[T] identifier[max] operator[SEP] {
Keyword[return] identifier[allOf] operator[SEP] identifier[greaterThan] operator[SEP] identifier[min] operator[SEP] , identifier[lessThan] operator[SEP] identifier[max] operator[SEP] operator[SEP] operator[SEP]
}
|
public JobInner get(String resourceGroupName, String accountName, String transformName, String jobName) {
return getWithServiceResponseAsync(resourceGroupName, accountName, transformName, jobName).toBlocking().single().body();
} | class class_name[name] begin[{]
method[get, return_type[type[JobInner]], modifier[public], parameter[resourceGroupName, accountName, transformName, jobName]] begin[{]
return[call[.getWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.accountName], member[.transformName], member[.jobName]]]]
end[}]
END[}] | Keyword[public] identifier[JobInner] identifier[get] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[accountName] , identifier[String] identifier[transformName] , identifier[String] identifier[jobName] operator[SEP] {
Keyword[return] identifier[getWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[accountName] , identifier[transformName] , identifier[jobName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
|
public <T> CorsConfigBuilder preflightResponseHeader(final CharSequence name, final Iterable<T> value) {
preflightHeaders.put(name, new ConstantValueGenerator(value));
return this;
} | class class_name[name] begin[{]
method[preflightResponseHeader, return_type[type[CorsConfigBuilder]], modifier[public], parameter[name, value]] begin[{]
call[preflightHeaders.put, parameter[member[.name], ClassCreator(arguments=[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=None, dimensions=None, name=ConstantValueGenerator, sub_type=None))]]
return[THIS[]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] operator[>] identifier[CorsConfigBuilder] identifier[preflightResponseHeader] operator[SEP] Keyword[final] identifier[CharSequence] identifier[name] , Keyword[final] identifier[Iterable] operator[<] identifier[T] operator[>] identifier[value] operator[SEP] {
identifier[preflightHeaders] operator[SEP] identifier[put] operator[SEP] identifier[name] , Keyword[new] identifier[ConstantValueGenerator] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public static br_disable[] disable(nitro_service client, br_disable[] resources) throws Exception
{
if(resources == null)
throw new Exception("Null resource array");
if(resources.length == 1)
return ((br_disable[]) resources[0].perform_operation(client, "disable"));
return ((br_disable[]) perform_operation_bulk_request(client, resources, "disable"));
} | class class_name[name] begin[{]
method[disable, return_type[type[br_disable]], modifier[public static], parameter[client, resources]] begin[{]
if[binary_operation[member[.resources], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Null resource array")], 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[resources.length], ==, literal[1]]] begin[{]
return[Cast(expression=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="disable")], member=perform_operation, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[None], name=br_disable, sub_type=None))]
else begin[{]
None
end[}]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="disable")], member=perform_operation_bulk_request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=br_disable, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[br_disable] operator[SEP] operator[SEP] identifier[disable] operator[SEP] identifier[nitro_service] identifier[client] , identifier[br_disable] operator[SEP] operator[SEP] identifier[resources] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[if] operator[SEP] identifier[resources] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resources] operator[SEP] identifier[length] operator[==] Other[1] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[br_disable] operator[SEP] operator[SEP] operator[SEP] identifier[resources] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[perform_operation] operator[SEP] identifier[client] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[br_disable] operator[SEP] operator[SEP] operator[SEP] identifier[perform_operation_bulk_request] operator[SEP] identifier[client] , identifier[resources] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
|
private boolean crevdissect(RuntimeSubexpression t, int begin, int end) {
Dfa d;
Dfa d2;
int mid;
assert t.op == '.';
assert t.left != null && t.left.machine.states.length > 0;
assert t.right != null && t.right.machine.states.length > 0;
assert 0 != (t.left.flags & Subre.SHORTER);
/* concatenation -- need to split the substring between parts */
d = new Dfa(this, t.left.machine);
d2 = new Dfa(this, t.right.machine);
/* pick a tentative midpoint */
if (mem[t.retry] == 0) {
mid = d.shortest(begin, begin, end, null, null);
if (mid == -1) {
return false;
}
mem[t.retry] = (mid - begin) + 1;
} else {
mid = begin + (mem[t.retry] - 1);
}
/* iterate until satisfaction or failure */
for (;;) {
/* try this midpoint on for size */
boolean cdmatch = cdissect(t.left, begin, mid);
if (cdmatch
&& d2.longest(mid, end, null) == end
&& (cdissect(t.right, mid, end))) {
break; /* NOTE BREAK OUT */
}
/* that midpoint didn't work, find a new one */
if (mid == end) {
/* all possibilities exhausted */
return false;
}
mid = d.shortest(begin, mid + 1, end, null, null);
if (mid == -1) {
/* failed to find a new one */
return false;
}
mem[t.retry] = (mid - begin) + 1;
zapmem(t.left);
zapmem(t.right);
}
/* satisfaction */
return true;
} | class class_name[name] begin[{]
method[crevdissect, return_type[type[boolean]], modifier[private], parameter[t, begin, end]] begin[{]
local_variable[type[Dfa], d]
local_variable[type[Dfa], d2]
local_variable[type[int], mid]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.'), operator===), label=None, value=None)
AssertStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=t.left.machine.states, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), label=None, value=None)
AssertStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=t.right.machine.states, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), label=None, value=None)
AssertStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operandr=BinaryOperation(operandl=MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=t.left, selectors=[]), operandr=MemberReference(member=SHORTER, postfix_operators=[], prefix_operators=[], qualifier=Subre, selectors=[]), operator=&), operator=!=), label=None, value=None)
assign[member[.d], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=machine, postfix_operators=[], prefix_operators=[], qualifier=t.left, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Dfa, sub_type=None))]
assign[member[.d2], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=machine, postfix_operators=[], prefix_operators=[], qualifier=t.right, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Dfa, sub_type=None))]
if[binary_operation[member[.mem], ==, literal[0]]] begin[{]
assign[member[.mid], call[d.shortest, parameter[member[.begin], member[.begin], member[.end], literal[null], literal[null]]]]
if[binary_operation[member[.mid], ==, literal[1]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
assign[member[.mem], binary_operation[binary_operation[member[.mid], -, member[.begin]], +, literal[1]]]
else begin[{]
assign[member[.mid], binary_operation[member[.begin], +, binary_operation[member[.mem], -, literal[1]]]]
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[]), MemberReference(member=begin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cdissect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=cdmatch)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cdmatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=longest, postfix_operators=[], prefix_operators=[], qualifier=d2, selectors=[], type_arguments=None), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[]), MemberReference(member=mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cdissect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=begin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=shortest, postfix_operators=[], prefix_operators=[], qualifier=d, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=retry, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[]))]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=begin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[])], member=zapmem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[])], member=zapmem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=None, init=None, update=None), label=None)
return[literal[true]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[crevdissect] operator[SEP] identifier[RuntimeSubexpression] identifier[t] , Keyword[int] identifier[begin] , Keyword[int] identifier[end] operator[SEP] {
identifier[Dfa] identifier[d] operator[SEP] identifier[Dfa] identifier[d2] operator[SEP] Keyword[int] identifier[mid] operator[SEP] Keyword[assert] identifier[t] operator[SEP] identifier[op] operator[==] literal[String] operator[SEP] Keyword[assert] identifier[t] operator[SEP] identifier[left] operator[!=] Other[null] operator[&&] identifier[t] operator[SEP] identifier[left] operator[SEP] identifier[machine] operator[SEP] identifier[states] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] Keyword[assert] identifier[t] operator[SEP] identifier[right] operator[!=] Other[null] operator[&&] identifier[t] operator[SEP] identifier[right] operator[SEP] identifier[machine] operator[SEP] identifier[states] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] Keyword[assert] Other[0] operator[!=] operator[SEP] identifier[t] operator[SEP] identifier[left] operator[SEP] identifier[flags] operator[&] identifier[Subre] operator[SEP] identifier[SHORTER] operator[SEP] operator[SEP] identifier[d] operator[=] Keyword[new] identifier[Dfa] operator[SEP] Keyword[this] , identifier[t] operator[SEP] identifier[left] operator[SEP] identifier[machine] operator[SEP] operator[SEP] identifier[d2] operator[=] Keyword[new] identifier[Dfa] operator[SEP] Keyword[this] , identifier[t] operator[SEP] identifier[right] operator[SEP] identifier[machine] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mem] operator[SEP] identifier[t] operator[SEP] identifier[retry] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[mid] operator[=] identifier[d] operator[SEP] identifier[shortest] operator[SEP] identifier[begin] , identifier[begin] , identifier[end] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mid] operator[==] operator[-] Other[1] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[mem] operator[SEP] identifier[t] operator[SEP] identifier[retry] operator[SEP] operator[=] operator[SEP] identifier[mid] operator[-] identifier[begin] operator[SEP] operator[+] Other[1] operator[SEP]
}
Keyword[else] {
identifier[mid] operator[=] identifier[begin] operator[+] operator[SEP] identifier[mem] operator[SEP] identifier[t] operator[SEP] identifier[retry] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[cdmatch] operator[=] identifier[cdissect] operator[SEP] identifier[t] operator[SEP] identifier[left] , identifier[begin] , identifier[mid] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cdmatch] operator[&&] identifier[d2] operator[SEP] identifier[longest] operator[SEP] identifier[mid] , identifier[end] , Other[null] operator[SEP] operator[==] identifier[end] operator[&&] operator[SEP] identifier[cdissect] operator[SEP] identifier[t] operator[SEP] identifier[right] , identifier[mid] , identifier[end] operator[SEP] operator[SEP] operator[SEP] {
Keyword[break] operator[SEP]
}
Keyword[if] operator[SEP] identifier[mid] operator[==] identifier[end] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[mid] operator[=] identifier[d] operator[SEP] identifier[shortest] operator[SEP] identifier[begin] , identifier[mid] operator[+] Other[1] , identifier[end] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mid] operator[==] operator[-] Other[1] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[mem] operator[SEP] identifier[t] operator[SEP] identifier[retry] operator[SEP] operator[=] operator[SEP] identifier[mid] operator[-] identifier[begin] operator[SEP] operator[+] Other[1] operator[SEP] identifier[zapmem] operator[SEP] identifier[t] operator[SEP] identifier[left] operator[SEP] operator[SEP] identifier[zapmem] operator[SEP] identifier[t] operator[SEP] identifier[right] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
@Override
public void setBreak(boolean enabled) throws IllegalStateException, IOException{
// validate state
if (isClosed())
throw new IllegalStateException("Serial connection is not open; cannot 'setBreak()'.");
// control the constant state of the BREAK signal
com.pi4j.jni.Serial.setBreak(fileDescriptor, enabled);
} | class class_name[name] begin[{]
method[setBreak, return_type[void], modifier[public], parameter[enabled]] begin[{]
if[call[.isClosed, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Serial connection is not open; cannot 'setBreak()'.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[com.pi4j.jni.Serial.setBreak, parameter[member[.fileDescriptor], member[.enabled]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setBreak] operator[SEP] Keyword[boolean] identifier[enabled] operator[SEP] Keyword[throws] identifier[IllegalStateException] , identifier[IOException] {
Keyword[if] operator[SEP] identifier[isClosed] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[com] operator[SEP] identifier[pi4j] operator[SEP] identifier[jni] operator[SEP] identifier[Serial] operator[SEP] identifier[setBreak] operator[SEP] identifier[fileDescriptor] , identifier[enabled] operator[SEP] operator[SEP]
}
|
public Object get(String key)
{
if (syncWorker != null)
return syncWorker.get(key);
return null;
} | class class_name[name] begin[{]
method[get, return_type[type[Object]], modifier[public], parameter[key]] begin[{]
if[binary_operation[member[.syncWorker], !=, literal[null]]] begin[{]
return[call[syncWorker.get, parameter[member[.key]]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[get] operator[SEP] identifier[String] identifier[key] operator[SEP] {
Keyword[if] operator[SEP] identifier[syncWorker] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[syncWorker] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
public static ExpectedCondition<Boolean> textToBePresentInElementValue(final By locator,
final String text) {
return new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver driver) {
try {
String elementText = driver.findElement(locator).getAttribute("value");
if (elementText != null) {
return elementText.contains(text);
}
return false;
} catch (StaleElementReferenceException e) {
return null;
}
}
@Override
public String toString() {
return String.format("text ('%s') to be the value of element located by %s",
text, locator);
}
};
} | class class_name[name] begin[{]
method[textToBePresentInElementValue, return_type[type[ExpectedCondition]], modifier[public static], parameter[locator, text]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=locator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findElement, postfix_operators=[], prefix_operators=[], qualifier=driver, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value")], member=getAttribute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=elementText)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=elementText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=elementText, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['StaleElementReferenceException']))], finally_block=None, label=None, resources=None)], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[], modifiers=set(), name=driver, type=ReferenceType(arguments=None, dimensions=[], name=WebDriver, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="text ('%s') to be the value of element located by %s"), MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=locator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=toString, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=None, name=ExpectedCondition, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ExpectedCondition] operator[<] identifier[Boolean] operator[>] identifier[textToBePresentInElementValue] operator[SEP] Keyword[final] identifier[By] identifier[locator] , Keyword[final] identifier[String] identifier[text] operator[SEP] {
Keyword[return] Keyword[new] identifier[ExpectedCondition] operator[<] identifier[Boolean] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Boolean] identifier[apply] operator[SEP] identifier[WebDriver] identifier[driver] operator[SEP] {
Keyword[try] {
identifier[String] identifier[elementText] operator[=] identifier[driver] operator[SEP] identifier[findElement] operator[SEP] identifier[locator] operator[SEP] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[elementText] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[elementText] operator[SEP] identifier[contains] operator[SEP] identifier[text] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[StaleElementReferenceException] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
} annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[toString] operator[SEP] operator[SEP] {
Keyword[return] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[text] , identifier[locator] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
public V put(ResourceType type, String poolGroupName, V value) {
Map<String, V> poolGroupNameMap = typePoolGroupNameMap.get(type);
if (poolGroupNameMap == null) {
poolGroupNameMap = new HashMap<String, V>();
typePoolGroupNameMap.put(type, poolGroupNameMap);
}
return poolGroupNameMap.put(poolGroupName, value);
} | class class_name[name] begin[{]
method[put, return_type[type[V]], modifier[public], parameter[type, poolGroupName, value]] begin[{]
local_variable[type[Map], poolGroupNameMap]
if[binary_operation[member[.poolGroupNameMap], ==, literal[null]]] begin[{]
assign[member[.poolGroupNameMap], 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=V, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))]
call[typePoolGroupNameMap.put, parameter[member[.type], member[.poolGroupNameMap]]]
else begin[{]
None
end[}]
return[call[poolGroupNameMap.put, parameter[member[.poolGroupName], member[.value]]]]
end[}]
END[}] | Keyword[public] identifier[V] identifier[put] operator[SEP] identifier[ResourceType] identifier[type] , identifier[String] identifier[poolGroupName] , identifier[V] identifier[value] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[V] operator[>] identifier[poolGroupNameMap] operator[=] identifier[typePoolGroupNameMap] operator[SEP] identifier[get] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[poolGroupNameMap] operator[==] Other[null] operator[SEP] {
identifier[poolGroupNameMap] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[V] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[typePoolGroupNameMap] operator[SEP] identifier[put] operator[SEP] identifier[type] , identifier[poolGroupNameMap] operator[SEP] operator[SEP]
}
Keyword[return] identifier[poolGroupNameMap] operator[SEP] identifier[put] operator[SEP] identifier[poolGroupName] , identifier[value] operator[SEP] operator[SEP]
}
|
public MultipartBuilder addPart(NetworkRequest part) {
if (part == null) {
throw new NullPointerException("part == null");
}
parts.add(part);
return this;
} | class class_name[name] begin[{]
method[addPart, return_type[type[MultipartBuilder]], modifier[public], parameter[part]] begin[{]
if[binary_operation[member[.part], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="part == null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[parts.add, parameter[member[.part]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[MultipartBuilder] identifier[addPart] operator[SEP] identifier[NetworkRequest] identifier[part] operator[SEP] {
Keyword[if] operator[SEP] identifier[part] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[parts] operator[SEP] identifier[add] operator[SEP] identifier[part] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
private void setConfigValues(Configuration config, JLanguageTool langTool) {
this.config = config;
this.langTool = langTool;
this.noMultiReset = config.isNoMultiReset();
for (SingleDocument document : documents) {
document.setConfigValues(config);
}
} | class class_name[name] begin[{]
method[setConfigValues, return_type[void], modifier[private], parameter[config, langTool]] begin[{]
assign[THIS[member[None.config]], member[.config]]
assign[THIS[member[None.langTool]], member[.langTool]]
assign[THIS[member[None.noMultiReset]], call[config.isNoMultiReset, parameter[]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setConfigValues, postfix_operators=[], prefix_operators=[], qualifier=document, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=documents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=document)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SingleDocument, sub_type=None))), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[setConfigValues] operator[SEP] identifier[Configuration] identifier[config] , identifier[JLanguageTool] identifier[langTool] operator[SEP] {
Keyword[this] operator[SEP] identifier[config] operator[=] identifier[config] operator[SEP] Keyword[this] operator[SEP] identifier[langTool] operator[=] identifier[langTool] operator[SEP] Keyword[this] operator[SEP] identifier[noMultiReset] operator[=] identifier[config] operator[SEP] identifier[isNoMultiReset] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SingleDocument] identifier[document] operator[:] identifier[documents] operator[SEP] {
identifier[document] operator[SEP] identifier[setConfigValues] operator[SEP] identifier[config] operator[SEP] operator[SEP]
}
}
|
public static StepExecutionItem createPluginStepItem(
final String type,
final Map configuration,
final boolean keepgoingOnSuccess,
final StepExecutionItem handler,
final String label,
final List<PluginConfiguration> filterConfigurations
)
{
return new PluginStepExecutionItemImpl(
type,
configuration,
keepgoingOnSuccess,
handler,
label,
filterConfigurations
);
} | class class_name[name] begin[{]
method[createPluginStepItem, return_type[type[StepExecutionItem]], modifier[public static], parameter[type, configuration, keepgoingOnSuccess, handler, label, filterConfigurations]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=configuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=keepgoingOnSuccess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=filterConfigurations, 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=PluginStepExecutionItemImpl, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[StepExecutionItem] identifier[createPluginStepItem] operator[SEP] Keyword[final] identifier[String] identifier[type] , Keyword[final] identifier[Map] identifier[configuration] , Keyword[final] Keyword[boolean] identifier[keepgoingOnSuccess] , Keyword[final] identifier[StepExecutionItem] identifier[handler] , Keyword[final] identifier[String] identifier[label] , Keyword[final] identifier[List] operator[<] identifier[PluginConfiguration] operator[>] identifier[filterConfigurations] operator[SEP] {
Keyword[return] Keyword[new] identifier[PluginStepExecutionItemImpl] operator[SEP] identifier[type] , identifier[configuration] , identifier[keepgoingOnSuccess] , identifier[handler] , identifier[label] , identifier[filterConfigurations] operator[SEP] operator[SEP]
}
|
static Number coerceToPrimitiveNumber(long pValue,
Class pClass)
throws ELException {
if (pClass == Byte.class || pClass == Byte.TYPE) {
return PrimitiveObjects.getByte((byte) pValue);
} else if (pClass == Short.class || pClass == Short.TYPE) {
return PrimitiveObjects.getShort((short) pValue);
} else if (pClass == Integer.class || pClass == Integer.TYPE) {
return PrimitiveObjects.getInteger((int) pValue);
} else if (pClass == Long.class || pClass == Long.TYPE) {
return PrimitiveObjects.getLong((long) pValue);
} else if (pClass == Float.class || pClass == Float.TYPE) {
return PrimitiveObjects.getFloat((float) pValue);
} else if (pClass == Double.class || pClass == Double.TYPE) {
return PrimitiveObjects.getDouble((double) pValue);
} else {
return PrimitiveObjects.getInteger(0);
}
} | class class_name[name] begin[{]
method[coerceToPrimitiveNumber, return_type[type[Number]], modifier[static], parameter[pValue, pClass]] begin[{]
if[binary_operation[binary_operation[member[.pClass], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Byte, sub_type=None))], ||, binary_operation[member[.pClass], ==, member[Byte.TYPE]]]] begin[{]
return[call[PrimitiveObjects.getByte, parameter[Cast(expression=MemberReference(member=pValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))]]]
else begin[{]
if[binary_operation[binary_operation[member[.pClass], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Short, sub_type=None))], ||, binary_operation[member[.pClass], ==, member[Short.TYPE]]]] begin[{]
return[call[PrimitiveObjects.getShort, parameter[Cast(expression=MemberReference(member=pValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=short))]]]
else begin[{]
if[binary_operation[binary_operation[member[.pClass], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))], ||, binary_operation[member[.pClass], ==, member[Integer.TYPE]]]] begin[{]
return[call[PrimitiveObjects.getInteger, parameter[Cast(expression=MemberReference(member=pValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))]]]
else begin[{]
if[binary_operation[binary_operation[member[.pClass], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))], ||, binary_operation[member[.pClass], ==, member[Long.TYPE]]]] begin[{]
return[call[PrimitiveObjects.getLong, parameter[Cast(expression=MemberReference(member=pValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=long))]]]
else begin[{]
if[binary_operation[binary_operation[member[.pClass], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None))], ||, binary_operation[member[.pClass], ==, member[Float.TYPE]]]] begin[{]
return[call[PrimitiveObjects.getFloat, parameter[Cast(expression=MemberReference(member=pValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=float))]]]
else begin[{]
if[binary_operation[binary_operation[member[.pClass], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None))], ||, binary_operation[member[.pClass], ==, member[Double.TYPE]]]] begin[{]
return[call[PrimitiveObjects.getDouble, parameter[Cast(expression=MemberReference(member=pValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double))]]]
else begin[{]
return[call[PrimitiveObjects.getInteger, parameter[literal[0]]]]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[static] identifier[Number] identifier[coerceToPrimitiveNumber] operator[SEP] Keyword[long] identifier[pValue] , identifier[Class] identifier[pClass] operator[SEP] Keyword[throws] identifier[ELException] {
Keyword[if] operator[SEP] identifier[pClass] operator[==] identifier[Byte] operator[SEP] Keyword[class] operator[||] identifier[pClass] operator[==] identifier[Byte] operator[SEP] identifier[TYPE] operator[SEP] {
Keyword[return] identifier[PrimitiveObjects] operator[SEP] identifier[getByte] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] identifier[pValue] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[pClass] operator[==] identifier[Short] operator[SEP] Keyword[class] operator[||] identifier[pClass] operator[==] identifier[Short] operator[SEP] identifier[TYPE] operator[SEP] {
Keyword[return] identifier[PrimitiveObjects] operator[SEP] identifier[getShort] operator[SEP] operator[SEP] Keyword[short] operator[SEP] identifier[pValue] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[pClass] operator[==] identifier[Integer] operator[SEP] Keyword[class] operator[||] identifier[pClass] operator[==] identifier[Integer] operator[SEP] identifier[TYPE] operator[SEP] {
Keyword[return] identifier[PrimitiveObjects] operator[SEP] identifier[getInteger] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[pValue] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[pClass] operator[==] identifier[Long] operator[SEP] Keyword[class] operator[||] identifier[pClass] operator[==] identifier[Long] operator[SEP] identifier[TYPE] operator[SEP] {
Keyword[return] identifier[PrimitiveObjects] operator[SEP] identifier[getLong] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[pValue] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[pClass] operator[==] identifier[Float] operator[SEP] Keyword[class] operator[||] identifier[pClass] operator[==] identifier[Float] operator[SEP] identifier[TYPE] operator[SEP] {
Keyword[return] identifier[PrimitiveObjects] operator[SEP] identifier[getFloat] operator[SEP] operator[SEP] Keyword[float] operator[SEP] identifier[pValue] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[pClass] operator[==] identifier[Double] operator[SEP] Keyword[class] operator[||] identifier[pClass] operator[==] identifier[Double] operator[SEP] identifier[TYPE] operator[SEP] {
Keyword[return] identifier[PrimitiveObjects] operator[SEP] identifier[getDouble] operator[SEP] operator[SEP] Keyword[double] operator[SEP] identifier[pValue] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[PrimitiveObjects] operator[SEP] identifier[getInteger] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
}
|
@NonNull
public ListenerToken addDocumentChangeListener(
@NonNull String id,
Executor executor,
@NonNull DocumentChangeListener listener) {
if (id == null) { throw new IllegalArgumentException("id cannot be null."); }
if (listener == null) { throw new IllegalArgumentException("listener cannot be null."); }
synchronized (lock) {
mustBeOpen();
return addDocumentChangeListener(executor, listener, id);
}
} | class class_name[name] begin[{]
method[addDocumentChangeListener, return_type[type[ListenerToken]], modifier[public], parameter[id, executor, listener]] begin[{]
if[binary_operation[member[.id], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="id cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.listener], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="listener cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
SYNCHRONIZED[member[.lock]] BEGIN[{]
call[.mustBeOpen, parameter[]]
return[call[.addDocumentChangeListener, parameter[member[.executor], member[.listener], member[.id]]]]
END[}]
end[}]
END[}] | annotation[@] identifier[NonNull] Keyword[public] identifier[ListenerToken] identifier[addDocumentChangeListener] operator[SEP] annotation[@] identifier[NonNull] identifier[String] identifier[id] , identifier[Executor] identifier[executor] , annotation[@] identifier[NonNull] identifier[DocumentChangeListener] identifier[listener] operator[SEP] {
Keyword[if] operator[SEP] identifier[id] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[listener] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] {
identifier[mustBeOpen] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[addDocumentChangeListener] operator[SEP] identifier[executor] , identifier[listener] , identifier[id] operator[SEP] operator[SEP]
}
}
|
public Token[] tokenize(String input)
{
char[] stringChars = input.toCharArray();
List<Token> tokens = new ArrayList<Token>();
for (char c : stringChars) {
if(Character.isLetterOrDigit(c)){
tokens.add(internSomething(Character.toString(c)));
}
else if (!ignorePunctuation && !Character.isWhitespace(c)) {
tokens.add(internSomething(Character.toString(c)));
}
}
return (Token[]) tokens.toArray(new BasicToken[tokens.size()]);
} | class class_name[name] begin[{]
method[tokenize, return_type[type[Token]], modifier[public], parameter[input]] begin[{]
local_variable[type[char], stringChars]
local_variable[type[List], tokens]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isLetterOrDigit, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ignorePunctuation, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isWhitespace, 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=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None)], member=internSomething, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None)], member=internSomething, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=stringChars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char))), label=None)
return[Cast(expression=MethodInvocation(arguments=[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BasicToken, sub_type=None))], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=Token, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[Token] operator[SEP] operator[SEP] identifier[tokenize] operator[SEP] identifier[String] identifier[input] operator[SEP] {
Keyword[char] operator[SEP] operator[SEP] identifier[stringChars] operator[=] identifier[input] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Token] operator[>] identifier[tokens] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Token] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[char] identifier[c] operator[:] identifier[stringChars] operator[SEP] {
Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isLetterOrDigit] operator[SEP] identifier[c] operator[SEP] operator[SEP] {
identifier[tokens] operator[SEP] identifier[add] operator[SEP] identifier[internSomething] operator[SEP] identifier[Character] operator[SEP] identifier[toString] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[ignorePunctuation] operator[&&] operator[!] identifier[Character] operator[SEP] identifier[isWhitespace] operator[SEP] identifier[c] operator[SEP] operator[SEP] {
identifier[tokens] operator[SEP] identifier[add] operator[SEP] identifier[internSomething] operator[SEP] identifier[Character] operator[SEP] identifier[toString] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] operator[SEP] identifier[Token] operator[SEP] operator[SEP] operator[SEP] identifier[tokens] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[BasicToken] operator[SEP] identifier[tokens] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public ManualRequestEditorDialog getResendDialog() {
if (resendDialog == null) {
resendDialog = new ManualHttpRequestEditorDialog(true, "resend", "ui.dialogs.manreq");
resendDialog.setTitle(Constant.messages.getString("manReq.dialog.title")); // ZAP: i18n
}
return resendDialog;
} | class class_name[name] begin[{]
method[getResendDialog, return_type[type[ManualRequestEditorDialog]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.resendDialog], ==, literal[null]]] begin[{]
assign[member[.resendDialog], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="resend"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ui.dialogs.manreq")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ManualHttpRequestEditorDialog, sub_type=None))]
call[resendDialog.setTitle, parameter[call[Constant.messages.getString, parameter[literal["manReq.dialog.title"]]]]]
else begin[{]
None
end[}]
return[member[.resendDialog]]
end[}]
END[}] | Keyword[public] identifier[ManualRequestEditorDialog] identifier[getResendDialog] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[resendDialog] operator[==] Other[null] operator[SEP] {
identifier[resendDialog] operator[=] Keyword[new] identifier[ManualHttpRequestEditorDialog] operator[SEP] literal[boolean] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[resendDialog] operator[SEP] identifier[setTitle] operator[SEP] identifier[Constant] operator[SEP] identifier[messages] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[resendDialog] operator[SEP]
}
|
public double getColorPercentage(Color color)
{
if (color == null)
return 0;
else
{
Integer num = colors.get(colorKey(color));
if (num == null) num = 0;
if (totalLength == 0)
return 0;
else
return (double) num / totalLength;
}
} | class class_name[name] begin[{]
method[getColorPercentage, return_type[type[double]], modifier[public], parameter[color]] begin[{]
if[binary_operation[member[.color], ==, literal[null]]] begin[{]
return[literal[0]]
else begin[{]
local_variable[type[Integer], num]
if[binary_operation[member[.num], ==, literal[null]]] begin[{]
assign[member[.num], literal[0]]
else begin[{]
None
end[}]
if[binary_operation[member[.totalLength], ==, literal[0]]] begin[{]
return[literal[0]]
else begin[{]
return[binary_operation[Cast(expression=MemberReference(member=num, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=double)), /, member[.totalLength]]]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[double] identifier[getColorPercentage] operator[SEP] identifier[Color] identifier[color] operator[SEP] {
Keyword[if] operator[SEP] identifier[color] operator[==] Other[null] operator[SEP] Keyword[return] Other[0] operator[SEP] Keyword[else] {
identifier[Integer] identifier[num] operator[=] identifier[colors] operator[SEP] identifier[get] operator[SEP] identifier[colorKey] operator[SEP] identifier[color] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[num] operator[==] Other[null] operator[SEP] identifier[num] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[totalLength] operator[==] Other[0] operator[SEP] Keyword[return] Other[0] operator[SEP] Keyword[else] Keyword[return] operator[SEP] Keyword[double] operator[SEP] identifier[num] operator[/] identifier[totalLength] operator[SEP]
}
}
|
@Override
public Pair<D, Integer> answerQuery(Word<I> prefix, Word<I> loop, int repeat) {
assert repeat > 0;
final List<S> states = new ArrayList<>(repeat + 1);
final WordBuilder<I> wb = new WordBuilder<>(prefix.length() + loop.length() * repeat, prefix);
S stateIter = simpleDTS.getState(wb);
if (stateIter == null) {
return Pair.of(null, -1);
}
states.add(stateIter);
for (int i = 0; i < repeat; i++) {
final S nextState = simpleDTS.getSuccessor(stateIter, loop);
if (nextState == null) {
return Pair.of(null, -1);
}
wb.append(loop);
int prefixLength = prefix.length();
for (S s : states) {
if (isSameState(wb.toWord(0, prefixLength), s, wb.toWord(), nextState)) {
return Pair.of(simulatorOracle.answerQuery(wb.toWord()), i + 1);
}
prefixLength += loop.length();
}
states.add(nextState);
stateIter = nextState;
}
return Pair.of(null, -1);
} | class class_name[name] begin[{]
method[answerQuery, return_type[type[Pair]], modifier[public], parameter[prefix, loop, repeat]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=repeat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None, value=None)
local_variable[type[List], states]
local_variable[type[WordBuilder], wb]
local_variable[type[S], stateIter]
if[binary_operation[member[.stateIter], ==, literal[null]]] begin[{]
return[call[Pair.of, parameter[literal[null], literal[1]]]]
else begin[{]
None
end[}]
call[states.add, parameter[member[.stateIter]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=stateIter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=loop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSuccessor, postfix_operators=[], prefix_operators=[], qualifier=simpleDTS, selectors=[], type_arguments=None), name=nextState)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=S, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=nextState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=of, postfix_operators=[], prefix_operators=[], qualifier=Pair, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=loop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=wb, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=prefix, selectors=[], type_arguments=None), name=prefixLength)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=prefixLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toWord, postfix_operators=[], prefix_operators=[], qualifier=wb, selectors=[], type_arguments=None), MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toWord, postfix_operators=[], prefix_operators=[], qualifier=wb, selectors=[], type_arguments=None), MemberReference(member=nextState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isSameState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toWord, postfix_operators=[], prefix_operators=[], qualifier=wb, selectors=[], type_arguments=None)], member=answerQuery, postfix_operators=[], prefix_operators=[], qualifier=simulatorOracle, selectors=[], type_arguments=None), BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=of, postfix_operators=[], prefix_operators=[], qualifier=Pair, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=prefixLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=loop, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=states, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=S, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nextState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=states, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stateIter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=nextState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=repeat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[call[Pair.of, parameter[literal[null], literal[1]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Pair] operator[<] identifier[D] , identifier[Integer] operator[>] identifier[answerQuery] operator[SEP] identifier[Word] operator[<] identifier[I] operator[>] identifier[prefix] , identifier[Word] operator[<] identifier[I] operator[>] identifier[loop] , Keyword[int] identifier[repeat] operator[SEP] {
Keyword[assert] identifier[repeat] operator[>] Other[0] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[S] operator[>] identifier[states] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[repeat] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[final] identifier[WordBuilder] operator[<] identifier[I] operator[>] identifier[wb] operator[=] Keyword[new] identifier[WordBuilder] operator[<] operator[>] operator[SEP] identifier[prefix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] identifier[loop] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[*] identifier[repeat] , identifier[prefix] operator[SEP] operator[SEP] identifier[S] identifier[stateIter] operator[=] identifier[simpleDTS] operator[SEP] identifier[getState] operator[SEP] identifier[wb] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stateIter] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[Pair] operator[SEP] identifier[of] operator[SEP] Other[null] , operator[-] Other[1] operator[SEP] operator[SEP]
}
identifier[states] operator[SEP] identifier[add] operator[SEP] identifier[stateIter] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[repeat] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[final] identifier[S] identifier[nextState] operator[=] identifier[simpleDTS] operator[SEP] identifier[getSuccessor] operator[SEP] identifier[stateIter] , identifier[loop] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextState] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[Pair] operator[SEP] identifier[of] operator[SEP] Other[null] , operator[-] Other[1] operator[SEP] operator[SEP]
}
identifier[wb] operator[SEP] identifier[append] operator[SEP] identifier[loop] operator[SEP] operator[SEP] Keyword[int] identifier[prefixLength] operator[=] identifier[prefix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[S] identifier[s] operator[:] identifier[states] operator[SEP] {
Keyword[if] operator[SEP] identifier[isSameState] operator[SEP] identifier[wb] operator[SEP] identifier[toWord] operator[SEP] Other[0] , identifier[prefixLength] operator[SEP] , identifier[s] , identifier[wb] operator[SEP] identifier[toWord] operator[SEP] operator[SEP] , identifier[nextState] operator[SEP] operator[SEP] {
Keyword[return] identifier[Pair] operator[SEP] identifier[of] operator[SEP] identifier[simulatorOracle] operator[SEP] identifier[answerQuery] operator[SEP] identifier[wb] operator[SEP] identifier[toWord] operator[SEP] operator[SEP] operator[SEP] , identifier[i] operator[+] Other[1] operator[SEP] operator[SEP]
}
identifier[prefixLength] operator[+=] identifier[loop] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
identifier[states] operator[SEP] identifier[add] operator[SEP] identifier[nextState] operator[SEP] operator[SEP] identifier[stateIter] operator[=] identifier[nextState] operator[SEP]
}
Keyword[return] identifier[Pair] operator[SEP] identifier[of] operator[SEP] Other[null] , operator[-] Other[1] operator[SEP] operator[SEP]
}
|
private static void writeZonePropsByDOW(Writer writer, boolean isDst, String tzname, int fromOffset, int toOffset,
int month, int weekInMonth, int dayOfWeek, long startTime, long untilTime) throws IOException {
beginZoneProps(writer, isDst, tzname, fromOffset, toOffset, startTime);
beginRRULE(writer, month);
writer.write(ICAL_BYDAY);
writer.write(EQUALS_SIGN);
writer.write(Integer.toString(weekInMonth)); // -4, -3, -2, -1, 1, 2, 3, 4
writer.write(ICAL_DOW_NAMES[dayOfWeek - 1]); // SU, MO, TU...
if (untilTime != MAX_TIME) {
appendUNTIL(writer, getDateTimeString(untilTime + fromOffset));
}
writer.write(NEWLINE);
endZoneProps(writer, isDst);
} | class class_name[name] begin[{]
method[writeZonePropsByDOW, return_type[void], modifier[private static], parameter[writer, isDst, tzname, fromOffset, toOffset, month, weekInMonth, dayOfWeek, startTime, untilTime]] begin[{]
call[.beginZoneProps, parameter[member[.writer], member[.isDst], member[.tzname], member[.fromOffset], member[.toOffset], member[.startTime]]]
call[.beginRRULE, parameter[member[.writer], member[.month]]]
call[writer.write, parameter[member[.ICAL_BYDAY]]]
call[writer.write, parameter[member[.EQUALS_SIGN]]]
call[writer.write, parameter[call[Integer.toString, parameter[member[.weekInMonth]]]]]
call[writer.write, parameter[member[.ICAL_DOW_NAMES]]]
if[binary_operation[member[.untilTime], !=, member[.MAX_TIME]]] begin[{]
call[.appendUNTIL, parameter[member[.writer], call[.getDateTimeString, parameter[binary_operation[member[.untilTime], +, member[.fromOffset]]]]]]
else begin[{]
None
end[}]
call[writer.write, parameter[member[.NEWLINE]]]
call[.endZoneProps, parameter[member[.writer], member[.isDst]]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[writeZonePropsByDOW] operator[SEP] identifier[Writer] identifier[writer] , Keyword[boolean] identifier[isDst] , identifier[String] identifier[tzname] , Keyword[int] identifier[fromOffset] , Keyword[int] identifier[toOffset] , Keyword[int] identifier[month] , Keyword[int] identifier[weekInMonth] , Keyword[int] identifier[dayOfWeek] , Keyword[long] identifier[startTime] , Keyword[long] identifier[untilTime] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[beginZoneProps] operator[SEP] identifier[writer] , identifier[isDst] , identifier[tzname] , identifier[fromOffset] , identifier[toOffset] , identifier[startTime] operator[SEP] operator[SEP] identifier[beginRRULE] operator[SEP] identifier[writer] , identifier[month] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[ICAL_BYDAY] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[EQUALS_SIGN] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[weekInMonth] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[ICAL_DOW_NAMES] operator[SEP] identifier[dayOfWeek] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[untilTime] operator[!=] identifier[MAX_TIME] operator[SEP] {
identifier[appendUNTIL] operator[SEP] identifier[writer] , identifier[getDateTimeString] operator[SEP] identifier[untilTime] operator[+] identifier[fromOffset] operator[SEP] operator[SEP] operator[SEP]
}
identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[NEWLINE] operator[SEP] operator[SEP] identifier[endZoneProps] operator[SEP] identifier[writer] , identifier[isDst] operator[SEP] operator[SEP]
}
|
public void processResetRequestAck(long dmeVersion, SendDispatcher sendDispatcher)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "processResetRequestAck", Long.valueOf(dmeVersion));
// Only consider non-stale request acks
if (dmeVersion >= _latestDMEVersion)
{
if (dmeVersion > _latestDMEVersion)
_latestDMEVersion = dmeVersion;
_slowedGetTOM.applyToEachEntry(new AddToEagerTOM(_slowedGetTOM, dmeVersion));
sendDispatcher.sendResetRequestAckAck(dmeVersion);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "processResetRequestAck");
} | class class_name[name] begin[{]
method[processResetRequestAck, return_type[void], modifier[public], parameter[dmeVersion, sendDispatcher]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["processResetRequestAck"], call[Long.valueOf, parameter[member[.dmeVersion]]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.dmeVersion], >=, member[._latestDMEVersion]]] begin[{]
if[binary_operation[member[.dmeVersion], >, member[._latestDMEVersion]]] begin[{]
assign[member[._latestDMEVersion], member[.dmeVersion]]
else begin[{]
None
end[}]
call[_slowedGetTOM.applyToEachEntry, parameter[ClassCreator(arguments=[MemberReference(member=_slowedGetTOM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dmeVersion, 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=AddToEagerTOM, sub_type=None))]]
call[sendDispatcher.sendResetRequestAckAck, parameter[member[.dmeVersion]]]
else begin[{]
None
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["processResetRequestAck"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[processResetRequestAck] operator[SEP] Keyword[long] identifier[dmeVersion] , identifier[SendDispatcher] identifier[sendDispatcher] 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] , identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[dmeVersion] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dmeVersion] operator[>=] identifier[_latestDMEVersion] operator[SEP] {
Keyword[if] operator[SEP] identifier[dmeVersion] operator[>] identifier[_latestDMEVersion] operator[SEP] identifier[_latestDMEVersion] operator[=] identifier[dmeVersion] operator[SEP] identifier[_slowedGetTOM] operator[SEP] identifier[applyToEachEntry] operator[SEP] Keyword[new] identifier[AddToEagerTOM] operator[SEP] identifier[_slowedGetTOM] , identifier[dmeVersion] operator[SEP] operator[SEP] operator[SEP] identifier[sendDispatcher] operator[SEP] identifier[sendResetRequestAckAck] operator[SEP] identifier[dmeVersion] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
protected static CertificateFactory getCertificateFactory()
throws GeneralSecurityException {
if (provider == null) {
return CertificateFactory.getInstance("X.509");
} else {
return CertificateFactory.getInstance("X.509", provider);
}
} | class class_name[name] begin[{]
method[getCertificateFactory, return_type[type[CertificateFactory]], modifier[static protected], parameter[]] begin[{]
if[binary_operation[member[.provider], ==, literal[null]]] begin[{]
return[call[CertificateFactory.getInstance, parameter[literal["X.509"]]]]
else begin[{]
return[call[CertificateFactory.getInstance, parameter[literal["X.509"], member[.provider]]]]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[static] identifier[CertificateFactory] identifier[getCertificateFactory] operator[SEP] operator[SEP] Keyword[throws] identifier[GeneralSecurityException] {
Keyword[if] operator[SEP] identifier[provider] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[CertificateFactory] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[CertificateFactory] operator[SEP] identifier[getInstance] operator[SEP] literal[String] , identifier[provider] operator[SEP] operator[SEP]
}
}
|
public static void transform( Se3_F64 se, Point3D_F64[] points , int start , int length ) {
for (int i = 0; i < length; i++) {
Point3D_F64 p = points[i+start];
transform(se,p,p);
}
} | class class_name[name] begin[{]
method[transform, return_type[void], modifier[public static], parameter[se, points, start, length]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=points, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Point3D_F64, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=se, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[transform] operator[SEP] identifier[Se3_F64] identifier[se] , identifier[Point3D_F64] operator[SEP] operator[SEP] identifier[points] , Keyword[int] identifier[start] , Keyword[int] identifier[length] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Point3D_F64] identifier[p] operator[=] identifier[points] operator[SEP] identifier[i] operator[+] identifier[start] operator[SEP] operator[SEP] identifier[transform] operator[SEP] identifier[se] , identifier[p] , identifier[p] operator[SEP] operator[SEP]
}
}
|
static <K, V> PageMetadata<K, V> mergeTokenAndQueryParameters(String paginationToken, final
ViewQueryParameters<K, V> initialParameters) {
// Decode the base64 token into JSON
String json = new String(Base64.decodeBase64(paginationToken), Charset.forName("UTF-8"));
// Get a suitable Gson, we need any adapter registered for the K key type
Gson paginationTokenGson = getGsonWithKeyAdapter(initialParameters);
// Deserialize the pagination token JSON, using the appropriate K, V types
PaginationToken token = paginationTokenGson.fromJson(json, PaginationToken.class);
// Create new query parameters using the initial ViewQueryParameters as a starting point.
ViewQueryParameters<K, V> tokenPageParameters = initialParameters.copy();
// Merge the values from the token into the new query parameters
tokenPageParameters.descending = token.descending;
tokenPageParameters.endkey = token.endkey;
tokenPageParameters.endkey_docid = token.endkey_docid;
tokenPageParameters.inclusive_end = token.inclusive_end;
tokenPageParameters.startkey = token.startkey;
tokenPageParameters.startkey_docid = token.startkey_docid;
return new PageMetadata<K, V>(token.direction, token
.pageNumber, tokenPageParameters);
} | class class_name[name] begin[{]
method[mergeTokenAndQueryParameters, return_type[type[PageMetadata]], modifier[static], parameter[paginationToken, initialParameters]] begin[{]
local_variable[type[String], json]
local_variable[type[Gson], paginationTokenGson]
local_variable[type[PaginationToken], token]
local_variable[type[ViewQueryParameters], tokenPageParameters]
assign[member[tokenPageParameters.descending], member[token.descending]]
assign[member[tokenPageParameters.endkey], member[token.endkey]]
assign[member[tokenPageParameters.endkey_docid], member[token.endkey_docid]]
assign[member[tokenPageParameters.inclusive_end], member[token.inclusive_end]]
assign[member[tokenPageParameters.startkey], member[token.startkey]]
assign[member[tokenPageParameters.startkey_docid], member[token.startkey_docid]]
return[ClassCreator(arguments=[MemberReference(member=direction, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[]), MemberReference(member=pageNumber, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[]), MemberReference(member=tokenPageParameters, 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=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=PageMetadata, sub_type=None))]
end[}]
END[}] | Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[PageMetadata] operator[<] identifier[K] , identifier[V] operator[>] identifier[mergeTokenAndQueryParameters] operator[SEP] identifier[String] identifier[paginationToken] , Keyword[final] identifier[ViewQueryParameters] operator[<] identifier[K] , identifier[V] operator[>] identifier[initialParameters] operator[SEP] {
identifier[String] identifier[json] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[Base64] operator[SEP] identifier[decodeBase64] operator[SEP] identifier[paginationToken] operator[SEP] , identifier[Charset] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[Gson] identifier[paginationTokenGson] operator[=] identifier[getGsonWithKeyAdapter] operator[SEP] identifier[initialParameters] operator[SEP] operator[SEP] identifier[PaginationToken] identifier[token] operator[=] identifier[paginationTokenGson] operator[SEP] identifier[fromJson] operator[SEP] identifier[json] , identifier[PaginationToken] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[ViewQueryParameters] operator[<] identifier[K] , identifier[V] operator[>] identifier[tokenPageParameters] operator[=] identifier[initialParameters] operator[SEP] identifier[copy] operator[SEP] operator[SEP] operator[SEP] identifier[tokenPageParameters] operator[SEP] identifier[descending] operator[=] identifier[token] operator[SEP] identifier[descending] operator[SEP] identifier[tokenPageParameters] operator[SEP] identifier[endkey] operator[=] identifier[token] operator[SEP] identifier[endkey] operator[SEP] identifier[tokenPageParameters] operator[SEP] identifier[endkey_docid] operator[=] identifier[token] operator[SEP] identifier[endkey_docid] operator[SEP] identifier[tokenPageParameters] operator[SEP] identifier[inclusive_end] operator[=] identifier[token] operator[SEP] identifier[inclusive_end] operator[SEP] identifier[tokenPageParameters] operator[SEP] identifier[startkey] operator[=] identifier[token] operator[SEP] identifier[startkey] operator[SEP] identifier[tokenPageParameters] operator[SEP] identifier[startkey_docid] operator[=] identifier[token] operator[SEP] identifier[startkey_docid] operator[SEP] Keyword[return] Keyword[new] identifier[PageMetadata] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] identifier[token] operator[SEP] identifier[direction] , identifier[token] operator[SEP] identifier[pageNumber] , identifier[tokenPageParameters] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.