code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
@SuppressWarnings("unchecked")
@Override
public EList<IfcValue> getEnumerationValues() {
return (EList<IfcValue>) eGet(Ifc4Package.Literals.IFC_PROPERTY_ENUMERATED_VALUE__ENUMERATION_VALUES, true);
} | class class_name[name] begin[{]
method[getEnumerationValues, return_type[type[EList]], modifier[public], parameter[]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=IFC_PROPERTY_ENUMERATED_VALUE__ENUMERATION_VALUES, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package.Literals, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IfcValue, sub_type=None))], dimensions=[], name=EList, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[EList] operator[<] identifier[IfcValue] operator[>] identifier[getEnumerationValues] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[EList] operator[<] identifier[IfcValue] operator[>] operator[SEP] identifier[eGet] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[Literals] operator[SEP] identifier[IFC_PROPERTY_ENUMERATED_VALUE__ENUMERATION_VALUES] , literal[boolean] operator[SEP] operator[SEP]
}
|
protected PGPPublicKey findPublicKey(InputStream publicKey, KeyFilter<PGPPublicKey> keyFilter ) {
LOGGER.trace("findPublicKey(InputStream, KeyFilter<PGPPublicKey>)");
LOGGER.trace("Public Key: {}, Key Filter: {}", publicKey == null ? "not set" : "set", keyFilter == null ? "not set" : "set");
return retrievePublicKey(readPublicKeyRing(publicKey), keyFilter);
} | class class_name[name] begin[{]
method[findPublicKey, return_type[type[PGPPublicKey]], modifier[protected], parameter[publicKey, keyFilter]] begin[{]
call[LOGGER.trace, parameter[literal["findPublicKey(InputStream, KeyFilter<PGPPublicKey>)"]]]
call[LOGGER.trace, parameter[literal["Public Key: {}, Key Filter: {}"], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=publicKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="set"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not set")), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=keyFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="set"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not set"))]]
return[call[.retrievePublicKey, parameter[call[.readPublicKeyRing, parameter[member[.publicKey]]], member[.keyFilter]]]]
end[}]
END[}] | Keyword[protected] identifier[PGPPublicKey] identifier[findPublicKey] operator[SEP] identifier[InputStream] identifier[publicKey] , identifier[KeyFilter] operator[<] identifier[PGPPublicKey] operator[>] identifier[keyFilter] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[publicKey] operator[==] Other[null] operator[?] literal[String] operator[:] literal[String] , identifier[keyFilter] operator[==] Other[null] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[retrievePublicKey] operator[SEP] identifier[readPublicKeyRing] operator[SEP] identifier[publicKey] operator[SEP] , identifier[keyFilter] operator[SEP] operator[SEP]
}
|
public AdvisorListResultInner listByServer(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).toBlocking().single().body();
} | class class_name[name] begin[{]
method[listByServer, return_type[type[AdvisorListResultInner]], modifier[public], parameter[resourceGroupName, serverName]] begin[{]
return[call[.listByServerWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.serverName]]]]
end[}]
END[}] | Keyword[public] identifier[AdvisorListResultInner] identifier[listByServer] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[serverName] operator[SEP] {
Keyword[return] identifier[listByServerWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[serverName] 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 List<Class<?>> resolveFieldGenerics(final Field field) {
return switchContext4field(field).resolveGenericsOf(field.getGenericType());
} | class class_name[name] begin[{]
method[resolveFieldGenerics, return_type[type[List]], modifier[public], parameter[field]] begin[{]
return[call[.switchContext4field, parameter[member[.field]]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[resolveFieldGenerics] operator[SEP] Keyword[final] identifier[Field] identifier[field] operator[SEP] {
Keyword[return] identifier[switchContext4field] operator[SEP] identifier[field] operator[SEP] operator[SEP] identifier[resolveGenericsOf] operator[SEP] identifier[field] operator[SEP] identifier[getGenericType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public ConstantNameAndTypeInfo addConstantNameAndType(String name,
Descriptor type) {
return (ConstantNameAndTypeInfo)addConstant(new ConstantNameAndTypeInfo(this, name, type));
} | class class_name[name] begin[{]
method[addConstantNameAndType, return_type[type[ConstantNameAndTypeInfo]], modifier[public], parameter[name, type]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, 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=ConstantNameAndTypeInfo, sub_type=None))], member=addConstant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ConstantNameAndTypeInfo, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[ConstantNameAndTypeInfo] identifier[addConstantNameAndType] operator[SEP] identifier[String] identifier[name] , identifier[Descriptor] identifier[type] operator[SEP] {
Keyword[return] operator[SEP] identifier[ConstantNameAndTypeInfo] operator[SEP] identifier[addConstant] operator[SEP] Keyword[new] identifier[ConstantNameAndTypeInfo] operator[SEP] Keyword[this] , identifier[name] , identifier[type] operator[SEP] operator[SEP] operator[SEP]
}
|
protected void writeText(IoSession session, String text, ProtocolDecoderOutput out) {
out.write(text);
} | class class_name[name] begin[{]
method[writeText, return_type[void], modifier[protected], parameter[session, text, out]] begin[{]
call[out.write, parameter[member[.text]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[writeText] operator[SEP] identifier[IoSession] identifier[session] , identifier[String] identifier[text] , identifier[ProtocolDecoderOutput] identifier[out] operator[SEP] {
identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[text] operator[SEP] operator[SEP]
}
|
private static IReactionScheme setScheme(IReaction reaction, IReactionSet reactionSet) {
IReactionScheme reactionScheme = reaction.getBuilder().newInstance(IReactionScheme.class);
IReactionSet reactConSet = extractSubsequentReaction(reaction, reactionSet);
if (reactConSet.getReactionCount() != 0) {
for (IReaction reactionInt : reactConSet.reactions()) {
reactionScheme.addReaction(reactionInt);
IReactionScheme newRScheme = setScheme(reactionInt, reactionSet);
if (newRScheme.getReactionCount() != 0 || newRScheme.getReactionSchemeCount() != 0) {
reactionScheme.add(newRScheme);
}
}
}
return reactionScheme;
} | class class_name[name] begin[{]
method[setScheme, return_type[type[IReactionScheme]], modifier[private static], parameter[reaction, reactionSet]] begin[{]
local_variable[type[IReactionScheme], reactionScheme]
local_variable[type[IReactionSet], reactConSet]
if[binary_operation[call[reactConSet.getReactionCount, parameter[]], !=, literal[0]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=reactionInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addReaction, postfix_operators=[], prefix_operators=[], qualifier=reactionScheme, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=reactionInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=reactionSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setScheme, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=newRScheme)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IReactionScheme, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getReactionCount, postfix_operators=[], prefix_operators=[], qualifier=newRScheme, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getReactionSchemeCount, postfix_operators=[], prefix_operators=[], qualifier=newRScheme, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=newRScheme, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=reactionScheme, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=reactions, postfix_operators=[], prefix_operators=[], qualifier=reactConSet, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=reactionInt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IReaction, sub_type=None))), label=None)
else begin[{]
None
end[}]
return[member[.reactionScheme]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[IReactionScheme] identifier[setScheme] operator[SEP] identifier[IReaction] identifier[reaction] , identifier[IReactionSet] identifier[reactionSet] operator[SEP] {
identifier[IReactionScheme] identifier[reactionScheme] operator[=] identifier[reaction] operator[SEP] identifier[getBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] identifier[IReactionScheme] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[IReactionSet] identifier[reactConSet] operator[=] identifier[extractSubsequentReaction] operator[SEP] identifier[reaction] , identifier[reactionSet] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reactConSet] operator[SEP] identifier[getReactionCount] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[for] operator[SEP] identifier[IReaction] identifier[reactionInt] operator[:] identifier[reactConSet] operator[SEP] identifier[reactions] operator[SEP] operator[SEP] operator[SEP] {
identifier[reactionScheme] operator[SEP] identifier[addReaction] operator[SEP] identifier[reactionInt] operator[SEP] operator[SEP] identifier[IReactionScheme] identifier[newRScheme] operator[=] identifier[setScheme] operator[SEP] identifier[reactionInt] , identifier[reactionSet] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newRScheme] operator[SEP] identifier[getReactionCount] operator[SEP] operator[SEP] operator[!=] Other[0] operator[||] identifier[newRScheme] operator[SEP] identifier[getReactionSchemeCount] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[reactionScheme] operator[SEP] identifier[add] operator[SEP] identifier[newRScheme] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[reactionScheme] operator[SEP]
}
|
private void handleMulti(@NonNull String[] permissionNames) {
List<String> permissions = declinedPermissionsAsList(context, permissionNames);
if (permissions.isEmpty()) {
permissionCallback.onPermissionGranted(permissionNames);
return;
}
boolean hasAlertWindowPermission = permissions.contains(Manifest.permission.SYSTEM_ALERT_WINDOW);
if (hasAlertWindowPermission) {
int index = permissions.indexOf(Manifest.permission.SYSTEM_ALERT_WINDOW);
permissions.remove(index);
}
ActivityCompat.requestPermissions(context, permissions.toArray(new String[permissions.size()]), REQUEST_PERMISSIONS);
} | class class_name[name] begin[{]
method[handleMulti, return_type[void], modifier[private], parameter[permissionNames]] begin[{]
local_variable[type[List], permissions]
if[call[permissions.isEmpty, parameter[]]] begin[{]
call[permissionCallback.onPermissionGranted, parameter[member[.permissionNames]]]
return[None]
else begin[{]
None
end[}]
local_variable[type[boolean], hasAlertWindowPermission]
if[member[.hasAlertWindowPermission]] begin[{]
local_variable[type[int], index]
call[permissions.remove, parameter[member[.index]]]
else begin[{]
None
end[}]
call[ActivityCompat.requestPermissions, parameter[member[.context], call[permissions.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=permissions, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]], member[.REQUEST_PERMISSIONS]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[handleMulti] operator[SEP] annotation[@] identifier[NonNull] identifier[String] operator[SEP] operator[SEP] identifier[permissionNames] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[permissions] operator[=] identifier[declinedPermissionsAsList] operator[SEP] identifier[context] , identifier[permissionNames] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[permissions] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[permissionCallback] operator[SEP] identifier[onPermissionGranted] operator[SEP] identifier[permissionNames] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[boolean] identifier[hasAlertWindowPermission] operator[=] identifier[permissions] operator[SEP] identifier[contains] operator[SEP] identifier[Manifest] operator[SEP] identifier[permission] operator[SEP] identifier[SYSTEM_ALERT_WINDOW] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasAlertWindowPermission] operator[SEP] {
Keyword[int] identifier[index] operator[=] identifier[permissions] operator[SEP] identifier[indexOf] operator[SEP] identifier[Manifest] operator[SEP] identifier[permission] operator[SEP] identifier[SYSTEM_ALERT_WINDOW] operator[SEP] operator[SEP] identifier[permissions] operator[SEP] identifier[remove] operator[SEP] identifier[index] operator[SEP] operator[SEP]
}
identifier[ActivityCompat] operator[SEP] identifier[requestPermissions] operator[SEP] identifier[context] , identifier[permissions] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[permissions] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] , identifier[REQUEST_PERMISSIONS] operator[SEP] operator[SEP]
}
|
public void marshall(Invite invite, ProtocolMarshaller protocolMarshaller) {
if (invite == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(invite.getInviteId(), INVITEID_BINDING);
protocolMarshaller.marshall(invite.getStatus(), STATUS_BINDING);
protocolMarshaller.marshall(invite.getEmailAddress(), EMAILADDRESS_BINDING);
protocolMarshaller.marshall(invite.getEmailStatus(), EMAILSTATUS_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[invite, protocolMarshaller]] begin[{]
if[binary_operation[member[.invite], ==, 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=getInviteId, postfix_operators=[], prefix_operators=[], qualifier=invite, selectors=[], type_arguments=None), MemberReference(member=INVITEID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=invite, selectors=[], type_arguments=None), MemberReference(member=STATUS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEmailAddress, postfix_operators=[], prefix_operators=[], qualifier=invite, selectors=[], type_arguments=None), MemberReference(member=EMAILADDRESS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEmailStatus, postfix_operators=[], prefix_operators=[], qualifier=invite, selectors=[], type_arguments=None), MemberReference(member=EMAILSTATUS_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[Invite] identifier[invite] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[invite] 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[invite] operator[SEP] identifier[getInviteId] operator[SEP] operator[SEP] , identifier[INVITEID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[invite] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[STATUS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[invite] operator[SEP] identifier[getEmailAddress] operator[SEP] operator[SEP] , identifier[EMAILADDRESS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[invite] operator[SEP] identifier[getEmailStatus] operator[SEP] operator[SEP] , identifier[EMAILSTATUS_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 Object[] setEnableNonFilter(Object[] rgobjEnable, boolean bHasNext, boolean bBreak, boolean bAfterRequery, boolean bSelectEOF, boolean bFieldListeners)
{
boolean bEnable = (rgobjEnable == null) ? false : true;
if (bFieldListeners)
{
if (rgobjEnable == null)
rgobjEnable = this.setEnableFieldListeners(bEnable);
else
this.setEnableFieldListeners(rgobjEnable);
}
else
{
if (rgobjEnable == null)
rgobjEnable = new Object[0];
}
FileListener listener = this.getListener();
int iCount = this.getFieldCount();
while (listener != null)
{
if (!(listener instanceof org.jbundle.base.db.filter.FileFilter))
{
if (!bEnable)
{
rgobjEnable = Utility.growArray(rgobjEnable, iCount + 1, 8);
if (listener.isEnabledListener())
rgobjEnable[iCount] = Boolean.TRUE;
else
rgobjEnable[iCount] = Boolean.FALSE;
listener.setEnabledListener(bEnable);
}
else
{ // Enable
boolean bEnableThis = true;
if (iCount < rgobjEnable.length)
if (rgobjEnable[iCount] != null)
bEnableThis = ((Boolean)rgobjEnable[iCount]).booleanValue();
listener.setEnabledListener(bEnableThis);
}
iCount++;
}
listener = (FileListener)listener.getNextListener();
}
if (bEnable)
{
if (bAfterRequery)
this.handleRecordChange(null, DBConstants.AFTER_REQUERY_TYPE, true);
if (bBreak)
this.handleRecordChange(null, DBConstants.CONTROL_BREAK_TYPE, true);
if (bHasNext)
{
this.handleValidRecord(true);
this.handleRecordChange(null, DBConstants.MOVE_NEXT_TYPE, true);
}
if (bSelectEOF)
this.handleRecordChange(null, DBConstants.SELECT_EOF_TYPE, true);
if (this.getTable().getCurrentTable().getRecord() != this)
{ // Special logic - match listeners on current record (if shared)
boolean bCloneListeners = false;
boolean bMatchEnabledState = true;
boolean bSyncReferenceFields = false;
boolean bMatchSelectedState = true;
this.matchListeners(this.getTable().getCurrentTable().getRecord(), bCloneListeners, bMatchEnabledState, bSyncReferenceFields, bMatchSelectedState, true);
}
}
return rgobjEnable;
} | class class_name[name] begin[{]
method[setEnableNonFilter, return_type[type[Object]], modifier[public], parameter[rgobjEnable, bHasNext, bBreak, bAfterRequery, bSelectEOF, bFieldListeners]] begin[{]
local_variable[type[boolean], bEnable]
if[member[.bFieldListeners]] begin[{]
if[binary_operation[member[.rgobjEnable], ==, literal[null]]] begin[{]
assign[member[.rgobjEnable], THIS[call[None.setEnableFieldListeners, parameter[member[.bEnable]]]]]
else begin[{]
THIS[call[None.setEnableFieldListeners, parameter[member[.rgobjEnable]]]]
end[}]
else begin[{]
if[binary_operation[member[.rgobjEnable], ==, literal[null]]] begin[{]
assign[member[.rgobjEnable], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]
else begin[{]
None
end[}]
end[}]
local_variable[type[FileListener], listener]
local_variable[type[int], iCount]
while[binary_operation[member[.listener], !=, literal[null]]] begin[{]
if[binary_operation[member[.listener], instanceof, type[org]]] begin[{]
if[member[.bEnable]] begin[{]
assign[member[.rgobjEnable], call[Utility.growArray, parameter[member[.rgobjEnable], binary_operation[member[.iCount], +, literal[1]], literal[8]]]]
if[call[listener.isEnabledListener, parameter[]]] begin[{]
assign[member[.rgobjEnable], member[Boolean.TRUE]]
else begin[{]
assign[member[.rgobjEnable], member[Boolean.FALSE]]
end[}]
call[listener.setEnabledListener, parameter[member[.bEnable]]]
else begin[{]
local_variable[type[boolean], bEnableThis]
if[binary_operation[member[.iCount], <, member[rgobjEnable.length]]] begin[{]
if[binary_operation[member[.rgobjEnable], !=, literal[null]]] begin[{]
assign[member[.bEnableThis], Cast(expression=MemberReference(member=rgobjEnable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=iCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[listener.setEnabledListener, parameter[member[.bEnableThis]]]
end[}]
member[.iCount]
else begin[{]
None
end[}]
assign[member[.listener], Cast(expression=MethodInvocation(arguments=[], member=getNextListener, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=FileListener, sub_type=None))]
end[}]
if[member[.bEnable]] begin[{]
if[member[.bAfterRequery]] begin[{]
THIS[call[None.handleRecordChange, parameter[literal[null], member[DBConstants.AFTER_REQUERY_TYPE], literal[true]]]]
else begin[{]
None
end[}]
if[member[.bBreak]] begin[{]
THIS[call[None.handleRecordChange, parameter[literal[null], member[DBConstants.CONTROL_BREAK_TYPE], literal[true]]]]
else begin[{]
None
end[}]
if[member[.bHasNext]] begin[{]
THIS[call[None.handleValidRecord, parameter[literal[true]]]]
THIS[call[None.handleRecordChange, parameter[literal[null], member[DBConstants.MOVE_NEXT_TYPE], literal[true]]]]
else begin[{]
None
end[}]
if[member[.bSelectEOF]] begin[{]
THIS[call[None.handleRecordChange, parameter[literal[null], member[DBConstants.SELECT_EOF_TYPE], literal[true]]]]
else begin[{]
None
end[}]
if[binary_operation[THIS[call[None.getTable, parameter[]]call[None.getCurrentTable, parameter[]]call[None.getRecord, parameter[]]], !=, THIS[]]] begin[{]
local_variable[type[boolean], bCloneListeners]
local_variable[type[boolean], bMatchEnabledState]
local_variable[type[boolean], bSyncReferenceFields]
local_variable[type[boolean], bMatchSelectedState]
THIS[call[None.matchListeners, parameter[THIS[call[None.getTable, parameter[]]call[None.getCurrentTable, parameter[]]call[None.getRecord, parameter[]]], member[.bCloneListeners], member[.bMatchEnabledState], member[.bSyncReferenceFields], member[.bMatchSelectedState], literal[true]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.rgobjEnable]]
end[}]
END[}] | Keyword[public] identifier[Object] operator[SEP] operator[SEP] identifier[setEnableNonFilter] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[rgobjEnable] , Keyword[boolean] identifier[bHasNext] , Keyword[boolean] identifier[bBreak] , Keyword[boolean] identifier[bAfterRequery] , Keyword[boolean] identifier[bSelectEOF] , Keyword[boolean] identifier[bFieldListeners] operator[SEP] {
Keyword[boolean] identifier[bEnable] operator[=] operator[SEP] identifier[rgobjEnable] operator[==] Other[null] operator[SEP] operator[?] literal[boolean] operator[:] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[bFieldListeners] operator[SEP] {
Keyword[if] operator[SEP] identifier[rgobjEnable] operator[==] Other[null] operator[SEP] identifier[rgobjEnable] operator[=] Keyword[this] operator[SEP] identifier[setEnableFieldListeners] operator[SEP] identifier[bEnable] operator[SEP] operator[SEP] Keyword[else] Keyword[this] operator[SEP] identifier[setEnableFieldListeners] operator[SEP] identifier[rgobjEnable] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[rgobjEnable] operator[==] Other[null] operator[SEP] identifier[rgobjEnable] operator[=] Keyword[new] identifier[Object] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
identifier[FileListener] identifier[listener] operator[=] Keyword[this] operator[SEP] identifier[getListener] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[iCount] operator[=] Keyword[this] operator[SEP] identifier[getFieldCount] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[listener] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[listener] Keyword[instanceof] identifier[org] operator[SEP] identifier[jbundle] operator[SEP] identifier[base] operator[SEP] identifier[db] operator[SEP] identifier[filter] operator[SEP] identifier[FileFilter] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[bEnable] operator[SEP] {
identifier[rgobjEnable] operator[=] identifier[Utility] operator[SEP] identifier[growArray] operator[SEP] identifier[rgobjEnable] , identifier[iCount] operator[+] Other[1] , Other[8] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[listener] operator[SEP] identifier[isEnabledListener] operator[SEP] operator[SEP] operator[SEP] identifier[rgobjEnable] operator[SEP] identifier[iCount] operator[SEP] operator[=] identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] Keyword[else] identifier[rgobjEnable] operator[SEP] identifier[iCount] operator[SEP] operator[=] identifier[Boolean] operator[SEP] identifier[FALSE] operator[SEP] identifier[listener] operator[SEP] identifier[setEnabledListener] operator[SEP] identifier[bEnable] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[boolean] identifier[bEnableThis] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[iCount] operator[<] identifier[rgobjEnable] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[rgobjEnable] operator[SEP] identifier[iCount] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[bEnableThis] operator[=] operator[SEP] operator[SEP] identifier[Boolean] operator[SEP] identifier[rgobjEnable] operator[SEP] identifier[iCount] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] identifier[listener] operator[SEP] identifier[setEnabledListener] operator[SEP] identifier[bEnableThis] operator[SEP] operator[SEP]
}
identifier[iCount] operator[++] operator[SEP]
}
identifier[listener] operator[=] operator[SEP] identifier[FileListener] operator[SEP] identifier[listener] operator[SEP] identifier[getNextListener] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[bEnable] operator[SEP] {
Keyword[if] operator[SEP] identifier[bAfterRequery] operator[SEP] Keyword[this] operator[SEP] identifier[handleRecordChange] operator[SEP] Other[null] , identifier[DBConstants] operator[SEP] identifier[AFTER_REQUERY_TYPE] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bBreak] operator[SEP] Keyword[this] operator[SEP] identifier[handleRecordChange] operator[SEP] Other[null] , identifier[DBConstants] operator[SEP] identifier[CONTROL_BREAK_TYPE] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bHasNext] operator[SEP] {
Keyword[this] operator[SEP] identifier[handleValidRecord] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[handleRecordChange] operator[SEP] Other[null] , identifier[DBConstants] operator[SEP] identifier[MOVE_NEXT_TYPE] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[bSelectEOF] operator[SEP] Keyword[this] operator[SEP] identifier[handleRecordChange] operator[SEP] Other[null] , identifier[DBConstants] operator[SEP] identifier[SELECT_EOF_TYPE] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getTable] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentTable] operator[SEP] operator[SEP] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[!=] Keyword[this] operator[SEP] {
Keyword[boolean] identifier[bCloneListeners] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[bMatchEnabledState] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[bSyncReferenceFields] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[bMatchSelectedState] operator[=] literal[boolean] operator[SEP] Keyword[this] operator[SEP] identifier[matchListeners] operator[SEP] Keyword[this] operator[SEP] identifier[getTable] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentTable] operator[SEP] operator[SEP] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] , identifier[bCloneListeners] , identifier[bMatchEnabledState] , identifier[bSyncReferenceFields] , identifier[bMatchSelectedState] , literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[rgobjEnable] operator[SEP]
}
|
public static CalendarYear from(GregorianDate date) {
PlainDate iso = PlainDate.from(date); // includes validation
return CalendarYear.of(iso.getYear());
} | class class_name[name] begin[{]
method[from, return_type[type[CalendarYear]], modifier[public static], parameter[date]] begin[{]
local_variable[type[PlainDate], iso]
return[call[CalendarYear.of, parameter[call[iso.getYear, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[CalendarYear] identifier[from] operator[SEP] identifier[GregorianDate] identifier[date] operator[SEP] {
identifier[PlainDate] identifier[iso] operator[=] identifier[PlainDate] operator[SEP] identifier[from] operator[SEP] identifier[date] operator[SEP] operator[SEP] Keyword[return] identifier[CalendarYear] operator[SEP] identifier[of] operator[SEP] identifier[iso] operator[SEP] identifier[getYear] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@XmlElementDecl(namespace = "http://www.w3.org/1999/xlink", name = "locator")
public JAXBElement<LocatorType> createLocator(LocatorType value) {
return new JAXBElement<LocatorType>(_Locator_QNAME, LocatorType.class, null, value);
} | class class_name[name] begin[{]
method[createLocator, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=_Locator_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LocatorType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=LocatorType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[LocatorType] operator[>] identifier[createLocator] operator[SEP] identifier[LocatorType] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[LocatorType] operator[>] operator[SEP] identifier[_Locator_QNAME] , identifier[LocatorType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP]
}
|
public String getLatLonBoundaryAsWKT(int maxPointsInYEdge, int maxPointsInXEdge) {
List<LatLonPointNoNormalize> points = calcConnectedLatLonBoundaryPoints(maxPointsInYEdge, maxPointsInXEdge);
StringBuilder sb = new StringBuilder("POLYGON((");
for (LatLonPointNoNormalize point : points) {
sb.append(String.format("%.3f %.3f, ", point.getLongitude(), point.getLatitude()));
}
sb.delete(sb.length() - 2, sb.length()); // Nuke trailing comma and space.
sb.append("))");
return sb.toString();
} | class class_name[name] begin[{]
method[getLatLonBoundaryAsWKT, return_type[type[String]], modifier[public], parameter[maxPointsInYEdge, maxPointsInXEdge]] begin[{]
local_variable[type[List], points]
local_variable[type[StringBuilder], sb]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%.3f %.3f, "), MethodInvocation(arguments=[], member=getLongitude, postfix_operators=[], prefix_operators=[], qualifier=point, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getLatitude, postfix_operators=[], prefix_operators=[], qualifier=point, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=points, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=point)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LatLonPointNoNormalize, sub_type=None))), label=None)
call[sb.delete, parameter[binary_operation[call[sb.length, parameter[]], -, literal[2]], call[sb.length, parameter[]]]]
call[sb.append, parameter[literal["))"]]]
return[call[sb.toString, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getLatLonBoundaryAsWKT] operator[SEP] Keyword[int] identifier[maxPointsInYEdge] , Keyword[int] identifier[maxPointsInXEdge] operator[SEP] {
identifier[List] operator[<] identifier[LatLonPointNoNormalize] operator[>] identifier[points] operator[=] identifier[calcConnectedLatLonBoundaryPoints] operator[SEP] identifier[maxPointsInYEdge] , identifier[maxPointsInXEdge] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[LatLonPointNoNormalize] identifier[point] operator[:] identifier[points] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[point] operator[SEP] identifier[getLongitude] operator[SEP] operator[SEP] , identifier[point] operator[SEP] identifier[getLatitude] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[sb] operator[SEP] identifier[delete] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[2] , identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public final LocatedString contentLocatedSubstringByContentOffsets(
final OffsetRange<CharOffset> contentOffsets) {
final UnicodeFriendlyString substringText = content().substringByCodePoints(contentOffsets);
final List<CharacterRegion> substringOffsets =
offsetsOfSubstringByContentCodepointOffsets(contentOffsets);
return new LocatedString.Builder().content(substringText).referenceString(referenceString())
.characterRegions(substringOffsets).build();
} | class class_name[name] begin[{]
method[contentLocatedSubstringByContentOffsets, return_type[type[LocatedString]], modifier[final public], parameter[contentOffsets]] begin[{]
local_variable[type[UnicodeFriendlyString], substringText]
local_variable[type[List], substringOffsets]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=substringText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=content, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=referenceString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=referenceString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=substringOffsets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=characterRegions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=LocatedString, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None)))]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[LocatedString] identifier[contentLocatedSubstringByContentOffsets] operator[SEP] Keyword[final] identifier[OffsetRange] operator[<] identifier[CharOffset] operator[>] identifier[contentOffsets] operator[SEP] {
Keyword[final] identifier[UnicodeFriendlyString] identifier[substringText] operator[=] identifier[content] operator[SEP] operator[SEP] operator[SEP] identifier[substringByCodePoints] operator[SEP] identifier[contentOffsets] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[CharacterRegion] operator[>] identifier[substringOffsets] operator[=] identifier[offsetsOfSubstringByContentCodepointOffsets] operator[SEP] identifier[contentOffsets] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[LocatedString] operator[SEP] identifier[Builder] operator[SEP] operator[SEP] operator[SEP] identifier[content] operator[SEP] identifier[substringText] operator[SEP] operator[SEP] identifier[referenceString] operator[SEP] identifier[referenceString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[characterRegions] operator[SEP] identifier[substringOffsets] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BpsimPackage.WEIBULL_DISTRIBUTION_TYPE__SCALE:
return isSetScale();
case BpsimPackage.WEIBULL_DISTRIBUTION_TYPE__SHAPE:
return isSetShape();
}
return super.eIsSet(featureID);
} | class class_name[name] begin[{]
method[eIsSet, return_type[type[boolean]], modifier[public], parameter[featureID]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=WEIBULL_DISTRIBUTION_TYPE__SCALE, postfix_operators=[], prefix_operators=[], qualifier=BpsimPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isSetScale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=WEIBULL_DISTRIBUTION_TYPE__SHAPE, postfix_operators=[], prefix_operators=[], qualifier=BpsimPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=isSetShape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eIsSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[eIsSet] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[BpsimPackage] operator[SEP] identifier[WEIBULL_DISTRIBUTION_TYPE__SCALE] operator[:] Keyword[return] identifier[isSetScale] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[BpsimPackage] operator[SEP] identifier[WEIBULL_DISTRIBUTION_TYPE__SHAPE] operator[:] Keyword[return] identifier[isSetShape] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eIsSet] operator[SEP] identifier[featureID] operator[SEP] operator[SEP]
}
|
private void init() {
if (placeholder == null) {
IdentificationManager.getInstance().registerIdentification(this);
Optional<Identification> identification = IdentificationManager.getInstance().getIdentification(this);
if (!identification.isPresent()) {
throw new IllegalStateException("Unable to obtain Identification");
} else {
placeholder = identification.get();
}
}
} | class class_name[name] begin[{]
method[init, return_type[void], modifier[private], parameter[]] begin[{]
if[binary_operation[member[.placeholder], ==, literal[null]]] begin[{]
call[IdentificationManager.getInstance, parameter[]]
local_variable[type[Optional], identification]
if[call[identification.isPresent, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to obtain Identification")], 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[{]
assign[member[.placeholder], call[identification.get, parameter[]]]
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[init] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[placeholder] operator[==] Other[null] operator[SEP] {
identifier[IdentificationManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[registerIdentification] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[Optional] operator[<] identifier[Identification] operator[>] identifier[identification] operator[=] identifier[IdentificationManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getIdentification] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[identification] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[placeholder] operator[=] identifier[identification] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
private void unprotectedUpdateCount(INode[] inodes, int numOfINodes,
long nsDelta, long dsDelta) {
for(int i=0; i < numOfINodes; i++) {
if (inodes[i].isQuotaSet()) { // a directory with quota
INodeDirectoryWithQuota node =(INodeDirectoryWithQuota)inodes[i];
node.updateNumItemsInTree(nsDelta, dsDelta);
}
}
} | class class_name[name] begin[{]
method[unprotectedUpdateCount, return_type[void], modifier[private], parameter[inodes, numOfINodes, nsDelta, dsDelta]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=inodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=isQuotaSet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=inodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=INodeDirectoryWithQuota, sub_type=None)), name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=INodeDirectoryWithQuota, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nsDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dsDelta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updateNumItemsInTree, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numOfINodes, 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[private] Keyword[void] identifier[unprotectedUpdateCount] operator[SEP] identifier[INode] operator[SEP] operator[SEP] identifier[inodes] , Keyword[int] identifier[numOfINodes] , Keyword[long] identifier[nsDelta] , Keyword[long] identifier[dsDelta] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numOfINodes] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[inodes] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[isQuotaSet] operator[SEP] operator[SEP] operator[SEP] {
identifier[INodeDirectoryWithQuota] identifier[node] operator[=] operator[SEP] identifier[INodeDirectoryWithQuota] operator[SEP] identifier[inodes] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[updateNumItemsInTree] operator[SEP] identifier[nsDelta] , identifier[dsDelta] operator[SEP] operator[SEP]
}
}
}
|
public <V> void sput(FieldId<?, V> fieldId, Local<? extends V> source) {
addInstruction(new ThrowingCstInsn(Rops.opPutStatic(source.type.ropType), sourcePosition,
RegisterSpecList.make(source.spec()), catches, fieldId.constant));
} | class class_name[name] begin[{]
method[sput, return_type[void], modifier[public], parameter[fieldId, source]] begin[{]
call[.addInstruction, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=ropType, postfix_operators=[], prefix_operators=[], qualifier=source.type, selectors=[])], member=opPutStatic, postfix_operators=[], prefix_operators=[], qualifier=Rops, selectors=[], type_arguments=None), MemberReference(member=sourcePosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=spec, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None)], member=make, postfix_operators=[], prefix_operators=[], qualifier=RegisterSpecList, selectors=[], type_arguments=None), MemberReference(member=catches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=constant, postfix_operators=[], prefix_operators=[], qualifier=fieldId, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ThrowingCstInsn, sub_type=None))]]
end[}]
END[}] | Keyword[public] operator[<] identifier[V] operator[>] Keyword[void] identifier[sput] operator[SEP] identifier[FieldId] operator[<] operator[?] , identifier[V] operator[>] identifier[fieldId] , identifier[Local] operator[<] operator[?] Keyword[extends] identifier[V] operator[>] identifier[source] operator[SEP] {
identifier[addInstruction] operator[SEP] Keyword[new] identifier[ThrowingCstInsn] operator[SEP] identifier[Rops] operator[SEP] identifier[opPutStatic] operator[SEP] identifier[source] operator[SEP] identifier[type] operator[SEP] identifier[ropType] operator[SEP] , identifier[sourcePosition] , identifier[RegisterSpecList] operator[SEP] identifier[make] operator[SEP] identifier[source] operator[SEP] identifier[spec] operator[SEP] operator[SEP] operator[SEP] , identifier[catches] , identifier[fieldId] operator[SEP] identifier[constant] operator[SEP] operator[SEP] operator[SEP]
}
|
private void parseDoNotAllowDuplicateSetCookies(Map<?, ?> props) {
//PI31734 - prevent multiple Set-Cookies with the same name
String value = (String) props.get(HttpConfigConstants.PROPNAME_DO_NOT_ALLOW_DUPLICATE_SET_COOKIES);
if (null != value) {
this.doNotAllowDuplicateSetCookies = convertBoolean(value);
if ((TraceComponent.isAnyTracingEnabled()) && (tc.isEventEnabled())) {
Tr.event(tc, "Config: DoNotAllowDuplicateSetCookies is " + doNotAllowDuplicateSetCookies());
}
}
} | class class_name[name] begin[{]
method[parseDoNotAllowDuplicateSetCookies, return_type[void], modifier[private], parameter[props]] begin[{]
local_variable[type[String], value]
if[binary_operation[literal[null], !=, member[.value]]] begin[{]
assign[THIS[member[None.doNotAllowDuplicateSetCookies]], call[.convertBoolean, parameter[member[.value]]]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEventEnabled, parameter[]]]] begin[{]
call[Tr.event, parameter[member[.tc], binary_operation[literal["Config: DoNotAllowDuplicateSetCookies is "], +, call[.doNotAllowDuplicateSetCookies, parameter[]]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[parseDoNotAllowDuplicateSetCookies] operator[SEP] identifier[Map] operator[<] operator[?] , operator[?] operator[>] identifier[props] operator[SEP] {
identifier[String] identifier[value] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[props] operator[SEP] identifier[get] operator[SEP] identifier[HttpConfigConstants] operator[SEP] identifier[PROPNAME_DO_NOT_ALLOW_DUPLICATE_SET_COOKIES] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[value] operator[SEP] {
Keyword[this] operator[SEP] identifier[doNotAllowDuplicateSetCookies] operator[=] identifier[convertBoolean] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[doNotAllowDuplicateSetCookies] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public static ItemViewHolder createViewHolder(View view, Class<? extends ItemViewHolder> itemViewHolderClass) {
try {
Constructor<? extends ItemViewHolder> constructor = itemViewHolderClass.getConstructor(View.class);
return constructor.newInstance(view);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
} catch (NoSuchMethodException e) {
throw new RuntimeException("Unable to find a public constructor that takes an argument View in " +
itemViewHolderClass.getSimpleName(), e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e.getTargetException());
} catch (InstantiationException e) {
throw new RuntimeException("Unable to instantiate " + itemViewHolderClass.getSimpleName(), e);
}
} | class class_name[name] begin[{]
method[createViewHolder, return_type[type[ItemViewHolder]], modifier[public static], parameter[view, itemViewHolderClass]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=View, sub_type=None))], member=getConstructor, postfix_operators=[], prefix_operators=[], qualifier=itemViewHolderClass, selectors=[], type_arguments=None), name=constructor)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=ItemViewHolder, sub_type=None))], dimensions=[], name=Constructor, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=constructor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to find a public constructor that takes an argument View in "), operandr=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=itemViewHolderClass, 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=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchMethodException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTargetException, 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=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InvocationTargetException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to instantiate "), operandr=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=itemViewHolderClass, 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=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InstantiationException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ItemViewHolder] identifier[createViewHolder] operator[SEP] identifier[View] identifier[view] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[ItemViewHolder] operator[>] identifier[itemViewHolderClass] operator[SEP] {
Keyword[try] {
identifier[Constructor] operator[<] operator[?] Keyword[extends] identifier[ItemViewHolder] operator[>] identifier[constructor] operator[=] identifier[itemViewHolderClass] operator[SEP] identifier[getConstructor] operator[SEP] identifier[View] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[constructor] operator[SEP] identifier[newInstance] operator[SEP] identifier[view] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[itemViewHolderClass] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InvocationTargetException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] identifier[getTargetException] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InstantiationException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[itemViewHolderClass] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@SuppressLint("CommitTransaction")
private static FragmentTransaction transit(FragmentManager fm, int transit) {
return fm != null ? fm.beginTransaction().setTransition(transit) : null;
} | class class_name[name] begin[{]
method[transit, return_type[type[FragmentTransaction]], modifier[private static], parameter[fm, transit]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=fm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=beginTransaction, postfix_operators=[], prefix_operators=[], qualifier=fm, selectors=[MethodInvocation(arguments=[MemberReference(member=transit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTransition, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None))]
end[}]
END[}] | annotation[@] identifier[SuppressLint] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[static] identifier[FragmentTransaction] identifier[transit] operator[SEP] identifier[FragmentManager] identifier[fm] , Keyword[int] identifier[transit] operator[SEP] {
Keyword[return] identifier[fm] operator[!=] Other[null] operator[?] identifier[fm] operator[SEP] identifier[beginTransaction] operator[SEP] operator[SEP] operator[SEP] identifier[setTransition] operator[SEP] identifier[transit] operator[SEP] operator[:] Other[null] operator[SEP]
}
|
public static void checkNotNull(Object object, String errorMessage){
try {
Preconditions.checkNotNull(object, errorMessage);
} catch (NullPointerException exception) {
throw new ApplicationException(ApplicationException.Code.INVALID_INPUT, errorMessage);
}
} | class class_name[name] begin[{]
method[checkNotNull, return_type[void], modifier[public static], parameter[object, errorMessage]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=errorMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkNotNull, postfix_operators=[], prefix_operators=[], qualifier=Preconditions, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=INVALID_INPUT, postfix_operators=[], prefix_operators=[], qualifier=ApplicationException.Code, selectors=[]), 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=ApplicationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['NullPointerException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[checkNotNull] operator[SEP] identifier[Object] identifier[object] , identifier[String] identifier[errorMessage] operator[SEP] {
Keyword[try] {
identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[object] , identifier[errorMessage] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NullPointerException] identifier[exception] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ApplicationException] operator[SEP] identifier[ApplicationException] operator[SEP] identifier[Code] operator[SEP] identifier[INVALID_INPUT] , identifier[errorMessage] operator[SEP] operator[SEP]
}
}
|
@Override
public FileApiResponse deleteFile(Class<? extends FileEntity> type, Integer entityId, Integer fileId) {
return this.handleDeleteFile(type, entityId, fileId);
} | class class_name[name] begin[{]
method[deleteFile, return_type[type[FileApiResponse]], modifier[public], parameter[type, entityId, fileId]] begin[{]
return[THIS[call[None.handleDeleteFile, parameter[member[.type], member[.entityId], member[.fileId]]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[FileApiResponse] identifier[deleteFile] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[FileEntity] operator[>] identifier[type] , identifier[Integer] identifier[entityId] , identifier[Integer] identifier[fileId] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[handleDeleteFile] operator[SEP] identifier[type] , identifier[entityId] , identifier[fileId] operator[SEP] operator[SEP]
}
|
public void webEvent(final WebEvent webEvent) {
if (LOG.isDebugEnabled()) {
LOG.debug("Sending web event " + webEvent + " for bundle "
+ webEvent.getBundleName());
}
synchronized (listeners) {
callListeners(webEvent);
states.put(webEvent.getBundleId(), webEvent);
}
final String topic;
switch (webEvent.getType()) {
case WebEvent.DEPLOYING:
topic = WebTopic.DEPLOYING.toString();
break;
case WebEvent.DEPLOYED:
topic = WebTopic.DEPLOYED.toString();
break;
case WebEvent.UNDEPLOYING:
topic = WebTopic.UNDEPLOYING.toString();
break;
case WebEvent.UNDEPLOYED:
topic = WebTopic.UNDEPLOYED.toString();
break;
case WebEvent.FAILED:
topic = WebTopic.FAILED.toString();
break;
case WebEvent.WAITING:
// topic = WebTopic.WAITING.toString();
// A Waiting Event is not supported by the specification
// therefore it is mapped to FAILED, because of collision.
topic = WebTopic.FAILED.toString();
break;
default:
topic = WebTopic.FAILED.toString();
}
try {
executors.submit(new Runnable() {
public void run() {
Dictionary<String, Object> properties = new Hashtable<>();
properties.put("bundle.symbolicName", webEvent
.getBundleName());
properties.put("bundle.id", webEvent.getBundleId());
String bundleVersionObject = webEvent.getBundleVersion();
Version bundleVersion;
if (bundleVersionObject != null) {
bundleVersion = new Version(
(String) bundleVersionObject);
} else {
bundleVersion = new Version("0.0.0");
}
properties.put("bundle.version", bundleVersion);
properties.put("context.path",
webEvent.getContextPath());
properties.put("timestamp", webEvent.getTimestamp());
properties.put("extender.bundle.id", webEvent
.getExtenderBundleId());
properties.put("extender.bundle.symbolicName", webEvent
.getExtenderBundleName());
String extenderBundleVersionObject = webEvent
.getExtenderBundleVersion();
Version extenderVersion;
if (extenderBundleVersionObject != null) {
extenderVersion = new Version(
(String) extenderBundleVersionObject);
} else {
extenderVersion = new Version("0.0.0");
}
properties.put("extender.bundle.version",
extenderVersion);
if (webEvent.getCause() != null) {
properties.put("exception", webEvent.getCause());
}
if (webEvent.getCollisionIds() != null) {
properties.put("collision",
webEvent.getContextPath());
properties.put("collision.bundles",
webEvent.getCollisionIds());
}
Event event = new Event(topic, properties);
EventAdmin adminService = getEventAdmin();
if (adminService != null) {
adminService.postEvent(event);
}
}
});
} catch (RejectedExecutionException ree) {
LOG.warn("Executor shut down", ree);
}
try {
executors.submit(new Runnable() {
public void run() {
LogService logService = getLogService();
if (logService != null) {
logService.log(LogService.LOG_DEBUG, topic);
} else {
if (webEvent.getCause() != null) {
LOG.error(webEvent.toString());
} else {
LOG.debug(topic);
}
}
}
});
} catch (RejectedExecutionException ree) {
LOG.warn("Executor shut down", ree);
}
} | class class_name[name] begin[{]
method[webEvent, return_type[void], modifier[public], parameter[webEvent]] begin[{]
if[call[LOG.isDebugEnabled, parameter[]]] begin[{]
call[LOG.debug, parameter[binary_operation[binary_operation[binary_operation[literal["Sending web event "], +, member[.webEvent]], +, literal[" for bundle "]], +, call[webEvent.getBundleName, parameter[]]]]]
else begin[{]
None
end[}]
SYNCHRONIZED[member[.listeners]] BEGIN[{]
call[.callListeners, parameter[member[.webEvent]]]
call[states.put, parameter[call[webEvent.getBundleId, parameter[]], member[.webEvent]]]
END[}]
local_variable[type[String], topic]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=DEPLOYING, postfix_operators=[], prefix_operators=[], qualifier=WebEvent, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=WebTopic.DEPLOYING, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=DEPLOYED, postfix_operators=[], prefix_operators=[], qualifier=WebEvent, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=WebTopic.DEPLOYED, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=UNDEPLOYING, postfix_operators=[], prefix_operators=[], qualifier=WebEvent, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=WebTopic.UNDEPLOYING, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=UNDEPLOYED, postfix_operators=[], prefix_operators=[], qualifier=WebEvent, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=WebTopic.UNDEPLOYED, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=FAILED, postfix_operators=[], prefix_operators=[], qualifier=WebEvent, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=WebTopic.FAILED, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=WAITING, postfix_operators=[], prefix_operators=[], qualifier=WebEvent, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=WebTopic.FAILED, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=WebTopic.FAILED, selectors=[], type_arguments=None)), label=None)])], expression=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], type_arguments=None), label=None)
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=Hashtable, sub_type=None)), name=properties)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Dictionary, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bundle.symbolicName"), MethodInvocation(arguments=[], member=getBundleName, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bundle.id"), MethodInvocation(arguments=[], member=getBundleId, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getBundleVersion, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], type_arguments=None), name=bundleVersionObject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=bundleVersion)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Version, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bundleVersionObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bundleVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0.0.0")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Version, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bundleVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Cast(expression=MemberReference(member=bundleVersionObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Version, sub_type=None))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bundle.version"), MemberReference(member=bundleVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="context.path"), MethodInvocation(arguments=[], member=getContextPath, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="timestamp"), MethodInvocation(arguments=[], member=getTimestamp, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="extender.bundle.id"), MethodInvocation(arguments=[], member=getExtenderBundleId, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="extender.bundle.symbolicName"), MethodInvocation(arguments=[], member=getExtenderBundleName, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getExtenderBundleVersion, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], type_arguments=None), name=extenderBundleVersionObject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=extenderVersion)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Version, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=extenderBundleVersionObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=extenderVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0.0.0")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Version, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=extenderVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Cast(expression=MemberReference(member=extenderBundleVersionObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Version, sub_type=None))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="extender.bundle.version"), MemberReference(member=extenderVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="exception"), MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getCollisionIds, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="collision"), MethodInvocation(arguments=[], member=getContextPath, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="collision.bundles"), MethodInvocation(arguments=[], member=getCollisionIds, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=properties, 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=Event, sub_type=None)), name=event)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Event, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEventAdmin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=adminService)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EventAdmin, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=adminService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=postEvent, postfix_operators=[], prefix_operators=[], qualifier=adminService, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))], member=submit, postfix_operators=[], prefix_operators=[], qualifier=executors, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Executor shut down"), MemberReference(member=ree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ree, types=['RejectedExecutionException']))], finally_block=None, label=None, resources=None)
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLogService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=logService)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LogService, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=logService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=webEvent, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LOG_DEBUG, postfix_operators=[], prefix_operators=[], qualifier=LogService, selectors=[]), MemberReference(member=topic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=logService, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))], member=submit, postfix_operators=[], prefix_operators=[], qualifier=executors, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Executor shut down"), MemberReference(member=ree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ree, types=['RejectedExecutionException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[webEvent] operator[SEP] Keyword[final] identifier[WebEvent] identifier[webEvent] 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] literal[String] operator[+] identifier[webEvent] operator[+] literal[String] operator[+] identifier[webEvent] operator[SEP] identifier[getBundleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[synchronized] operator[SEP] identifier[listeners] operator[SEP] {
identifier[callListeners] operator[SEP] identifier[webEvent] operator[SEP] operator[SEP] identifier[states] operator[SEP] identifier[put] operator[SEP] identifier[webEvent] operator[SEP] identifier[getBundleId] operator[SEP] operator[SEP] , identifier[webEvent] operator[SEP] operator[SEP]
}
Keyword[final] identifier[String] identifier[topic] operator[SEP] Keyword[switch] operator[SEP] identifier[webEvent] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] identifier[WebEvent] operator[SEP] identifier[DEPLOYING] operator[:] identifier[topic] operator[=] identifier[WebTopic] operator[SEP] identifier[DEPLOYING] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[WebEvent] operator[SEP] identifier[DEPLOYED] operator[:] identifier[topic] operator[=] identifier[WebTopic] operator[SEP] identifier[DEPLOYED] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[WebEvent] operator[SEP] identifier[UNDEPLOYING] operator[:] identifier[topic] operator[=] identifier[WebTopic] operator[SEP] identifier[UNDEPLOYING] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[WebEvent] operator[SEP] identifier[UNDEPLOYED] operator[:] identifier[topic] operator[=] identifier[WebTopic] operator[SEP] identifier[UNDEPLOYED] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[WebEvent] operator[SEP] identifier[FAILED] operator[:] identifier[topic] operator[=] identifier[WebTopic] operator[SEP] identifier[FAILED] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[WebEvent] operator[SEP] identifier[WAITING] operator[:] identifier[topic] operator[=] identifier[WebTopic] operator[SEP] identifier[FAILED] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[topic] operator[=] identifier[WebTopic] operator[SEP] identifier[FAILED] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[executors] operator[SEP] identifier[submit] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[Dictionary] operator[<] identifier[String] , identifier[Object] operator[>] identifier[properties] operator[=] Keyword[new] identifier[Hashtable] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[webEvent] operator[SEP] identifier[getBundleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[webEvent] operator[SEP] identifier[getBundleId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[bundleVersionObject] operator[=] identifier[webEvent] operator[SEP] identifier[getBundleVersion] operator[SEP] operator[SEP] operator[SEP] identifier[Version] identifier[bundleVersion] operator[SEP] Keyword[if] operator[SEP] identifier[bundleVersionObject] operator[!=] Other[null] operator[SEP] {
identifier[bundleVersion] operator[=] Keyword[new] identifier[Version] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[bundleVersionObject] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[bundleVersion] operator[=] Keyword[new] identifier[Version] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[properties] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[bundleVersion] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[webEvent] operator[SEP] identifier[getContextPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[webEvent] operator[SEP] identifier[getTimestamp] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[webEvent] operator[SEP] identifier[getExtenderBundleId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[webEvent] operator[SEP] identifier[getExtenderBundleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[extenderBundleVersionObject] operator[=] identifier[webEvent] operator[SEP] identifier[getExtenderBundleVersion] operator[SEP] operator[SEP] operator[SEP] identifier[Version] identifier[extenderVersion] operator[SEP] Keyword[if] operator[SEP] identifier[extenderBundleVersionObject] operator[!=] Other[null] operator[SEP] {
identifier[extenderVersion] operator[=] Keyword[new] identifier[Version] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[extenderBundleVersionObject] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[extenderVersion] operator[=] Keyword[new] identifier[Version] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[properties] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[extenderVersion] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[webEvent] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[properties] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[webEvent] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[webEvent] operator[SEP] identifier[getCollisionIds] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[properties] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[webEvent] operator[SEP] identifier[getContextPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[webEvent] operator[SEP] identifier[getCollisionIds] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Event] identifier[event] operator[=] Keyword[new] identifier[Event] operator[SEP] identifier[topic] , identifier[properties] operator[SEP] operator[SEP] identifier[EventAdmin] identifier[adminService] operator[=] identifier[getEventAdmin] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[adminService] operator[!=] Other[null] operator[SEP] {
identifier[adminService] operator[SEP] identifier[postEvent] operator[SEP] identifier[event] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RejectedExecutionException] identifier[ree] operator[SEP] {
identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[ree] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[executors] operator[SEP] identifier[submit] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[LogService] identifier[logService] operator[=] identifier[getLogService] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logService] operator[!=] Other[null] operator[SEP] {
identifier[logService] operator[SEP] identifier[log] operator[SEP] identifier[LogService] operator[SEP] identifier[LOG_DEBUG] , identifier[topic] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[webEvent] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[webEvent] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[topic] operator[SEP] operator[SEP]
}
}
}
} operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RejectedExecutionException] identifier[ree] operator[SEP] {
identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[ree] operator[SEP] operator[SEP]
}
}
|
void dumpAssociationTables()
{
Enumeration associations = m_patternTable.elements();
while (associations.hasMoreElements())
{
TemplateSubPatternAssociation head =
(TemplateSubPatternAssociation) associations.nextElement();
while (null != head)
{
System.out.print("(" + head.getTargetString() + ", "
+ head.getPattern() + ")");
head = head.getNext();
}
System.out.println("\n.....");
}
TemplateSubPatternAssociation head = m_wildCardPatterns;
System.out.print("wild card list: ");
while (null != head)
{
System.out.print("(" + head.getTargetString() + ", "
+ head.getPattern() + ")");
head = head.getNext();
}
System.out.println("\n.....");
} | class class_name[name] begin[{]
method[dumpAssociationTables, return_type[void], modifier[default], parameter[]] begin[{]
local_variable[type[Enumeration], associations]
while[call[associations.hasMoreElements, parameter[]]] begin[{]
local_variable[type[TemplateSubPatternAssociation], head]
while[binary_operation[literal[null], !=, member[.head]]] begin[{]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["("], +, call[head.getTargetString, parameter[]]], +, literal[", "]], +, call[head.getPattern, parameter[]]], +, literal[")"]]]]
assign[member[.head], call[head.getNext, parameter[]]]
end[}]
call[System.out.println, parameter[literal["\n....."]]]
end[}]
local_variable[type[TemplateSubPatternAssociation], head]
call[System.out.print, parameter[literal["wild card list: "]]]
while[binary_operation[literal[null], !=, member[.head]]] begin[{]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["("], +, call[head.getTargetString, parameter[]]], +, literal[", "]], +, call[head.getPattern, parameter[]]], +, literal[")"]]]]
assign[member[.head], call[head.getNext, parameter[]]]
end[}]
call[System.out.println, parameter[literal["\n....."]]]
end[}]
END[}] | Keyword[void] identifier[dumpAssociationTables] operator[SEP] operator[SEP] {
identifier[Enumeration] identifier[associations] operator[=] identifier[m_patternTable] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[associations] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] {
identifier[TemplateSubPatternAssociation] identifier[head] operator[=] operator[SEP] identifier[TemplateSubPatternAssociation] operator[SEP] identifier[associations] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] Other[null] operator[!=] identifier[head] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[head] operator[SEP] identifier[getTargetString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[head] operator[SEP] identifier[getPattern] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[head] operator[=] identifier[head] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP]
}
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[TemplateSubPatternAssociation] identifier[head] operator[=] identifier[m_wildCardPatterns] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] Other[null] operator[!=] identifier[head] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[head] operator[SEP] identifier[getTargetString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[head] operator[SEP] identifier[getPattern] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[head] operator[=] identifier[head] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP]
}
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
public DiscoverInputSchemaResult withParsedInputRecords(java.util.Collection<java.util.List<String>> parsedInputRecords) {
setParsedInputRecords(parsedInputRecords);
return this;
} | class class_name[name] begin[{]
method[withParsedInputRecords, return_type[type[DiscoverInputSchemaResult]], modifier[public], parameter[parsedInputRecords]] begin[{]
call[.setParsedInputRecords, parameter[member[.parsedInputRecords]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[DiscoverInputSchemaResult] identifier[withParsedInputRecords] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[parsedInputRecords] operator[SEP] {
identifier[setParsedInputRecords] operator[SEP] identifier[parsedInputRecords] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public boolean isOrdered() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "isOrdered");
boolean returnValue = getTarget().isOrdered();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "isOrdered", Boolean.valueOf(returnValue));
return returnValue;
} | class class_name[name] begin[{]
method[isOrdered, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["isOrdered"]]]
else begin[{]
None
end[}]
local_variable[type[boolean], returnValue]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["isOrdered"], call[Boolean.valueOf, parameter[member[.returnValue]]]]]
else begin[{]
None
end[}]
return[member[.returnValue]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isOrdered] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[returnValue] operator[=] identifier[getTarget] operator[SEP] operator[SEP] operator[SEP] identifier[isOrdered] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[returnValue] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[returnValue] operator[SEP]
}
|
private static void fireResponseReceivedEvent(OperationContext opContext, HttpURLConnection request,
RequestResult result) {
if (opContext.getResponseReceivedEventHandler().hasListeners()
|| OperationContext.getGlobalResponseReceivedEventHandler().hasListeners()) {
ResponseReceivedEvent event = new ResponseReceivedEvent(opContext, request, result);
opContext.getResponseReceivedEventHandler().fireEvent(event);
OperationContext.getGlobalResponseReceivedEventHandler().fireEvent(event);
}
} | class class_name[name] begin[{]
method[fireResponseReceivedEvent, return_type[void], modifier[private static], parameter[opContext, request, result]] begin[{]
if[binary_operation[call[opContext.getResponseReceivedEventHandler, parameter[]], ||, call[OperationContext.getGlobalResponseReceivedEventHandler, parameter[]]]] begin[{]
local_variable[type[ResponseReceivedEvent], event]
call[opContext.getResponseReceivedEventHandler, parameter[]]
call[OperationContext.getGlobalResponseReceivedEventHandler, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[fireResponseReceivedEvent] operator[SEP] identifier[OperationContext] identifier[opContext] , identifier[HttpURLConnection] identifier[request] , identifier[RequestResult] identifier[result] operator[SEP] {
Keyword[if] operator[SEP] identifier[opContext] operator[SEP] identifier[getResponseReceivedEventHandler] operator[SEP] operator[SEP] operator[SEP] identifier[hasListeners] operator[SEP] operator[SEP] operator[||] identifier[OperationContext] operator[SEP] identifier[getGlobalResponseReceivedEventHandler] operator[SEP] operator[SEP] operator[SEP] identifier[hasListeners] operator[SEP] operator[SEP] operator[SEP] {
identifier[ResponseReceivedEvent] identifier[event] operator[=] Keyword[new] identifier[ResponseReceivedEvent] operator[SEP] identifier[opContext] , identifier[request] , identifier[result] operator[SEP] operator[SEP] identifier[opContext] operator[SEP] identifier[getResponseReceivedEventHandler] operator[SEP] operator[SEP] operator[SEP] identifier[fireEvent] operator[SEP] identifier[event] operator[SEP] operator[SEP] identifier[OperationContext] operator[SEP] identifier[getGlobalResponseReceivedEventHandler] operator[SEP] operator[SEP] operator[SEP] identifier[fireEvent] operator[SEP] identifier[event] operator[SEP] operator[SEP]
}
}
|
public static void setupGroupsAndUsers(InstallContext ctx,
Map<String, List<String>> groups,
Map<String, List<String>> systemUsers,
Map<String, List<String>> users) throws PackageException {
UserManagementService userManagementService = getService(UserManagementService.class);
try {
JackrabbitSession session = (JackrabbitSession) ctx.getSession();
UserManager userManager = session.getUserManager();
if (groups != null) {
for (Map.Entry<String, List<String>> entry : groups.entrySet()) {
Group group = userManagementService.getOrCreateGroup(session, userManager, entry.getKey());
if (group != null) {
for (String memberName : entry.getValue()) {
userManagementService.assignToGroup(session, userManager, memberName, group);
}
}
}
session.save();
}
if (systemUsers != null) {
for (Map.Entry<String, List<String>> entry : systemUsers.entrySet()) {
Authorizable user = userManagementService.getOrCreateUser(session, userManager, entry.getKey(), true);
if (user != null) {
for (String groupName : entry.getValue()) {
userManagementService.assignToGroup(session, userManager, user, groupName);
}
}
}
session.save();
}
if (users != null) {
for (Map.Entry<String, List<String>> entry : users.entrySet()) {
Authorizable user = userManagementService.getOrCreateUser(session, userManager, entry.getKey(), false);
if (user != null) {
for (String groupName : entry.getValue()) {
userManagementService.assignToGroup(session, userManager, user, groupName);
}
}
}
session.save();
}
} catch (RepositoryException | RuntimeException rex) {
LOG.error(rex.getMessage(), rex);
throw new PackageException(rex);
}
} | class class_name[name] begin[{]
method[setupGroupsAndUsers, return_type[void], modifier[public static], parameter[ctx, groups, systemUsers, users]] begin[{]
local_variable[type[UserManagementService], userManagementService]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getSession, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JackrabbitSession, sub_type=None)), name=session)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JackrabbitSession, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getUserManager, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), name=userManager)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UserManager, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=groups, 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=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=getOrCreateGroup, postfix_operators=[], prefix_operators=[], qualifier=userManagementService, selectors=[], type_arguments=None), name=group)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Group, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=group, 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=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=memberName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=assignToGroup, postfix_operators=[], prefix_operators=[], qualifier=userManagementService, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=memberName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=groups, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=save, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=systemUsers, 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=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getOrCreateUser, postfix_operators=[], prefix_operators=[], qualifier=userManagementService, selectors=[], type_arguments=None), name=user)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Authorizable, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=user, 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=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=groupName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=assignToGroup, postfix_operators=[], prefix_operators=[], qualifier=userManagementService, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=groupName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=systemUsers, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=save, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=users, 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=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getOrCreateUser, postfix_operators=[], prefix_operators=[], qualifier=userManagementService, selectors=[], type_arguments=None), name=user)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Authorizable, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=user, 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=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=groupName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=assignToGroup, postfix_operators=[], prefix_operators=[], qualifier=userManagementService, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=groupName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=users, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=save, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=rex, selectors=[], type_arguments=None), MemberReference(member=rex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=rex, 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=PackageException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=rex, types=['RepositoryException', 'RuntimeException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[setupGroupsAndUsers] operator[SEP] identifier[InstallContext] identifier[ctx] , identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[groups] , identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[systemUsers] , identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[users] operator[SEP] Keyword[throws] identifier[PackageException] {
identifier[UserManagementService] identifier[userManagementService] operator[=] identifier[getService] operator[SEP] identifier[UserManagementService] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[try] {
identifier[JackrabbitSession] identifier[session] operator[=] operator[SEP] identifier[JackrabbitSession] operator[SEP] identifier[ctx] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] identifier[UserManager] identifier[userManager] operator[=] identifier[session] operator[SEP] identifier[getUserManager] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[groups] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[entry] operator[:] identifier[groups] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[Group] identifier[group] operator[=] identifier[userManagementService] operator[SEP] identifier[getOrCreateGroup] operator[SEP] identifier[session] , identifier[userManager] , identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[group] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[memberName] operator[:] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] {
identifier[userManagementService] operator[SEP] identifier[assignToGroup] operator[SEP] identifier[session] , identifier[userManager] , identifier[memberName] , identifier[group] operator[SEP] operator[SEP]
}
}
}
identifier[session] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[systemUsers] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[entry] operator[:] identifier[systemUsers] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[Authorizable] identifier[user] operator[=] identifier[userManagementService] operator[SEP] identifier[getOrCreateUser] operator[SEP] identifier[session] , identifier[userManager] , identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[user] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[groupName] operator[:] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] {
identifier[userManagementService] operator[SEP] identifier[assignToGroup] operator[SEP] identifier[session] , identifier[userManager] , identifier[user] , identifier[groupName] operator[SEP] operator[SEP]
}
}
}
identifier[session] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[users] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[entry] operator[:] identifier[users] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[Authorizable] identifier[user] operator[=] identifier[userManagementService] operator[SEP] identifier[getOrCreateUser] operator[SEP] identifier[session] , identifier[userManager] , identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[user] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[groupName] operator[:] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] {
identifier[userManagementService] operator[SEP] identifier[assignToGroup] operator[SEP] identifier[session] , identifier[userManager] , identifier[user] , identifier[groupName] operator[SEP] operator[SEP]
}
}
}
identifier[session] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[RepositoryException] operator[|] identifier[RuntimeException] identifier[rex] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[rex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[rex] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[PackageException] operator[SEP] identifier[rex] operator[SEP] operator[SEP]
}
}
|
public void i(String format, Object... args) {
println(LogLevel.INFO, format, args);
} | class class_name[name] begin[{]
method[i, return_type[void], modifier[public], parameter[format, args]] begin[{]
call[.println, parameter[member[LogLevel.INFO], member[.format], member[.args]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[i] operator[SEP] identifier[String] identifier[format] , identifier[Object] operator[...] identifier[args] operator[SEP] {
identifier[println] operator[SEP] identifier[LogLevel] operator[SEP] identifier[INFO] , identifier[format] , identifier[args] operator[SEP] operator[SEP]
}
|
public static void v(String format, Object... args) {
assertInitialization();
sLogger.v(format, args);
} | class class_name[name] begin[{]
method[v, return_type[void], modifier[public static], parameter[format, args]] begin[{]
call[.assertInitialization, parameter[]]
call[sLogger.v, parameter[member[.format], member[.args]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[v] operator[SEP] identifier[String] identifier[format] , identifier[Object] operator[...] identifier[args] operator[SEP] {
identifier[assertInitialization] operator[SEP] operator[SEP] operator[SEP] identifier[sLogger] operator[SEP] identifier[v] operator[SEP] identifier[format] , identifier[args] operator[SEP] operator[SEP]
}
|
public ElementUI getNextSibling(boolean visibleOnly) {
ElementUI parent = getParent();
if (parent != null) {
int count = parent.getChildCount();
for (int i = getIndex() + 1; i < count; i++) {
ElementUI child = (ElementUI) parent.getChild(i);
if (!visibleOnly || child.isVisible()) {
return child;
}
}
}
return null;
} | class class_name[name] begin[{]
method[getNextSibling, return_type[type[ElementUI]], modifier[public], parameter[visibleOnly]] begin[{]
local_variable[type[ElementUI], parent]
if[binary_operation[member[.parent], !=, literal[null]]] begin[{]
local_variable[type[int], count]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getChild, postfix_operators=[], prefix_operators=[], qualifier=parent, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ElementUI, sub_type=None)), name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ElementUI, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=visibleOnly, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isVisible, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=child, 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=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), 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)
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[ElementUI] identifier[getNextSibling] operator[SEP] Keyword[boolean] identifier[visibleOnly] operator[SEP] {
identifier[ElementUI] identifier[parent] operator[=] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[!=] Other[null] operator[SEP] {
Keyword[int] identifier[count] operator[=] identifier[parent] operator[SEP] identifier[getChildCount] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[getIndex] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] identifier[i] operator[<] identifier[count] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[ElementUI] identifier[child] operator[=] operator[SEP] identifier[ElementUI] operator[SEP] identifier[parent] operator[SEP] identifier[getChild] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[visibleOnly] operator[||] identifier[child] operator[SEP] identifier[isVisible] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[child] operator[SEP]
}
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public CmsGroup readGroup(CmsRequestContext context, CmsProject project) {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
CmsGroup result = null;
try {
result = m_driverManager.readGroup(dbc, project);
} finally {
dbc.clear();
}
return result;
} | class class_name[name] begin[{]
method[readGroup, return_type[type[CmsGroup]], modifier[public], parameter[context, project]] begin[{]
local_variable[type[CmsDbContext], dbc]
local_variable[type[CmsGroup], result]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=project, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readGroup, postfix_operators=[], prefix_operators=[], qualifier=m_driverManager, selectors=[], type_arguments=None)), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=dbc, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[CmsGroup] identifier[readGroup] operator[SEP] identifier[CmsRequestContext] identifier[context] , identifier[CmsProject] identifier[project] operator[SEP] {
identifier[CmsDbContext] identifier[dbc] operator[=] identifier[m_dbContextFactory] operator[SEP] identifier[getDbContext] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[CmsGroup] identifier[result] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[result] operator[=] identifier[m_driverManager] operator[SEP] identifier[readGroup] operator[SEP] identifier[dbc] , identifier[project] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[dbc] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public final void ruleXAnnotationElementValue() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalXbaseWithAnnotations.g:146:2: ( ( ( rule__XAnnotationElementValue__Alternatives ) ) )
// InternalXbaseWithAnnotations.g:147:2: ( ( rule__XAnnotationElementValue__Alternatives ) )
{
// InternalXbaseWithAnnotations.g:147:2: ( ( rule__XAnnotationElementValue__Alternatives ) )
// InternalXbaseWithAnnotations.g:148:3: ( rule__XAnnotationElementValue__Alternatives )
{
if ( state.backtracking==0 ) {
before(grammarAccess.getXAnnotationElementValueAccess().getAlternatives());
}
// InternalXbaseWithAnnotations.g:149:3: ( rule__XAnnotationElementValue__Alternatives )
// InternalXbaseWithAnnotations.g:149:4: rule__XAnnotationElementValue__Alternatives
{
pushFollow(FOLLOW_2);
rule__XAnnotationElementValue__Alternatives();
state._fsp--;
if (state.failed) return ;
}
if ( state.backtracking==0 ) {
after(grammarAccess.getXAnnotationElementValueAccess().getAlternatives());
}
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
restoreStackSize(stackSize);
}
return ;
} | class class_name[name] begin[{]
method[ruleXAnnotationElementValue, return_type[void], modifier[final public], parameter[]] begin[{]
local_variable[type[int], stackSize]
TryStatement(block=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXAnnotationElementValueAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getAlternatives, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=before, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=rule__XAnnotationElementValue__Alternatives, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None))]), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXAnnotationElementValueAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getAlternatives, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=after, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))])])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stackSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=restoreStackSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
return[None]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[ruleXAnnotationElementValue] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
Keyword[int] identifier[stackSize] operator[=] identifier[keepStackSize] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
{
{
Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[before] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXAnnotationElementValueAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getAlternatives] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
} {
identifier[pushFollow] operator[SEP] identifier[FOLLOW_2] operator[SEP] operator[SEP] identifier[rule__XAnnotationElementValue__Alternatives] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[after] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXAnnotationElementValueAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getAlternatives] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] {
identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[restoreStackSize] operator[SEP] identifier[stackSize] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP]
}
|
@Execute
public HtmlResponse details(final String dictId, final int crudMode, final long id) {
verifyCrudMode(crudMode, CrudMode.DETAILS, dictId);
saveToken();
return asDetailsHtml().useForm(
EditForm.class,
op -> {
op.setup(form -> {
stemmerOverrideService
.getStemmerOverrideItem(dictId, id)
.ifPresent(entity -> {
form.input = entity.getInput();
form.output = entity.getOutput();
})
.orElse(() -> {
throwValidationError(
messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, dictId + ":" + id),
() -> asListHtml(dictId));
});
form.id = id;
form.crudMode = crudMode;
form.dictId = dictId;
});
});
} | class class_name[name] begin[{]
method[details, return_type[type[HtmlResponse]], modifier[public], parameter[dictId, crudMode, id]] begin[{]
call[.verifyCrudMode, parameter[member[.crudMode], member[CrudMode.DETAILS], member[.dictId]]]
call[.saveToken, parameter[]]
return[call[.asDetailsHtml, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Execute] Keyword[public] identifier[HtmlResponse] identifier[details] operator[SEP] Keyword[final] identifier[String] identifier[dictId] , Keyword[final] Keyword[int] identifier[crudMode] , Keyword[final] Keyword[long] identifier[id] operator[SEP] {
identifier[verifyCrudMode] operator[SEP] identifier[crudMode] , identifier[CrudMode] operator[SEP] identifier[DETAILS] , identifier[dictId] operator[SEP] operator[SEP] identifier[saveToken] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[asDetailsHtml] operator[SEP] operator[SEP] operator[SEP] identifier[useForm] operator[SEP] identifier[EditForm] operator[SEP] Keyword[class] , identifier[op] operator[->] {
identifier[op] operator[SEP] identifier[setup] operator[SEP] identifier[form] operator[->] {
identifier[stemmerOverrideService] operator[SEP] identifier[getStemmerOverrideItem] operator[SEP] identifier[dictId] , identifier[id] operator[SEP] operator[SEP] identifier[ifPresent] operator[SEP] identifier[entity] operator[->] {
identifier[form] operator[SEP] identifier[input] operator[=] identifier[entity] operator[SEP] identifier[getInput] operator[SEP] operator[SEP] operator[SEP] identifier[form] operator[SEP] identifier[output] operator[=] identifier[entity] operator[SEP] identifier[getOutput] operator[SEP] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] identifier[orElse] operator[SEP] operator[SEP] operator[SEP] operator[->] {
identifier[throwValidationError] operator[SEP] identifier[messages] operator[->] identifier[messages] operator[SEP] identifier[addErrorsCrudCouldNotFindCrudTable] operator[SEP] identifier[GLOBAL] , identifier[dictId] operator[+] literal[String] operator[+] identifier[id] operator[SEP] , operator[SEP] operator[SEP] operator[->] identifier[asListHtml] operator[SEP] identifier[dictId] operator[SEP] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] identifier[form] operator[SEP] identifier[id] operator[=] identifier[id] operator[SEP] identifier[form] operator[SEP] identifier[crudMode] operator[=] identifier[crudMode] operator[SEP] identifier[form] operator[SEP] identifier[dictId] operator[=] identifier[dictId] operator[SEP]
} operator[SEP] operator[SEP]
} operator[SEP] operator[SEP]
}
|
static String[] toNoNullStringArray(final Collection<String> collection) {
if (collection == null) {
return ArrayUtils.EMPTY_STRING_ARRAY;
}
return toNoNullStringArray(collection.toArray());
} | class class_name[name] begin[{]
method[toNoNullStringArray, return_type[type[String]], modifier[static], parameter[collection]] begin[{]
if[binary_operation[member[.collection], ==, literal[null]]] begin[{]
return[member[ArrayUtils.EMPTY_STRING_ARRAY]]
else begin[{]
None
end[}]
return[call[.toNoNullStringArray, parameter[call[collection.toArray, parameter[]]]]]
end[}]
END[}] | Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[toNoNullStringArray] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[String] operator[>] identifier[collection] operator[SEP] {
Keyword[if] operator[SEP] identifier[collection] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[ArrayUtils] operator[SEP] identifier[EMPTY_STRING_ARRAY] operator[SEP]
}
Keyword[return] identifier[toNoNullStringArray] operator[SEP] identifier[collection] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
protected <O> Map<O, IntList> partition(List<? extends O> classcolumn) {
Map<O, IntList> classes = new HashMap<>();
Iterator<? extends O> iter = classcolumn.iterator();
for(int i = 0; iter.hasNext(); i++) {
O lbl = iter.next();
IntList ids = classes.get(lbl);
if(ids == null) {
ids = new IntArrayList();
classes.put(lbl, ids);
}
ids.add(i);
}
return classes;
} | class class_name[name] begin[{]
method[partition, return_type[type[Map]], modifier[protected], parameter[classcolumn]] begin[{]
local_variable[type[Map], classes]
local_variable[type[Iterator], iter]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), name=lbl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=O, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=lbl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=classes, selectors=[], type_arguments=None), name=ids)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntList, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntArrayList, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=lbl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=classes, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=ids, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.classes]]
end[}]
END[}] | Keyword[protected] operator[<] identifier[O] operator[>] identifier[Map] operator[<] identifier[O] , identifier[IntList] operator[>] identifier[partition] operator[SEP] identifier[List] operator[<] operator[?] Keyword[extends] identifier[O] operator[>] identifier[classcolumn] operator[SEP] {
identifier[Map] operator[<] identifier[O] , identifier[IntList] operator[>] identifier[classes] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] operator[?] Keyword[extends] identifier[O] operator[>] identifier[iter] operator[=] identifier[classcolumn] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[O] identifier[lbl] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[IntList] identifier[ids] operator[=] identifier[classes] operator[SEP] identifier[get] operator[SEP] identifier[lbl] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ids] operator[==] Other[null] operator[SEP] {
identifier[ids] operator[=] Keyword[new] identifier[IntArrayList] operator[SEP] operator[SEP] operator[SEP] identifier[classes] operator[SEP] identifier[put] operator[SEP] identifier[lbl] , identifier[ids] operator[SEP] operator[SEP]
}
identifier[ids] operator[SEP] identifier[add] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
Keyword[return] identifier[classes] operator[SEP]
}
|
public void addInterface(String interfaceName) {
if (!mInterfaceSet.contains(interfaceName)) {
mInterfaces.add(mCp.addConstantClass(interfaceName));
mInterfaceSet.add(interfaceName);
}
} | class class_name[name] begin[{]
method[addInterface, return_type[void], modifier[public], parameter[interfaceName]] begin[{]
if[call[mInterfaceSet.contains, parameter[member[.interfaceName]]]] begin[{]
call[mInterfaces.add, parameter[call[mCp.addConstantClass, parameter[member[.interfaceName]]]]]
call[mInterfaceSet.add, parameter[member[.interfaceName]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addInterface] operator[SEP] identifier[String] identifier[interfaceName] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[mInterfaceSet] operator[SEP] identifier[contains] operator[SEP] identifier[interfaceName] operator[SEP] operator[SEP] {
identifier[mInterfaces] operator[SEP] identifier[add] operator[SEP] identifier[mCp] operator[SEP] identifier[addConstantClass] operator[SEP] identifier[interfaceName] operator[SEP] operator[SEP] operator[SEP] identifier[mInterfaceSet] operator[SEP] identifier[add] operator[SEP] identifier[interfaceName] operator[SEP] operator[SEP]
}
}
|
@Override
public InputStream getInputStream() throws IOException {
InputStream inputStream = fileItem.getInputStream();
return (inputStream != null ? inputStream : new ByteArrayInputStream(new byte[0]));
} | class class_name[name] begin[{]
method[getInputStream, return_type[type[InputStream]], modifier[public], parameter[]] begin[{]
local_variable[type[InputStream], inputStream]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=ClassCreator(arguments=[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None)), if_true=MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[InputStream] identifier[getInputStream] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[InputStream] identifier[inputStream] operator[=] identifier[fileItem] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[inputStream] operator[!=] Other[null] operator[?] identifier[inputStream] operator[:] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] Keyword[new] Keyword[byte] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static byte[] longToBytes(long rmid)
{
return new byte[] { (byte)(rmid>>56), (byte)(rmid>>48), (byte)(rmid>>40), (byte)(rmid>>32),
(byte)(rmid>>24), (byte)(rmid>>16), (byte)(rmid>>8), (byte)(rmid)};
} | class class_name[name] begin[{]
method[longToBytes, return_type[type[byte]], modifier[public static], parameter[rmid]] begin[{]
return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Cast(expression=BinaryOperation(operandl=MemberReference(member=rmid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=56), operator=>>), type=BasicType(dimensions=[], name=byte)), Cast(expression=BinaryOperation(operandl=MemberReference(member=rmid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=48), operator=>>), type=BasicType(dimensions=[], name=byte)), Cast(expression=BinaryOperation(operandl=MemberReference(member=rmid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=40), operator=>>), type=BasicType(dimensions=[], name=byte)), Cast(expression=BinaryOperation(operandl=MemberReference(member=rmid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32), operator=>>), type=BasicType(dimensions=[], name=byte)), Cast(expression=BinaryOperation(operandl=MemberReference(member=rmid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=>>), type=BasicType(dimensions=[], name=byte)), Cast(expression=BinaryOperation(operandl=MemberReference(member=rmid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=>>), type=BasicType(dimensions=[], name=byte)), Cast(expression=BinaryOperation(operandl=MemberReference(member=rmid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), type=BasicType(dimensions=[], name=byte)), Cast(expression=MemberReference(member=rmid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[longToBytes] operator[SEP] Keyword[long] identifier[rmid] operator[SEP] {
Keyword[return] Keyword[new] Keyword[byte] operator[SEP] operator[SEP] {
operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[rmid] operator[>] operator[>] Other[56] operator[SEP] , operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[rmid] operator[>] operator[>] Other[48] operator[SEP] , operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[rmid] operator[>] operator[>] Other[40] operator[SEP] , operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[rmid] operator[>] operator[>] Other[32] operator[SEP] , operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[rmid] operator[>] operator[>] Other[24] operator[SEP] , operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[rmid] operator[>] operator[>] Other[16] operator[SEP] , operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[rmid] operator[>] operator[>] Other[8] operator[SEP] , operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[rmid] operator[SEP]
} operator[SEP]
}
|
public void flush() throws IOException {
final ByteBuffer data = ByteBuffer.allocate(
getCapacity() * FatDirectoryEntry.SIZE + (volumeLabel != null ? FatDirectoryEntry.SIZE : 0));
for (FatDirectoryEntry entry : this.entries) {
if (entry != null) {
entry.write(data);
}
}
/* TODO: the label could be placed directly the dot entries */
if (this.volumeLabel != null) {
final FatDirectoryEntry labelEntry =
FatDirectoryEntry.createVolumeLabel(type, volumeLabel);
labelEntry.write(data);
}
if (data.hasRemaining()) {
FatDirectoryEntry.writeNullEntry(data);
}
data.flip();
write(data);
resetDirty();
} | class class_name[name] begin[{]
method[flush, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[ByteBuffer], data]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=entries, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FatDirectoryEntry, sub_type=None))), label=None)
if[binary_operation[THIS[member[None.volumeLabel]], !=, literal[null]]] begin[{]
local_variable[type[FatDirectoryEntry], labelEntry]
call[labelEntry.write, parameter[member[.data]]]
else begin[{]
None
end[}]
if[call[data.hasRemaining, parameter[]]] begin[{]
call[FatDirectoryEntry.writeNullEntry, parameter[member[.data]]]
else begin[{]
None
end[}]
call[data.flip, parameter[]]
call[.write, parameter[member[.data]]]
call[.resetDirty, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[flush] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[final] identifier[ByteBuffer] identifier[data] operator[=] identifier[ByteBuffer] operator[SEP] identifier[allocate] operator[SEP] identifier[getCapacity] operator[SEP] operator[SEP] operator[*] identifier[FatDirectoryEntry] operator[SEP] identifier[SIZE] operator[+] operator[SEP] identifier[volumeLabel] operator[!=] Other[null] operator[?] identifier[FatDirectoryEntry] operator[SEP] identifier[SIZE] operator[:] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[FatDirectoryEntry] identifier[entry] operator[:] Keyword[this] operator[SEP] identifier[entries] operator[SEP] {
Keyword[if] operator[SEP] identifier[entry] operator[!=] Other[null] operator[SEP] {
identifier[entry] operator[SEP] identifier[write] operator[SEP] identifier[data] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[volumeLabel] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[FatDirectoryEntry] identifier[labelEntry] operator[=] identifier[FatDirectoryEntry] operator[SEP] identifier[createVolumeLabel] operator[SEP] identifier[type] , identifier[volumeLabel] operator[SEP] operator[SEP] identifier[labelEntry] operator[SEP] identifier[write] operator[SEP] identifier[data] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[data] operator[SEP] identifier[hasRemaining] operator[SEP] operator[SEP] operator[SEP] {
identifier[FatDirectoryEntry] operator[SEP] identifier[writeNullEntry] operator[SEP] identifier[data] operator[SEP] operator[SEP]
}
identifier[data] operator[SEP] identifier[flip] operator[SEP] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[data] operator[SEP] operator[SEP] identifier[resetDirty] operator[SEP] operator[SEP] operator[SEP]
}
|
public double[] getScaleDenominators() {
double[] dest = new double[this.scaleDenominators.length];
System.arraycopy(this.scaleDenominators, 0, dest, 0, this.scaleDenominators.length);
return dest;
} | class class_name[name] begin[{]
method[getScaleDenominators, return_type[type[double]], modifier[public], parameter[]] begin[{]
local_variable[type[double], dest]
call[System.arraycopy, parameter[THIS[member[None.scaleDenominators]], literal[0], member[.dest], literal[0], THIS[member[None.scaleDenominators]member[None.length]]]]
return[member[.dest]]
end[}]
END[}] | Keyword[public] Keyword[double] operator[SEP] operator[SEP] identifier[getScaleDenominators] operator[SEP] operator[SEP] {
Keyword[double] operator[SEP] operator[SEP] identifier[dest] operator[=] Keyword[new] Keyword[double] operator[SEP] Keyword[this] operator[SEP] identifier[scaleDenominators] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] Keyword[this] operator[SEP] identifier[scaleDenominators] , Other[0] , identifier[dest] , Other[0] , Keyword[this] operator[SEP] identifier[scaleDenominators] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[dest] operator[SEP]
}
|
public final static String byteArrayAsHex(final byte[] buf, final int limit) {
final StringBuilder sb = new StringBuilder();
for (int i = 0; i < limit; ++i) {
if ((i % 16) == 0) { // print offset
sb.append(nativeAsHex(i, 32)).append(" ");
} else if (((i) % 8) == 0) { // split on qword
sb.append(" ");
}
sb.append(nativeAsHex((buf[i] & 0xFF), 8)).append(" "); // hex byte
if (((i % 16) == 15) || (i == (buf.length - 1))) {
for (int j = (16 - (i % 16)); j > 1; j--) { // padding non exist bytes
sb.append(" ");
}
sb.append(" |"); // byte columns
final int start = ((i / 16) * 16);
final int end = ((buf.length < i + 1) ? buf.length : (i + 1));
for (int j = start; j < end; ++j) {
if ((buf[j] >= 32) && (buf[j] <= 126)) {
sb.append((char) buf[j]);
} else {
sb.append("."); // non-printable character
}
}
sb.append("|\n"); // end column
}
}
return sb.toString();
} | class class_name[name] begin[{]
method[byteArrayAsHex, return_type[type[String]], modifier[final public static], parameter[buf, limit]] begin[{]
local_variable[type[StringBuilder], sb]
ForStatement(body=BlockStatement(label=None, statements=[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=16), operator=%), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=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=8), operator=%), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32)], member=nativeAsHex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8)], member=nativeAsHex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=%), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=15), operator===), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=%), operator=-), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" |")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=*), name=start)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator=<), if_false=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), if_true=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[])), name=end)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=buf, 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=32), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=buf, 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=126), operator=<=), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=BasicType(dimensions=[], name=char))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="|\n")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=limit, 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[sb.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[static] identifier[String] identifier[byteArrayAsHex] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] , Keyword[final] Keyword[int] identifier[limit] operator[SEP] {
Keyword[final] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[limit] operator[SEP] operator[++] identifier[i] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[i] operator[%] Other[16] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[nativeAsHex] operator[SEP] identifier[i] , Other[32] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[%] Other[8] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[nativeAsHex] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[i] operator[SEP] operator[&] literal[Integer] operator[SEP] , Other[8] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[%] Other[16] operator[SEP] operator[==] Other[15] operator[SEP] operator[||] operator[SEP] identifier[i] operator[==] operator[SEP] identifier[buf] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] operator[SEP] Other[16] operator[-] operator[SEP] identifier[i] operator[%] Other[16] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[>] Other[1] operator[SEP] identifier[j] operator[--] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[start] operator[=] operator[SEP] operator[SEP] identifier[i] operator[/] Other[16] operator[SEP] operator[*] Other[16] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[end] operator[=] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[length] operator[<] identifier[i] operator[+] Other[1] operator[SEP] operator[?] identifier[buf] operator[SEP] identifier[length] operator[:] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[start] operator[SEP] identifier[j] operator[<] identifier[end] operator[SEP] operator[++] identifier[j] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[j] operator[SEP] operator[>=] Other[32] operator[SEP] operator[&&] operator[SEP] identifier[buf] operator[SEP] identifier[j] operator[SEP] operator[<=] Other[126] operator[SEP] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[buf] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public int read4BE() throws OtpErlangDecodeException {
final byte[] b = new byte[4];
try {
super.read(b);
} catch (final IOException e) {
throw new OtpErlangDecodeException("Cannot read from input stream");
}
return (b[0] << 24 & 0xff000000) + (b[1] << 16 & 0xff0000)
+ (b[2] << 8 & 0xff00) + (b[3] & 0xff);
} | class class_name[name] begin[{]
method[read4BE, return_type[type[int]], modifier[public], parameter[]] begin[{]
local_variable[type[byte], b]
TryStatement(block=[StatementExpression(expression=SuperMethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot read from input stream")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OtpErlangDecodeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.b], <<, literal[24]], &, literal[0xff000000]], +, binary_operation[binary_operation[member[.b], <<, literal[16]], &, literal[0xff0000]]], +, binary_operation[binary_operation[member[.b], <<, literal[8]], &, literal[0xff00]]], +, binary_operation[member[.b], &, literal[0xff]]]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[read4BE] operator[SEP] operator[SEP] Keyword[throws] identifier[OtpErlangDecodeException] {
Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[b] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[4] operator[SEP] operator[SEP] Keyword[try] {
Keyword[super] operator[SEP] identifier[read] operator[SEP] identifier[b] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[OtpErlangDecodeException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] identifier[b] operator[SEP] Other[0] operator[SEP] operator[<<] Other[24] operator[&] literal[Integer] operator[SEP] operator[+] operator[SEP] identifier[b] operator[SEP] Other[1] operator[SEP] operator[<<] Other[16] operator[&] literal[Integer] operator[SEP] operator[+] operator[SEP] identifier[b] operator[SEP] Other[2] operator[SEP] operator[<<] Other[8] operator[&] literal[Integer] operator[SEP] operator[+] operator[SEP] identifier[b] operator[SEP] Other[3] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP]
}
|
public static MemberFetcher fetcher(final String pathServiceSid,
final String pathChannelSid,
final String pathSid) {
return new MemberFetcher(pathServiceSid, pathChannelSid, pathSid);
} | class class_name[name] begin[{]
method[fetcher, return_type[type[MemberFetcher]], modifier[public static], parameter[pathServiceSid, pathChannelSid, pathSid]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=pathServiceSid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pathChannelSid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pathSid, 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=MemberFetcher, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[MemberFetcher] identifier[fetcher] operator[SEP] Keyword[final] identifier[String] identifier[pathServiceSid] , Keyword[final] identifier[String] identifier[pathChannelSid] , Keyword[final] identifier[String] identifier[pathSid] operator[SEP] {
Keyword[return] Keyword[new] identifier[MemberFetcher] operator[SEP] identifier[pathServiceSid] , identifier[pathChannelSid] , identifier[pathSid] operator[SEP] operator[SEP]
}
|
static boolean jaxTemplate(String href) {
Matcher m = JAX_RS_TEMPLATE.matcher(href);
return m.matches();
} | class class_name[name] begin[{]
method[jaxTemplate, return_type[type[boolean]], modifier[static], parameter[href]] begin[{]
local_variable[type[Matcher], m]
return[call[m.matches, parameter[]]]
end[}]
END[}] | Keyword[static] Keyword[boolean] identifier[jaxTemplate] operator[SEP] identifier[String] identifier[href] operator[SEP] {
identifier[Matcher] identifier[m] operator[=] identifier[JAX_RS_TEMPLATE] operator[SEP] identifier[matcher] operator[SEP] identifier[href] operator[SEP] operator[SEP] Keyword[return] identifier[m] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP]
}
|
public String getName() {
if (null == this.name && null != this.byteArray) {
try {
this.name = new String(this.byteArray, HeaderStorage.ENGLISH_CHARSET);
} catch (UnsupportedEncodingException uee) {
// no FFDC required
// Invalid key name
throw new IllegalArgumentException("Unsupported non-English name: " + new String(this.byteArray));
}
}
return this.name;
} | class class_name[name] begin[{]
method[getName, return_type[type[String]], modifier[public], parameter[]] begin[{]
if[binary_operation[binary_operation[literal[null], ==, THIS[member[None.name]]], &&, binary_operation[literal[null], !=, THIS[member[None.byteArray]]]]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=byteArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=ENGLISH_CHARSET, postfix_operators=[], prefix_operators=[], qualifier=HeaderStorage, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported non-English name: "), operandr=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=byteArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=uee, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[THIS[member[None.name]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getName] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] Other[null] operator[==] Keyword[this] operator[SEP] identifier[name] operator[&&] Other[null] operator[!=] Keyword[this] operator[SEP] identifier[byteArray] operator[SEP] {
Keyword[try] {
Keyword[this] operator[SEP] identifier[name] operator[=] Keyword[new] identifier[String] operator[SEP] Keyword[this] operator[SEP] identifier[byteArray] , identifier[HeaderStorage] operator[SEP] identifier[ENGLISH_CHARSET] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[uee] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] Keyword[new] identifier[String] operator[SEP] Keyword[this] operator[SEP] identifier[byteArray] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] Keyword[this] operator[SEP] identifier[name] operator[SEP]
}
|
private Status runSparkJob(JavaSparkContext sc, PrintWriter reportWriter) {
// Generate a list of integer for testing
List<Integer> nums = IntStream.rangeClosed(1, mPartitions).boxed().collect(Collectors.toList());
JavaRDD<Integer> dataSet = sc.parallelize(nums, mPartitions);
// Run a Spark job to check whether Spark executors can recognize Alluxio
JavaPairRDD<Status, String> extractedStatus = dataSet
.mapToPair(s -> new Tuple2<>(CheckerUtils.performIntegrationChecks(),
CheckerUtils.getLocalAddress()));
// Merge the IP addresses that can/cannot recognize Alluxio
JavaPairRDD<Status, String> mergeStatus = extractedStatus.reduceByKey((a, b)
-> a.contains(b) ? a : (b.contains(a) ? b : a + " " + b),
(mPartitions < 10 ? 1 : mPartitions / 10));
mSparkJobResult = mergeStatus.collect();
Map<Status, List<String>> resultMap = new HashMap<>();
for (Tuple2<Status, String> op : mSparkJobResult) {
List<String> addresses = resultMap.getOrDefault(op._1, new ArrayList<>());
addresses.add(op._2);
resultMap.put(op._1, addresses);
}
return CheckerUtils.printNodesResults(resultMap, reportWriter);
} | class class_name[name] begin[{]
method[runSparkJob, return_type[type[Status]], modifier[private], parameter[sc, reportWriter]] begin[{]
local_variable[type[List], nums]
local_variable[type[JavaRDD], dataSet]
local_variable[type[JavaPairRDD], extractedStatus]
local_variable[type[JavaPairRDD], mergeStatus]
assign[member[.mSparkJobResult], call[mergeStatus.collect, parameter[]]]
local_variable[type[Map], resultMap]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=_1, postfix_operators=[], prefix_operators=[], qualifier=op, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))], member=getOrDefault, postfix_operators=[], prefix_operators=[], qualifier=resultMap, selectors=[], type_arguments=None), name=addresses)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=_2, postfix_operators=[], prefix_operators=[], qualifier=op, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=addresses, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=_1, postfix_operators=[], prefix_operators=[], qualifier=op, selectors=[]), MemberReference(member=addresses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=resultMap, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=mSparkJobResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=op)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Status, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Tuple2, sub_type=None))), label=None)
return[call[CheckerUtils.printNodesResults, parameter[member[.resultMap], member[.reportWriter]]]]
end[}]
END[}] | Keyword[private] identifier[Status] identifier[runSparkJob] operator[SEP] identifier[JavaSparkContext] identifier[sc] , identifier[PrintWriter] identifier[reportWriter] operator[SEP] {
identifier[List] operator[<] identifier[Integer] operator[>] identifier[nums] operator[=] identifier[IntStream] operator[SEP] identifier[rangeClosed] operator[SEP] Other[1] , identifier[mPartitions] operator[SEP] operator[SEP] identifier[boxed] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[JavaRDD] operator[<] identifier[Integer] operator[>] identifier[dataSet] operator[=] identifier[sc] operator[SEP] identifier[parallelize] operator[SEP] identifier[nums] , identifier[mPartitions] operator[SEP] operator[SEP] identifier[JavaPairRDD] operator[<] identifier[Status] , identifier[String] operator[>] identifier[extractedStatus] operator[=] identifier[dataSet] operator[SEP] identifier[mapToPair] operator[SEP] identifier[s] operator[->] Keyword[new] identifier[Tuple2] operator[<] operator[>] operator[SEP] identifier[CheckerUtils] operator[SEP] identifier[performIntegrationChecks] operator[SEP] operator[SEP] , identifier[CheckerUtils] operator[SEP] identifier[getLocalAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[JavaPairRDD] operator[<] identifier[Status] , identifier[String] operator[>] identifier[mergeStatus] operator[=] identifier[extractedStatus] operator[SEP] identifier[reduceByKey] operator[SEP] operator[SEP] identifier[a] , identifier[b] operator[SEP] operator[->] identifier[a] operator[SEP] identifier[contains] operator[SEP] identifier[b] operator[SEP] operator[?] identifier[a] operator[:] operator[SEP] identifier[b] operator[SEP] identifier[contains] operator[SEP] identifier[a] operator[SEP] operator[?] identifier[b] operator[:] identifier[a] operator[+] literal[String] operator[+] identifier[b] operator[SEP] , operator[SEP] identifier[mPartitions] operator[<] Other[10] operator[?] Other[1] operator[:] identifier[mPartitions] operator[/] Other[10] operator[SEP] operator[SEP] operator[SEP] identifier[mSparkJobResult] operator[=] identifier[mergeStatus] operator[SEP] identifier[collect] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Status] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[resultMap] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Tuple2] operator[<] identifier[Status] , identifier[String] operator[>] identifier[op] operator[:] identifier[mSparkJobResult] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[addresses] operator[=] identifier[resultMap] operator[SEP] identifier[getOrDefault] operator[SEP] identifier[op] operator[SEP] identifier[_1] , Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[addresses] operator[SEP] identifier[add] operator[SEP] identifier[op] operator[SEP] identifier[_2] operator[SEP] operator[SEP] identifier[resultMap] operator[SEP] identifier[put] operator[SEP] identifier[op] operator[SEP] identifier[_1] , identifier[addresses] operator[SEP] operator[SEP]
}
Keyword[return] identifier[CheckerUtils] operator[SEP] identifier[printNodesResults] operator[SEP] identifier[resultMap] , identifier[reportWriter] operator[SEP] operator[SEP]
}
|
public Object get(int index) {
return HprofInstanceValue.getTypeValue(dumpBuffer, offset + ((long)index * (long)elSize), type).toString();
} | class class_name[name] begin[{]
method[get, return_type[type[Object]], modifier[public], parameter[index]] begin[{]
return[call[HprofInstanceValue.getTypeValue, parameter[member[.dumpBuffer], binary_operation[member[.offset], +, binary_operation[Cast(expression=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=long)), *, Cast(expression=MemberReference(member=elSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=long))]], member[.type]]]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[get] operator[SEP] Keyword[int] identifier[index] operator[SEP] {
Keyword[return] identifier[HprofInstanceValue] operator[SEP] identifier[getTypeValue] operator[SEP] identifier[dumpBuffer] , identifier[offset] operator[+] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[index] operator[*] operator[SEP] Keyword[long] operator[SEP] identifier[elSize] operator[SEP] , identifier[type] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
circle = circlePaths.get(0);
circle.center[0] = maxLength * mInterpolatedTime;
RectF ball1 = new RectF();
ball1.left = circle.center[0] - circle.radius;
ball1.top = circle.center[1] - circle.radius;
ball1.right = ball1.left + circle.radius * 2;
ball1.bottom = ball1.top + circle.radius * 2;
canvas.drawCircle(ball1.centerX(), ball1.centerY(), circle.radius, paint);
for (int i = 1, l = circlePaths.size(); i < l; i++) {
metaball(canvas, i, 0, 0.6f, handle_len_rate, radius * 4f);
}
} | class class_name[name] begin[{]
method[onDraw, return_type[void], modifier[protected], parameter[canvas]] begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=canvas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onDraw, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
assign[member[.circle], call[circlePaths.get, parameter[literal[0]]]]
assign[member[circle.center], binary_operation[member[.maxLength], *, member[.mInterpolatedTime]]]
local_variable[type[RectF], ball1]
assign[member[ball1.left], binary_operation[member[circle.center], -, member[circle.radius]]]
assign[member[ball1.top], binary_operation[member[circle.center], -, member[circle.radius]]]
assign[member[ball1.right], binary_operation[member[ball1.left], +, binary_operation[member[circle.radius], *, literal[2]]]]
assign[member[ball1.bottom], binary_operation[member[ball1.top], +, binary_operation[member[circle.radius], *, literal[2]]]]
call[canvas.drawCircle, parameter[call[ball1.centerX, parameter[]], call[ball1.centerY, parameter[]], member[circle.radius], member[.paint]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=canvas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.6f), MemberReference(member=handle_len_rate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=radius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4f), operator=*)], member=metaball, 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=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=circlePaths, selectors=[], type_arguments=None), name=l)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[onDraw] operator[SEP] identifier[Canvas] identifier[canvas] operator[SEP] {
Keyword[super] operator[SEP] identifier[onDraw] operator[SEP] identifier[canvas] operator[SEP] operator[SEP] identifier[circle] operator[=] identifier[circlePaths] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[circle] operator[SEP] identifier[center] operator[SEP] Other[0] operator[SEP] operator[=] identifier[maxLength] operator[*] identifier[mInterpolatedTime] operator[SEP] identifier[RectF] identifier[ball1] operator[=] Keyword[new] identifier[RectF] operator[SEP] operator[SEP] operator[SEP] identifier[ball1] operator[SEP] identifier[left] operator[=] identifier[circle] operator[SEP] identifier[center] operator[SEP] Other[0] operator[SEP] operator[-] identifier[circle] operator[SEP] identifier[radius] operator[SEP] identifier[ball1] operator[SEP] identifier[top] operator[=] identifier[circle] operator[SEP] identifier[center] operator[SEP] Other[1] operator[SEP] operator[-] identifier[circle] operator[SEP] identifier[radius] operator[SEP] identifier[ball1] operator[SEP] identifier[right] operator[=] identifier[ball1] operator[SEP] identifier[left] operator[+] identifier[circle] operator[SEP] identifier[radius] operator[*] Other[2] operator[SEP] identifier[ball1] operator[SEP] identifier[bottom] operator[=] identifier[ball1] operator[SEP] identifier[top] operator[+] identifier[circle] operator[SEP] identifier[radius] operator[*] Other[2] operator[SEP] identifier[canvas] operator[SEP] identifier[drawCircle] operator[SEP] identifier[ball1] operator[SEP] identifier[centerX] operator[SEP] operator[SEP] , identifier[ball1] operator[SEP] identifier[centerY] operator[SEP] operator[SEP] , identifier[circle] operator[SEP] identifier[radius] , identifier[paint] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] , identifier[l] operator[=] identifier[circlePaths] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[l] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[metaball] operator[SEP] identifier[canvas] , identifier[i] , Other[0] , literal[Float] , identifier[handle_len_rate] , identifier[radius] operator[*] literal[Float] operator[SEP] operator[SEP]
}
}
|
public OvhExchangeServiceProtocol organizationName_service_exchangeService_protocol_GET(String organizationName, String exchangeService) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/protocol";
StringBuilder sb = path(qPath, organizationName, exchangeService);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhExchangeServiceProtocol.class);
} | class class_name[name] begin[{]
method[organizationName_service_exchangeService_protocol_GET, return_type[type[OvhExchangeServiceProtocol]], modifier[public], parameter[organizationName, exchangeService]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
local_variable[type[String], resp]
return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhExchangeServiceProtocol, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[OvhExchangeServiceProtocol] identifier[organizationName_service_exchangeService_protocol_GET] operator[SEP] identifier[String] identifier[organizationName] , identifier[String] identifier[exchangeService] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[organizationName] , identifier[exchangeService] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhExchangeServiceProtocol] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
public static boolean canAcceptParent(Class<? extends ElementBase> childClass,
Class<? extends ElementBase> parentClass) {
return allowedParentClasses.isRelated(childClass, parentClass);
} | class class_name[name] begin[{]
method[canAcceptParent, return_type[type[boolean]], modifier[public static], parameter[childClass, parentClass]] begin[{]
return[call[allowedParentClasses.isRelated, parameter[member[.childClass], member[.parentClass]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[canAcceptParent] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[ElementBase] operator[>] identifier[childClass] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[ElementBase] operator[>] identifier[parentClass] operator[SEP] {
Keyword[return] identifier[allowedParentClasses] operator[SEP] identifier[isRelated] operator[SEP] identifier[childClass] , identifier[parentClass] operator[SEP] operator[SEP]
}
|
public void addMultipleItems(int times, final Object... values) {
for (int i = 0; i < times; i++) {
addItemAsArray(values);
}
} | class class_name[name] begin[{]
method[addMultipleItems, return_type[void], modifier[public], parameter[times, values]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addItemAsArray, 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=times, 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[void] identifier[addMultipleItems] operator[SEP] Keyword[int] identifier[times] , Keyword[final] identifier[Object] operator[...] identifier[values] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[times] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[addItemAsArray] operator[SEP] identifier[values] operator[SEP] operator[SEP]
}
}
|
public static void insertFromBooleanArray(final boolean[] booleanValues,
final DeviceData deviceDataArgin, final int dataType) throws DevFailed {
// by default for xdim = 1, send the sum.
boolean firstBoolean = false;
if (booleanValues.length > 0) {
firstBoolean = booleanValues[0];
}
Integer intValue = new Integer(0);
if (firstBoolean) {
intValue = new Integer(1);
}
switch (dataType) {
case TangoConst.Tango_DEV_SHORT:
deviceDataArgin.insert(intValue.shortValue());
break;
case TangoConst.Tango_DEV_USHORT:
deviceDataArgin.insert_us(intValue.shortValue());
break;
case TangoConst.Tango_DEV_CHAR:
Except.throw_exception("TANGO_WRONG_DATA_ERROR",
"input type Tango_DEV_CHAR not supported",
"CommandHelper.insertFromBooleanArray(boolean[] values,deviceDataArgin)");
break;
case TangoConst.Tango_DEV_UCHAR:
deviceDataArgin.insert(intValue.shortValue());
break;
case TangoConst.Tango_DEV_LONG:
deviceDataArgin.insert(intValue.intValue());
break;
case TangoConst.Tango_DEV_ULONG:
deviceDataArgin.insert_ul(intValue.longValue());
break;
case TangoConst.Tango_DEV_LONG64:
deviceDataArgin.insert(intValue.intValue());
break;
case TangoConst.Tango_DEV_ULONG64:
deviceDataArgin.insert_u64(intValue.longValue());
break;
case TangoConst.Tango_DEV_INT:
deviceDataArgin.insert(intValue.intValue());
break;
case TangoConst.Tango_DEV_FLOAT:
deviceDataArgin.insert(intValue.floatValue());
break;
case TangoConst.Tango_DEV_DOUBLE:
deviceDataArgin.insert(intValue.doubleValue());
break;
case TangoConst.Tango_DEV_STRING:
deviceDataArgin.insert(intValue.toString());
break;
case TangoConst.Tango_DEV_BOOLEAN:
deviceDataArgin.insert(firstBoolean);
break;
case TangoConst.Tango_DEV_STATE:
Except.throw_exception("TANGO_WRONG_DATA_ERROR",
"input type Tango_DEV_STATE not supported",
"CommandHelper.insertFromBooleanArray(boolean[] values,deviceDataArgin)");
break;
// Array input type
case TangoConst.Tango_DEVVAR_SHORTARRAY:
final short[] shortValues = new short[booleanValues.length];
for (int i = 0; i < booleanValues.length; i++) {
if (booleanValues[i]) {
shortValues[i] = 1;
} else {
shortValues[i] = 0;
}
}
deviceDataArgin.insert(shortValues);
break;
case TangoConst.Tango_DEVVAR_USHORTARRAY:
final short[] ushortValues = new short[booleanValues.length];
for (int i = 0; i < booleanValues.length; i++) {
if (booleanValues[i]) {
ushortValues[i] = 1;
} else {
ushortValues[i] = 0;
}
}
deviceDataArgin.insert(ushortValues);
break;
case TangoConst.Tango_DEVVAR_CHARARRAY:
final byte[] byteValues = new byte[booleanValues.length];
for (int i = 0; i < booleanValues.length; i++) {
if (booleanValues[i]) {
byteValues[i] = Short.valueOf((short) 1).byteValue();
} else {
byteValues[i] = Short.valueOf((short) 0).byteValue();
}
}
deviceDataArgin.insert(byteValues);
break;
case TangoConst.Tango_DEVVAR_LONGARRAY:
final int[] longValues = new int[booleanValues.length];
for (int i = 0; i < booleanValues.length; i++) {
if (booleanValues[i]) {
longValues[i] = 1;
} else {
longValues[i] = 0;
}
}
deviceDataArgin.insert(longValues);
break;
case TangoConst.Tango_DEVVAR_ULONGARRAY:
final long[] ulongValues = new long[booleanValues.length];
for (int i = 0; i < booleanValues.length; i++) {
if (booleanValues[i]) {
ulongValues[i] = 1;
} else {
ulongValues[i] = 0;
}
}
deviceDataArgin.insert_ul(ulongValues);
break;
case TangoConst.Tango_DEVVAR_LONG64ARRAY:
final int[] long64Values = new int[booleanValues.length];
for (int i = 0; i < booleanValues.length; i++) {
if (booleanValues[i]) {
long64Values[i] = 1;
} else {
long64Values[i] = 0;
}
}
deviceDataArgin.insert(long64Values);
break;
case TangoConst.Tango_DEVVAR_ULONG64ARRAY:
final long[] ulong64Values = new long[booleanValues.length];
for (int i = 0; i < booleanValues.length; i++) {
if (booleanValues[i]) {
ulong64Values[i] = 1;
} else {
ulong64Values[i] = 0;
}
}
deviceDataArgin.insert_u64(ulong64Values);
break;
case TangoConst.Tango_DEVVAR_FLOATARRAY:
final float[] floatValues = new float[booleanValues.length];
for (int i = 0; i < booleanValues.length; i++) {
if (booleanValues[i]) {
floatValues[i] = 1;
} else {
floatValues[i] = 0;
}
}
deviceDataArgin.insert(floatValues);
break;
case TangoConst.Tango_DEVVAR_DOUBLEARRAY:
final double[] doubleValues = new double[booleanValues.length];
for (int i = 0; i < booleanValues.length; i++) {
if (booleanValues[i]) {
doubleValues[i] = 1;
} else {
doubleValues[i] = 0;
}
}
deviceDataArgin.insert(doubleValues);
break;
case TangoConst.Tango_DEVVAR_STRINGARRAY:
final String[] stringValues = new String[booleanValues.length];
for (int i = 0; i < booleanValues.length; i++) {
stringValues[i] = Boolean.valueOf(booleanValues[i]).toString();
}
deviceDataArgin.insert(stringValues);
break;
default:
Except.throw_exception("TANGO_WRONG_DATA_ERROR", "input type "
+ deviceDataArgin.getType() + " not supported",
"insertFromBooleanArray.insertFromLongArray(boolean[] values,deviceDataArgin)");
break;
}
} | class class_name[name] begin[{]
method[insertFromBooleanArray, return_type[void], modifier[public static], parameter[booleanValues, deviceDataArgin, dataType]] begin[{]
local_variable[type[boolean], firstBoolean]
if[binary_operation[member[booleanValues.length], >, literal[0]]] begin[{]
assign[member[.firstBoolean], member[.booleanValues]]
else begin[{]
None
end[}]
local_variable[type[Integer], intValue]
if[member[.firstBoolean]] begin[{]
assign[member[.intValue], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]
else begin[{]
None
end[}]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=Tango_DEV_SHORT, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=shortValue, postfix_operators=[], prefix_operators=[], qualifier=intValue, selectors=[], type_arguments=None)], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEV_USHORT, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=shortValue, postfix_operators=[], prefix_operators=[], qualifier=intValue, selectors=[], type_arguments=None)], member=insert_us, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEV_CHAR, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TANGO_WRONG_DATA_ERROR"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="input type Tango_DEV_CHAR not supported"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CommandHelper.insertFromBooleanArray(boolean[] values,deviceDataArgin)")], member=throw_exception, postfix_operators=[], prefix_operators=[], qualifier=Except, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEV_UCHAR, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=shortValue, postfix_operators=[], prefix_operators=[], qualifier=intValue, selectors=[], type_arguments=None)], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEV_LONG, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=intValue, postfix_operators=[], prefix_operators=[], qualifier=intValue, selectors=[], type_arguments=None)], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEV_ULONG, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=longValue, postfix_operators=[], prefix_operators=[], qualifier=intValue, selectors=[], type_arguments=None)], member=insert_ul, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEV_LONG64, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=intValue, postfix_operators=[], prefix_operators=[], qualifier=intValue, selectors=[], type_arguments=None)], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEV_ULONG64, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=longValue, postfix_operators=[], prefix_operators=[], qualifier=intValue, selectors=[], type_arguments=None)], member=insert_u64, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEV_INT, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=intValue, postfix_operators=[], prefix_operators=[], qualifier=intValue, selectors=[], type_arguments=None)], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEV_FLOAT, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=floatValue, postfix_operators=[], prefix_operators=[], qualifier=intValue, selectors=[], type_arguments=None)], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEV_DOUBLE, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=intValue, selectors=[], type_arguments=None)], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEV_STRING, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=intValue, selectors=[], type_arguments=None)], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEV_BOOLEAN, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=firstBoolean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEV_STATE, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TANGO_WRONG_DATA_ERROR"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="input type Tango_DEV_STATE not supported"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CommandHelper.insertFromBooleanArray(boolean[] values,deviceDataArgin)")], member=throw_exception, postfix_operators=[], prefix_operators=[], qualifier=Except, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEVVAR_SHORTARRAY, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=booleanValues, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=short)), name=shortValues)], modifiers={'final'}, type=BasicType(dimensions=[None], name=short)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=booleanValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=shortValues, 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=0)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=shortValues, 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=1)), 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=booleanValues, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=shortValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEVVAR_USHORTARRAY, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=booleanValues, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=short)), name=ushortValues)], modifiers={'final'}, type=BasicType(dimensions=[None], name=short)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=booleanValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ushortValues, 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=0)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ushortValues, 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=1)), 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=booleanValues, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ushortValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEVVAR_CHARARRAY, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=booleanValues, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=byteValues)], modifiers={'final'}, type=BasicType(dimensions=[None], name=byte)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=booleanValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=byteValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), type=BasicType(dimensions=[], name=short))], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Short, selectors=[MethodInvocation(arguments=[], member=byteValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=byteValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), type=BasicType(dimensions=[], name=short))], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Short, selectors=[MethodInvocation(arguments=[], member=byteValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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=booleanValues, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=byteValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEVVAR_LONGARRAY, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=booleanValues, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int)), name=longValues)], modifiers={'final'}, type=BasicType(dimensions=[None], name=int)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=booleanValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=longValues, 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=0)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=longValues, 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=1)), 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=booleanValues, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=longValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEVVAR_ULONGARRAY, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=booleanValues, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=long)), name=ulongValues)], modifiers={'final'}, type=BasicType(dimensions=[None], name=long)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=booleanValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ulongValues, 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=0)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ulongValues, 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=1)), 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=booleanValues, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ulongValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert_ul, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEVVAR_LONG64ARRAY, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=booleanValues, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int)), name=long64Values)], modifiers={'final'}, type=BasicType(dimensions=[None], name=int)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=booleanValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=long64Values, 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=0)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=long64Values, 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=1)), 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=booleanValues, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=long64Values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEVVAR_ULONG64ARRAY, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=booleanValues, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=long)), name=ulong64Values)], modifiers={'final'}, type=BasicType(dimensions=[None], name=long)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=booleanValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ulong64Values, 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=0)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ulong64Values, 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=1)), 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=booleanValues, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ulong64Values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert_u64, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEVVAR_FLOATARRAY, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=booleanValues, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=float)), name=floatValues)], modifiers={'final'}, type=BasicType(dimensions=[None], name=float)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=booleanValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=floatValues, 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=0)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=floatValues, 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=1)), 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=booleanValues, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=floatValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEVVAR_DOUBLEARRAY, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=booleanValues, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double)), name=doubleValues)], modifiers={'final'}, type=BasicType(dimensions=[None], name=double)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=booleanValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=doubleValues, 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=0)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=doubleValues, 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=1)), 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=booleanValues, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=doubleValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=Tango_DEVVAR_STRINGARRAY, postfix_operators=[], prefix_operators=[], qualifier=TangoConst, selectors=[])], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=booleanValues, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=stringValues)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stringValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=booleanValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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=booleanValues, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stringValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TANGO_WRONG_DATA_ERROR"), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="input type "), operandr=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=deviceDataArgin, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" not supported"), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="insertFromBooleanArray.insertFromLongArray(boolean[] values,deviceDataArgin)")], member=throw_exception, postfix_operators=[], prefix_operators=[], qualifier=Except, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=dataType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[insertFromBooleanArray] operator[SEP] Keyword[final] Keyword[boolean] operator[SEP] operator[SEP] identifier[booleanValues] , Keyword[final] identifier[DeviceData] identifier[deviceDataArgin] , Keyword[final] Keyword[int] identifier[dataType] operator[SEP] Keyword[throws] identifier[DevFailed] {
Keyword[boolean] identifier[firstBoolean] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[booleanValues] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
identifier[firstBoolean] operator[=] identifier[booleanValues] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
identifier[Integer] identifier[intValue] operator[=] Keyword[new] identifier[Integer] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[firstBoolean] operator[SEP] {
identifier[intValue] operator[=] Keyword[new] identifier[Integer] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[dataType] operator[SEP] {
Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEV_SHORT] operator[:] identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[intValue] operator[SEP] identifier[shortValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEV_USHORT] operator[:] identifier[deviceDataArgin] operator[SEP] identifier[insert_us] operator[SEP] identifier[intValue] operator[SEP] identifier[shortValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEV_CHAR] operator[:] identifier[Except] operator[SEP] identifier[throw_exception] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEV_UCHAR] operator[:] identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[intValue] operator[SEP] identifier[shortValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEV_LONG] operator[:] identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[intValue] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEV_ULONG] operator[:] identifier[deviceDataArgin] operator[SEP] identifier[insert_ul] operator[SEP] identifier[intValue] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEV_LONG64] operator[:] identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[intValue] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEV_ULONG64] operator[:] identifier[deviceDataArgin] operator[SEP] identifier[insert_u64] operator[SEP] identifier[intValue] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEV_INT] operator[:] identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[intValue] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEV_FLOAT] operator[:] identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[intValue] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEV_DOUBLE] operator[:] identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[intValue] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEV_STRING] operator[:] identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[intValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEV_BOOLEAN] operator[:] identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[firstBoolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEV_STATE] operator[:] identifier[Except] operator[SEP] identifier[throw_exception] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEVVAR_SHORTARRAY] operator[:] Keyword[final] Keyword[short] operator[SEP] operator[SEP] identifier[shortValues] operator[=] Keyword[new] Keyword[short] operator[SEP] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[booleanValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] {
identifier[shortValues] operator[SEP] identifier[i] operator[SEP] operator[=] Other[1] operator[SEP]
}
Keyword[else] {
identifier[shortValues] operator[SEP] identifier[i] operator[SEP] operator[=] Other[0] operator[SEP]
}
}
identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[shortValues] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEVVAR_USHORTARRAY] operator[:] Keyword[final] Keyword[short] operator[SEP] operator[SEP] identifier[ushortValues] operator[=] Keyword[new] Keyword[short] operator[SEP] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[booleanValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] {
identifier[ushortValues] operator[SEP] identifier[i] operator[SEP] operator[=] Other[1] operator[SEP]
}
Keyword[else] {
identifier[ushortValues] operator[SEP] identifier[i] operator[SEP] operator[=] Other[0] operator[SEP]
}
}
identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[ushortValues] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEVVAR_CHARARRAY] operator[:] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[byteValues] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[booleanValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] {
identifier[byteValues] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[Short] operator[SEP] identifier[valueOf] operator[SEP] operator[SEP] Keyword[short] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[byteValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[byteValues] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[Short] operator[SEP] identifier[valueOf] operator[SEP] operator[SEP] Keyword[short] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[byteValue] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[byteValues] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEVVAR_LONGARRAY] operator[:] Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[longValues] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[booleanValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] {
identifier[longValues] operator[SEP] identifier[i] operator[SEP] operator[=] Other[1] operator[SEP]
}
Keyword[else] {
identifier[longValues] operator[SEP] identifier[i] operator[SEP] operator[=] Other[0] operator[SEP]
}
}
identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[longValues] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEVVAR_ULONGARRAY] operator[:] Keyword[final] Keyword[long] operator[SEP] operator[SEP] identifier[ulongValues] operator[=] Keyword[new] Keyword[long] operator[SEP] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[booleanValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] {
identifier[ulongValues] operator[SEP] identifier[i] operator[SEP] operator[=] Other[1] operator[SEP]
}
Keyword[else] {
identifier[ulongValues] operator[SEP] identifier[i] operator[SEP] operator[=] Other[0] operator[SEP]
}
}
identifier[deviceDataArgin] operator[SEP] identifier[insert_ul] operator[SEP] identifier[ulongValues] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEVVAR_LONG64ARRAY] operator[:] Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[long64Values] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[booleanValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] {
identifier[long64Values] operator[SEP] identifier[i] operator[SEP] operator[=] Other[1] operator[SEP]
}
Keyword[else] {
identifier[long64Values] operator[SEP] identifier[i] operator[SEP] operator[=] Other[0] operator[SEP]
}
}
identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[long64Values] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEVVAR_ULONG64ARRAY] operator[:] Keyword[final] Keyword[long] operator[SEP] operator[SEP] identifier[ulong64Values] operator[=] Keyword[new] Keyword[long] operator[SEP] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[booleanValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] {
identifier[ulong64Values] operator[SEP] identifier[i] operator[SEP] operator[=] Other[1] operator[SEP]
}
Keyword[else] {
identifier[ulong64Values] operator[SEP] identifier[i] operator[SEP] operator[=] Other[0] operator[SEP]
}
}
identifier[deviceDataArgin] operator[SEP] identifier[insert_u64] operator[SEP] identifier[ulong64Values] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEVVAR_FLOATARRAY] operator[:] Keyword[final] Keyword[float] operator[SEP] operator[SEP] identifier[floatValues] operator[=] Keyword[new] Keyword[float] operator[SEP] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[booleanValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] {
identifier[floatValues] operator[SEP] identifier[i] operator[SEP] operator[=] Other[1] operator[SEP]
}
Keyword[else] {
identifier[floatValues] operator[SEP] identifier[i] operator[SEP] operator[=] Other[0] operator[SEP]
}
}
identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[floatValues] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEVVAR_DOUBLEARRAY] operator[:] Keyword[final] Keyword[double] operator[SEP] operator[SEP] identifier[doubleValues] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[booleanValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] {
identifier[doubleValues] operator[SEP] identifier[i] operator[SEP] operator[=] Other[1] operator[SEP]
}
Keyword[else] {
identifier[doubleValues] operator[SEP] identifier[i] operator[SEP] operator[=] Other[0] operator[SEP]
}
}
identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[doubleValues] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[TangoConst] operator[SEP] identifier[Tango_DEVVAR_STRINGARRAY] operator[:] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[stringValues] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[booleanValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[stringValues] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[booleanValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
identifier[deviceDataArgin] operator[SEP] identifier[insert] operator[SEP] identifier[stringValues] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[Except] operator[SEP] identifier[throw_exception] operator[SEP] literal[String] , literal[String] operator[+] identifier[deviceDataArgin] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[+] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
|
private static void putTypes(Class<?> cls, Class<?> expectedCls, Class<?> commonBaseCls, Type[] types) {
poll();
genericInterfacesCache.put(new ClassesKey(referenceQueue, cls, expectedCls, commonBaseCls), types);
} | class class_name[name] begin[{]
method[putTypes, return_type[void], modifier[private static], parameter[cls, expectedCls, commonBaseCls, types]] begin[{]
call[.poll, parameter[]]
call[genericInterfacesCache.put, parameter[ClassCreator(arguments=[MemberReference(member=referenceQueue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cls, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=expectedCls, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=commonBaseCls, 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=ClassesKey, sub_type=None)), member[.types]]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[putTypes] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[cls] , identifier[Class] operator[<] operator[?] operator[>] identifier[expectedCls] , identifier[Class] operator[<] operator[?] operator[>] identifier[commonBaseCls] , identifier[Type] operator[SEP] operator[SEP] identifier[types] operator[SEP] {
identifier[poll] operator[SEP] operator[SEP] operator[SEP] identifier[genericInterfacesCache] operator[SEP] identifier[put] operator[SEP] Keyword[new] identifier[ClassesKey] operator[SEP] identifier[referenceQueue] , identifier[cls] , identifier[expectedCls] , identifier[commonBaseCls] operator[SEP] , identifier[types] operator[SEP] operator[SEP]
}
|
public Packer setFillBoth(final boolean how) {
if (how == true) {
gc.fill = GridBagConstraints.BOTH;
gc.weightx = 1;
gc.weighty = 1;
} else {
gc.weightx = 0;
gc.weighty = 0;
gc.fill = 0;
}
setConstraints(comp, gc);
return this;
} | class class_name[name] begin[{]
method[setFillBoth, return_type[type[Packer]], modifier[public], parameter[how]] begin[{]
if[binary_operation[member[.how], ==, literal[true]]] begin[{]
assign[member[gc.fill], member[GridBagConstraints.BOTH]]
assign[member[gc.weightx], literal[1]]
assign[member[gc.weighty], literal[1]]
else begin[{]
assign[member[gc.weightx], literal[0]]
assign[member[gc.weighty], literal[0]]
assign[member[gc.fill], literal[0]]
end[}]
call[.setConstraints, parameter[member[.comp], member[.gc]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Packer] identifier[setFillBoth] operator[SEP] Keyword[final] Keyword[boolean] identifier[how] operator[SEP] {
Keyword[if] operator[SEP] identifier[how] operator[==] literal[boolean] operator[SEP] {
identifier[gc] operator[SEP] identifier[fill] operator[=] identifier[GridBagConstraints] operator[SEP] identifier[BOTH] operator[SEP] identifier[gc] operator[SEP] identifier[weightx] operator[=] Other[1] operator[SEP] identifier[gc] operator[SEP] identifier[weighty] operator[=] Other[1] operator[SEP]
}
Keyword[else] {
identifier[gc] operator[SEP] identifier[weightx] operator[=] Other[0] operator[SEP] identifier[gc] operator[SEP] identifier[weighty] operator[=] Other[0] operator[SEP] identifier[gc] operator[SEP] identifier[fill] operator[=] Other[0] operator[SEP]
}
identifier[setConstraints] operator[SEP] identifier[comp] , identifier[gc] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public Object invoke (Object object, String methodName, Object... args) {
return invoke(object, getIndex(methodName, args == null ? 0 : args.length), args);
} | class class_name[name] begin[{]
method[invoke, return_type[type[Object]], modifier[public], parameter[object, methodName, args]] begin[{]
return[call[.invoke, parameter[member[.object], call[.getIndex, parameter[member[.methodName], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=args, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]], member[.args]]]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[invoke] operator[SEP] identifier[Object] identifier[object] , identifier[String] identifier[methodName] , identifier[Object] operator[...] identifier[args] operator[SEP] {
Keyword[return] identifier[invoke] operator[SEP] identifier[object] , identifier[getIndex] operator[SEP] identifier[methodName] , identifier[args] operator[==] Other[null] operator[?] Other[0] operator[:] identifier[args] operator[SEP] identifier[length] operator[SEP] , identifier[args] operator[SEP] operator[SEP]
}
|
private String updateRemoteHost(String remoteHost){
String [] splitStr = remoteHost.split("\\.");
remoteHost = new StringBuilder(remoteHost).insert(splitStr[0].length(), "-all").toString();
return remoteHost;
} | class class_name[name] begin[{]
method[updateRemoteHost, return_type[type[String]], modifier[private], parameter[remoteHost]] begin[{]
local_variable[type[String], splitStr]
assign[member[.remoteHost], ClassCreator(arguments=[MemberReference(member=remoteHost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=splitStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-all")], member=insert, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))]
return[member[.remoteHost]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[updateRemoteHost] operator[SEP] identifier[String] identifier[remoteHost] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[splitStr] operator[=] identifier[remoteHost] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[remoteHost] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[remoteHost] operator[SEP] operator[SEP] identifier[insert] operator[SEP] identifier[splitStr] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[remoteHost] operator[SEP]
}
|
protected XMLObject newAttributeValue(final Object value, final String valueType, final QName elementName) {
if (XSString.class.getSimpleName().equalsIgnoreCase(valueType)) {
val builder = new XSStringBuilder();
val attrValueObj = builder.buildObject(elementName, XSString.TYPE_NAME);
attrValueObj.setValue(value.toString());
return attrValueObj;
}
if (XSURI.class.getSimpleName().equalsIgnoreCase(valueType)) {
val builder = new XSURIBuilder();
val attrValueObj = builder.buildObject(elementName, XSURI.TYPE_NAME);
attrValueObj.setValue(value.toString());
return attrValueObj;
}
if (XSBoolean.class.getSimpleName().equalsIgnoreCase(valueType)) {
val builder = new XSBooleanBuilder();
val attrValueObj = builder.buildObject(elementName, XSBoolean.TYPE_NAME);
attrValueObj.setValue(XSBooleanValue.valueOf(value.toString().toLowerCase()));
return attrValueObj;
}
if (XSInteger.class.getSimpleName().equalsIgnoreCase(valueType)) {
val builder = new XSIntegerBuilder();
val attrValueObj = builder.buildObject(elementName, XSInteger.TYPE_NAME);
attrValueObj.setValue(Integer.valueOf(value.toString()));
return attrValueObj;
}
if (XSDateTime.class.getSimpleName().equalsIgnoreCase(valueType)) {
val builder = new XSDateTimeBuilder();
val attrValueObj = builder.buildObject(elementName, XSDateTime.TYPE_NAME);
attrValueObj.setValue(DateTime.parse(value.toString()));
return attrValueObj;
}
if (XSBase64Binary.class.getSimpleName().equalsIgnoreCase(valueType)) {
val builder = new XSBase64BinaryBuilder();
val attrValueObj = builder.buildObject(elementName, XSBase64Binary.TYPE_NAME);
attrValueObj.setValue(value.toString());
return attrValueObj;
}
if (XSObject.class.getSimpleName().equalsIgnoreCase(valueType)) {
val mapper = new JacksonXmlSerializer();
val builder = new XSAnyBuilder();
val attrValueObj = builder.buildObject(elementName);
attrValueObj.setTextContent(mapper.writeValueAsString(value));
return attrValueObj;
}
val builder = new XSAnyBuilder();
val attrValueObj = builder.buildObject(elementName);
attrValueObj.setTextContent(value.toString());
return attrValueObj;
} | class class_name[name] begin[{]
method[newAttributeValue, return_type[type[XMLObject]], modifier[protected], parameter[value, valueType, elementName]] begin[{]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=valueType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=XSString, sub_type=None))] begin[{]
local_variable[type[val], builder]
local_variable[type[val], attrValueObj]
call[attrValueObj.setValue, parameter[call[value.toString, parameter[]]]]
return[member[.attrValueObj]]
else begin[{]
None
end[}]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=valueType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=XSURI, sub_type=None))] begin[{]
local_variable[type[val], builder]
local_variable[type[val], attrValueObj]
call[attrValueObj.setValue, parameter[call[value.toString, parameter[]]]]
return[member[.attrValueObj]]
else begin[{]
None
end[}]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=valueType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=XSBoolean, sub_type=None))] begin[{]
local_variable[type[val], builder]
local_variable[type[val], attrValueObj]
call[attrValueObj.setValue, parameter[call[XSBooleanValue.valueOf, parameter[call[value.toString, parameter[]]]]]]
return[member[.attrValueObj]]
else begin[{]
None
end[}]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=valueType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=XSInteger, sub_type=None))] begin[{]
local_variable[type[val], builder]
local_variable[type[val], attrValueObj]
call[attrValueObj.setValue, parameter[call[Integer.valueOf, parameter[call[value.toString, parameter[]]]]]]
return[member[.attrValueObj]]
else begin[{]
None
end[}]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=valueType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=XSDateTime, sub_type=None))] begin[{]
local_variable[type[val], builder]
local_variable[type[val], attrValueObj]
call[attrValueObj.setValue, parameter[call[DateTime.parse, parameter[call[value.toString, parameter[]]]]]]
return[member[.attrValueObj]]
else begin[{]
None
end[}]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=valueType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=XSBase64Binary, sub_type=None))] begin[{]
local_variable[type[val], builder]
local_variable[type[val], attrValueObj]
call[attrValueObj.setValue, parameter[call[value.toString, parameter[]]]]
return[member[.attrValueObj]]
else begin[{]
None
end[}]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=valueType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=XSObject, sub_type=None))] begin[{]
local_variable[type[val], mapper]
local_variable[type[val], builder]
local_variable[type[val], attrValueObj]
call[attrValueObj.setTextContent, parameter[call[mapper.writeValueAsString, parameter[member[.value]]]]]
return[member[.attrValueObj]]
else begin[{]
None
end[}]
local_variable[type[val], builder]
local_variable[type[val], attrValueObj]
call[attrValueObj.setTextContent, parameter[call[value.toString, parameter[]]]]
return[member[.attrValueObj]]
end[}]
END[}] | Keyword[protected] identifier[XMLObject] identifier[newAttributeValue] operator[SEP] Keyword[final] identifier[Object] identifier[value] , Keyword[final] identifier[String] identifier[valueType] , Keyword[final] identifier[QName] identifier[elementName] operator[SEP] {
Keyword[if] operator[SEP] identifier[XSString] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[valueType] operator[SEP] operator[SEP] {
identifier[val] identifier[builder] operator[=] Keyword[new] identifier[XSStringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[attrValueObj] operator[=] identifier[builder] operator[SEP] identifier[buildObject] operator[SEP] identifier[elementName] , identifier[XSString] operator[SEP] identifier[TYPE_NAME] operator[SEP] operator[SEP] identifier[attrValueObj] operator[SEP] identifier[setValue] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[attrValueObj] operator[SEP]
}
Keyword[if] operator[SEP] identifier[XSURI] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[valueType] operator[SEP] operator[SEP] {
identifier[val] identifier[builder] operator[=] Keyword[new] identifier[XSURIBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[attrValueObj] operator[=] identifier[builder] operator[SEP] identifier[buildObject] operator[SEP] identifier[elementName] , identifier[XSURI] operator[SEP] identifier[TYPE_NAME] operator[SEP] operator[SEP] identifier[attrValueObj] operator[SEP] identifier[setValue] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[attrValueObj] operator[SEP]
}
Keyword[if] operator[SEP] identifier[XSBoolean] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[valueType] operator[SEP] operator[SEP] {
identifier[val] identifier[builder] operator[=] Keyword[new] identifier[XSBooleanBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[attrValueObj] operator[=] identifier[builder] operator[SEP] identifier[buildObject] operator[SEP] identifier[elementName] , identifier[XSBoolean] operator[SEP] identifier[TYPE_NAME] operator[SEP] operator[SEP] identifier[attrValueObj] operator[SEP] identifier[setValue] operator[SEP] identifier[XSBooleanValue] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[attrValueObj] operator[SEP]
}
Keyword[if] operator[SEP] identifier[XSInteger] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[valueType] operator[SEP] operator[SEP] {
identifier[val] identifier[builder] operator[=] Keyword[new] identifier[XSIntegerBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[attrValueObj] operator[=] identifier[builder] operator[SEP] identifier[buildObject] operator[SEP] identifier[elementName] , identifier[XSInteger] operator[SEP] identifier[TYPE_NAME] operator[SEP] operator[SEP] identifier[attrValueObj] operator[SEP] identifier[setValue] operator[SEP] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[attrValueObj] operator[SEP]
}
Keyword[if] operator[SEP] identifier[XSDateTime] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[valueType] operator[SEP] operator[SEP] {
identifier[val] identifier[builder] operator[=] Keyword[new] identifier[XSDateTimeBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[attrValueObj] operator[=] identifier[builder] operator[SEP] identifier[buildObject] operator[SEP] identifier[elementName] , identifier[XSDateTime] operator[SEP] identifier[TYPE_NAME] operator[SEP] operator[SEP] identifier[attrValueObj] operator[SEP] identifier[setValue] operator[SEP] identifier[DateTime] operator[SEP] identifier[parse] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[attrValueObj] operator[SEP]
}
Keyword[if] operator[SEP] identifier[XSBase64Binary] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[valueType] operator[SEP] operator[SEP] {
identifier[val] identifier[builder] operator[=] Keyword[new] identifier[XSBase64BinaryBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[attrValueObj] operator[=] identifier[builder] operator[SEP] identifier[buildObject] operator[SEP] identifier[elementName] , identifier[XSBase64Binary] operator[SEP] identifier[TYPE_NAME] operator[SEP] operator[SEP] identifier[attrValueObj] operator[SEP] identifier[setValue] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[attrValueObj] operator[SEP]
}
Keyword[if] operator[SEP] identifier[XSObject] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[valueType] operator[SEP] operator[SEP] {
identifier[val] identifier[mapper] operator[=] Keyword[new] identifier[JacksonXmlSerializer] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[builder] operator[=] Keyword[new] identifier[XSAnyBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[attrValueObj] operator[=] identifier[builder] operator[SEP] identifier[buildObject] operator[SEP] identifier[elementName] operator[SEP] operator[SEP] identifier[attrValueObj] operator[SEP] identifier[setTextContent] operator[SEP] identifier[mapper] operator[SEP] identifier[writeValueAsString] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[attrValueObj] operator[SEP]
}
identifier[val] identifier[builder] operator[=] Keyword[new] identifier[XSAnyBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[attrValueObj] operator[=] identifier[builder] operator[SEP] identifier[buildObject] operator[SEP] identifier[elementName] operator[SEP] operator[SEP] identifier[attrValueObj] operator[SEP] identifier[setTextContent] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[attrValueObj] operator[SEP]
}
|
public static PoolInfo createPoolInfo(PoolInfoStrings poolInfoStrings) {
if (poolInfoStrings == null) {
return null;
}
return new PoolInfo(poolInfoStrings.getPoolGroupName(),
poolInfoStrings.getPoolName());
} | class class_name[name] begin[{]
method[createPoolInfo, return_type[type[PoolInfo]], modifier[public static], parameter[poolInfoStrings]] begin[{]
if[binary_operation[member[.poolInfoStrings], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getPoolGroupName, postfix_operators=[], prefix_operators=[], qualifier=poolInfoStrings, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getPoolName, postfix_operators=[], prefix_operators=[], qualifier=poolInfoStrings, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PoolInfo, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[PoolInfo] identifier[createPoolInfo] operator[SEP] identifier[PoolInfoStrings] identifier[poolInfoStrings] operator[SEP] {
Keyword[if] operator[SEP] identifier[poolInfoStrings] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[return] Keyword[new] identifier[PoolInfo] operator[SEP] identifier[poolInfoStrings] operator[SEP] identifier[getPoolGroupName] operator[SEP] operator[SEP] , identifier[poolInfoStrings] operator[SEP] identifier[getPoolName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private void downloadConservation(Species species, String assembly, Path speciesFolder)
throws IOException, InterruptedException {
logger.info("Downloading conservation information ...");
Path conservationFolder = speciesFolder.resolve("conservation");
if (species.getScientificName().equals("Homo sapiens")) {
makeDir(conservationFolder);
makeDir(conservationFolder.resolve("phastCons"));
makeDir(conservationFolder.resolve("phylop"));
makeDir(conservationFolder.resolve("gerp"));
String[] chromosomes = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14",
"15", "16", "17", "18", "19", "20", "21", "22", "X", "Y", "M", };
if (assembly.equalsIgnoreCase("GRCh37")) {
logger.debug("Downloading GERP++ ...");
downloadFile(configuration.getDownload().getGerp().getHost(),
conservationFolder.resolve(EtlCommons.GERP_SUBDIRECTORY + "/" + EtlCommons.GERP_FILE).toAbsolutePath().toString());
saveVersionData(EtlCommons.CONSERVATION_DATA, GERP_NAME, null, getTimeStamp(),
Collections.singletonList(configuration.getDownload().getGerp().getHost()),
conservationFolder.resolve("gerpVersion.json"));
String url = configuration.getDownload().getConservation().getHost() + "/hg19";
List<String> phastconsUrls = new ArrayList<>(chromosomes.length);
List<String> phyloPUrls = new ArrayList<>(chromosomes.length);
for (int i = 0; i < chromosomes.length; i++) {
String phastConsUrl = url + "/phastCons46way/primates/chr" + chromosomes[i] + ".phastCons46way.primates.wigFix.gz";
downloadFile(phastConsUrl, conservationFolder.resolve("phastCons").resolve("chr" + chromosomes[i]
+ ".phastCons46way.primates.wigFix.gz").toString());
phastconsUrls.add(phastConsUrl);
String phyloPUrl = url + "/phyloP46way/primates/chr" + chromosomes[i] + ".phyloP46way.primate.wigFix.gz";
downloadFile(phyloPUrl, conservationFolder.resolve("phylop").resolve("chr" + chromosomes[i]
+ ".phyloP46way.primate.wigFix.gz").toString());
phyloPUrls.add(phyloPUrl);
}
saveVersionData(EtlCommons.CONSERVATION_DATA, PHASTCONS_NAME, null, getTimeStamp(), phastconsUrls,
conservationFolder.resolve("phastConsVersion.json"));
saveVersionData(EtlCommons.CONSERVATION_DATA, PHYLOP_NAME, null, getTimeStamp(), phyloPUrls,
conservationFolder.resolve("phyloPVersion.json"));
}
if (assembly.equalsIgnoreCase("GRCh38")) {
String url = configuration.getDownload().getConservation().getHost() + "/hg38";
List<String> phastconsUrls = new ArrayList<>(chromosomes.length);
List<String> phyloPUrls = new ArrayList<>(chromosomes.length);
for (int i = 0; i < chromosomes.length; i++) {
String phastConsUrl = url + "/phastCons100way/hg38.100way.phastCons/chr" + chromosomes[i]
+ ".phastCons100way.wigFix.gz";
downloadFile(phastConsUrl, conservationFolder.resolve("phastCons").resolve("chr" + chromosomes[i]
+ ".phastCons100way.wigFix.gz").toString());
phastconsUrls.add(phastConsUrl);
String phyloPUrl = url + "/phyloP100way/hg38.100way.phyloP100way/chr" + chromosomes[i] + ".phyloP100way.wigFix.gz";
downloadFile(phyloPUrl, conservationFolder.resolve("phylop").resolve("chr" + chromosomes[i]
+ ".phyloP100way.wigFix.gz").toString());
phyloPUrls.add(phyloPUrl);
}
saveVersionData(EtlCommons.CONSERVATION_DATA, PHASTCONS_NAME, null, getTimeStamp(), phastconsUrls,
conservationFolder.resolve("phastConsVersion.json"));
saveVersionData(EtlCommons.CONSERVATION_DATA, PHYLOP_NAME, null, getTimeStamp(), phyloPUrls,
conservationFolder.resolve("phyloPVersion.json"));
// String phastConsUrl = url + "/phastCons7way/hg38.phastCons100way.wigFix.gz";
// Path outFile = conservationFolder.resolve("phastCons").resolve("hg38.phastCons100way.wigFix.gz");
// downloadFile(phastConsUrl, outFile.toString());
//
// String phyloPUrl = url + "/phyloP7way/hg38.phyloP100way.wigFix.gz";
// outFile = conservationFolder.resolve("phylop").resolve("hg38.phyloP100way.wigFix.gz");
// downloadFile(phyloPUrl, outFile.toString());
}
}
if (species.getScientificName().equals("Mus musculus")) {
makeDir(conservationFolder);
makeDir(conservationFolder.resolve("phastCons"));
makeDir(conservationFolder.resolve("phylop"));
String url = configuration.getDownload().getConservation().getHost() + "/mm10";
String[] chromosomes = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14",
"15", "16", "17", "18", "19", "X", "Y", "M", };
List<String> phastconsUrls = new ArrayList<>(chromosomes.length);
List<String> phyloPUrls = new ArrayList<>(chromosomes.length);
for (int i = 0; i < chromosomes.length; i++) {
String phastConsUrl = url + "/phastCons60way/mm10.60way.phastCons/chr" + chromosomes[i] + ".phastCons60way.wigFix.gz";
downloadFile(phastConsUrl, conservationFolder.resolve("phastCons").resolve("chr" + chromosomes[i]
+ ".phastCons60way.wigFix.gz").toString());
phastconsUrls.add(phastConsUrl);
String phyloPUrl = url + "/phyloP60way/mm10.60way.phyloP60way/chr" + chromosomes[i] + ".phyloP60way.wigFix.gz";
downloadFile(phyloPUrl, conservationFolder.resolve("phylop").resolve("chr" + chromosomes[i]
+ ".phyloP60way.wigFix.gz").toString());
phyloPUrls.add(phyloPUrl);
}
saveVersionData(EtlCommons.CONSERVATION_DATA, PHASTCONS_NAME, null, getTimeStamp(), phastconsUrls,
conservationFolder.resolve("phastConsVersion.json"));
saveVersionData(EtlCommons.CONSERVATION_DATA, PHYLOP_NAME, null, getTimeStamp(), phyloPUrls,
conservationFolder.resolve("phastConsVersion.json"));
}
} | class class_name[name] begin[{]
method[downloadConservation, return_type[void], modifier[private], parameter[species, assembly, speciesFolder]] begin[{]
call[logger.info, parameter[literal["Downloading conservation information ..."]]]
local_variable[type[Path], conservationFolder]
if[call[species.getScientificName, parameter[]]] begin[{]
call[.makeDir, parameter[member[.conservationFolder]]]
call[.makeDir, parameter[call[conservationFolder.resolve, parameter[literal["phastCons"]]]]]
call[.makeDir, parameter[call[conservationFolder.resolve, parameter[literal["phylop"]]]]]
call[.makeDir, parameter[call[conservationFolder.resolve, parameter[literal["gerp"]]]]]
local_variable[type[String], chromosomes]
if[call[assembly.equalsIgnoreCase, parameter[literal["GRCh37"]]]] begin[{]
call[logger.debug, parameter[literal["Downloading GERP++ ..."]]]
call[.downloadFile, parameter[call[configuration.getDownload, parameter[]], call[conservationFolder.resolve, parameter[binary_operation[binary_operation[member[EtlCommons.GERP_SUBDIRECTORY], +, literal["/"]], +, member[EtlCommons.GERP_FILE]]]]]]
call[.saveVersionData, parameter[member[EtlCommons.CONSERVATION_DATA], member[.GERP_NAME], literal[null], call[.getTimeStamp, parameter[]], call[Collections.singletonList, parameter[call[configuration.getDownload, parameter[]]]], call[conservationFolder.resolve, parameter[literal["gerpVersion.json"]]]]]
local_variable[type[String], url]
local_variable[type[List], phastconsUrls]
local_variable[type[List], phyloPUrls]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/phastCons46way/primates/chr"), operator=+), operandr=MemberReference(member=chromosomes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".phastCons46way.primates.wigFix.gz"), operator=+), name=phastConsUrl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=phastConsUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="phastCons")], member=resolve, postfix_operators=[], prefix_operators=[], qualifier=conservationFolder, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="chr"), operandr=MemberReference(member=chromosomes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".phastCons46way.primates.wigFix.gz"), operator=+)], member=resolve, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=downloadFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=phastConsUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=phastconsUrls, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/phyloP46way/primates/chr"), operator=+), operandr=MemberReference(member=chromosomes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".phyloP46way.primate.wigFix.gz"), operator=+), name=phyloPUrl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=phyloPUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="phylop")], member=resolve, postfix_operators=[], prefix_operators=[], qualifier=conservationFolder, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="chr"), operandr=MemberReference(member=chromosomes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".phyloP46way.primate.wigFix.gz"), operator=+)], member=resolve, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=downloadFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=phyloPUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=phyloPUrls, 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=chromosomes, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[.saveVersionData, parameter[member[EtlCommons.CONSERVATION_DATA], member[.PHASTCONS_NAME], literal[null], call[.getTimeStamp, parameter[]], member[.phastconsUrls], call[conservationFolder.resolve, parameter[literal["phastConsVersion.json"]]]]]
call[.saveVersionData, parameter[member[EtlCommons.CONSERVATION_DATA], member[.PHYLOP_NAME], literal[null], call[.getTimeStamp, parameter[]], member[.phyloPUrls], call[conservationFolder.resolve, parameter[literal["phyloPVersion.json"]]]]]
else begin[{]
None
end[}]
if[call[assembly.equalsIgnoreCase, parameter[literal["GRCh38"]]]] begin[{]
local_variable[type[String], url]
local_variable[type[List], phastconsUrls]
local_variable[type[List], phyloPUrls]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/phastCons100way/hg38.100way.phastCons/chr"), operator=+), operandr=MemberReference(member=chromosomes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".phastCons100way.wigFix.gz"), operator=+), name=phastConsUrl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=phastConsUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="phastCons")], member=resolve, postfix_operators=[], prefix_operators=[], qualifier=conservationFolder, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="chr"), operandr=MemberReference(member=chromosomes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".phastCons100way.wigFix.gz"), operator=+)], member=resolve, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=downloadFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=phastConsUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=phastconsUrls, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/phyloP100way/hg38.100way.phyloP100way/chr"), operator=+), operandr=MemberReference(member=chromosomes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".phyloP100way.wigFix.gz"), operator=+), name=phyloPUrl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=phyloPUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="phylop")], member=resolve, postfix_operators=[], prefix_operators=[], qualifier=conservationFolder, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="chr"), operandr=MemberReference(member=chromosomes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".phyloP100way.wigFix.gz"), operator=+)], member=resolve, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=downloadFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=phyloPUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=phyloPUrls, 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=chromosomes, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[.saveVersionData, parameter[member[EtlCommons.CONSERVATION_DATA], member[.PHASTCONS_NAME], literal[null], call[.getTimeStamp, parameter[]], member[.phastconsUrls], call[conservationFolder.resolve, parameter[literal["phastConsVersion.json"]]]]]
call[.saveVersionData, parameter[member[EtlCommons.CONSERVATION_DATA], member[.PHYLOP_NAME], literal[null], call[.getTimeStamp, parameter[]], member[.phyloPUrls], call[conservationFolder.resolve, parameter[literal["phyloPVersion.json"]]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[call[species.getScientificName, parameter[]]] begin[{]
call[.makeDir, parameter[member[.conservationFolder]]]
call[.makeDir, parameter[call[conservationFolder.resolve, parameter[literal["phastCons"]]]]]
call[.makeDir, parameter[call[conservationFolder.resolve, parameter[literal["phylop"]]]]]
local_variable[type[String], url]
local_variable[type[String], chromosomes]
local_variable[type[List], phastconsUrls]
local_variable[type[List], phyloPUrls]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/phastCons60way/mm10.60way.phastCons/chr"), operator=+), operandr=MemberReference(member=chromosomes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".phastCons60way.wigFix.gz"), operator=+), name=phastConsUrl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=phastConsUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="phastCons")], member=resolve, postfix_operators=[], prefix_operators=[], qualifier=conservationFolder, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="chr"), operandr=MemberReference(member=chromosomes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".phastCons60way.wigFix.gz"), operator=+)], member=resolve, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=downloadFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=phastConsUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=phastconsUrls, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/phyloP60way/mm10.60way.phyloP60way/chr"), operator=+), operandr=MemberReference(member=chromosomes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".phyloP60way.wigFix.gz"), operator=+), name=phyloPUrl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=phyloPUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="phylop")], member=resolve, postfix_operators=[], prefix_operators=[], qualifier=conservationFolder, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="chr"), operandr=MemberReference(member=chromosomes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".phyloP60way.wigFix.gz"), operator=+)], member=resolve, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=downloadFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=phyloPUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=phyloPUrls, 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=chromosomes, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[.saveVersionData, parameter[member[EtlCommons.CONSERVATION_DATA], member[.PHASTCONS_NAME], literal[null], call[.getTimeStamp, parameter[]], member[.phastconsUrls], call[conservationFolder.resolve, parameter[literal["phastConsVersion.json"]]]]]
call[.saveVersionData, parameter[member[EtlCommons.CONSERVATION_DATA], member[.PHYLOP_NAME], literal[null], call[.getTimeStamp, parameter[]], member[.phyloPUrls], call[conservationFolder.resolve, parameter[literal["phastConsVersion.json"]]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[downloadConservation] operator[SEP] identifier[Species] identifier[species] , identifier[String] identifier[assembly] , identifier[Path] identifier[speciesFolder] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] {
identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Path] identifier[conservationFolder] operator[=] identifier[speciesFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[species] operator[SEP] identifier[getScientificName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[makeDir] operator[SEP] identifier[conservationFolder] operator[SEP] operator[SEP] identifier[makeDir] operator[SEP] identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[makeDir] operator[SEP] identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[makeDir] operator[SEP] identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[chromosomes] operator[=] {
literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] ,
} operator[SEP] Keyword[if] operator[SEP] identifier[assembly] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[downloadFile] operator[SEP] identifier[configuration] operator[SEP] identifier[getDownload] operator[SEP] operator[SEP] operator[SEP] identifier[getGerp] operator[SEP] operator[SEP] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] , identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] identifier[EtlCommons] operator[SEP] identifier[GERP_SUBDIRECTORY] operator[+] literal[String] operator[+] identifier[EtlCommons] operator[SEP] identifier[GERP_FILE] operator[SEP] operator[SEP] identifier[toAbsolutePath] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[saveVersionData] operator[SEP] identifier[EtlCommons] operator[SEP] identifier[CONSERVATION_DATA] , identifier[GERP_NAME] , Other[null] , identifier[getTimeStamp] operator[SEP] operator[SEP] , identifier[Collections] operator[SEP] identifier[singletonList] operator[SEP] identifier[configuration] operator[SEP] identifier[getDownload] operator[SEP] operator[SEP] operator[SEP] identifier[getGerp] operator[SEP] operator[SEP] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[SEP] , identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[url] operator[=] identifier[configuration] operator[SEP] identifier[getDownload] operator[SEP] operator[SEP] operator[SEP] identifier[getConservation] operator[SEP] operator[SEP] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[phastconsUrls] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[chromosomes] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[phyloPUrls] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[chromosomes] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[chromosomes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[String] identifier[phastConsUrl] operator[=] identifier[url] operator[+] literal[String] operator[+] identifier[chromosomes] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP] identifier[downloadFile] operator[SEP] identifier[phastConsUrl] , identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[+] identifier[chromosomes] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[phastconsUrls] operator[SEP] identifier[add] operator[SEP] identifier[phastConsUrl] operator[SEP] operator[SEP] identifier[String] identifier[phyloPUrl] operator[=] identifier[url] operator[+] literal[String] operator[+] identifier[chromosomes] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP] identifier[downloadFile] operator[SEP] identifier[phyloPUrl] , identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[+] identifier[chromosomes] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[phyloPUrls] operator[SEP] identifier[add] operator[SEP] identifier[phyloPUrl] operator[SEP] operator[SEP]
}
identifier[saveVersionData] operator[SEP] identifier[EtlCommons] operator[SEP] identifier[CONSERVATION_DATA] , identifier[PHASTCONS_NAME] , Other[null] , identifier[getTimeStamp] operator[SEP] operator[SEP] , identifier[phastconsUrls] , identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[saveVersionData] operator[SEP] identifier[EtlCommons] operator[SEP] identifier[CONSERVATION_DATA] , identifier[PHYLOP_NAME] , Other[null] , identifier[getTimeStamp] operator[SEP] operator[SEP] , identifier[phyloPUrls] , identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[assembly] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[String] identifier[url] operator[=] identifier[configuration] operator[SEP] identifier[getDownload] operator[SEP] operator[SEP] operator[SEP] identifier[getConservation] operator[SEP] operator[SEP] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[phastconsUrls] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[chromosomes] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[phyloPUrls] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[chromosomes] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[chromosomes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[String] identifier[phastConsUrl] operator[=] identifier[url] operator[+] literal[String] operator[+] identifier[chromosomes] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP] identifier[downloadFile] operator[SEP] identifier[phastConsUrl] , identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[+] identifier[chromosomes] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[phastconsUrls] operator[SEP] identifier[add] operator[SEP] identifier[phastConsUrl] operator[SEP] operator[SEP] identifier[String] identifier[phyloPUrl] operator[=] identifier[url] operator[+] literal[String] operator[+] identifier[chromosomes] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP] identifier[downloadFile] operator[SEP] identifier[phyloPUrl] , identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[+] identifier[chromosomes] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[phyloPUrls] operator[SEP] identifier[add] operator[SEP] identifier[phyloPUrl] operator[SEP] operator[SEP]
}
identifier[saveVersionData] operator[SEP] identifier[EtlCommons] operator[SEP] identifier[CONSERVATION_DATA] , identifier[PHASTCONS_NAME] , Other[null] , identifier[getTimeStamp] operator[SEP] operator[SEP] , identifier[phastconsUrls] , identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[saveVersionData] operator[SEP] identifier[EtlCommons] operator[SEP] identifier[CONSERVATION_DATA] , identifier[PHYLOP_NAME] , Other[null] , identifier[getTimeStamp] operator[SEP] operator[SEP] , identifier[phyloPUrls] , identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[species] operator[SEP] identifier[getScientificName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[makeDir] operator[SEP] identifier[conservationFolder] operator[SEP] operator[SEP] identifier[makeDir] operator[SEP] identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[makeDir] operator[SEP] identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[url] operator[=] identifier[configuration] operator[SEP] identifier[getDownload] operator[SEP] operator[SEP] operator[SEP] identifier[getConservation] operator[SEP] operator[SEP] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[chromosomes] operator[=] {
literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] ,
} operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[phastconsUrls] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[chromosomes] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[phyloPUrls] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[chromosomes] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[chromosomes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[String] identifier[phastConsUrl] operator[=] identifier[url] operator[+] literal[String] operator[+] identifier[chromosomes] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP] identifier[downloadFile] operator[SEP] identifier[phastConsUrl] , identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[+] identifier[chromosomes] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[phastconsUrls] operator[SEP] identifier[add] operator[SEP] identifier[phastConsUrl] operator[SEP] operator[SEP] identifier[String] identifier[phyloPUrl] operator[=] identifier[url] operator[+] literal[String] operator[+] identifier[chromosomes] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP] identifier[downloadFile] operator[SEP] identifier[phyloPUrl] , identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[+] identifier[chromosomes] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[phyloPUrls] operator[SEP] identifier[add] operator[SEP] identifier[phyloPUrl] operator[SEP] operator[SEP]
}
identifier[saveVersionData] operator[SEP] identifier[EtlCommons] operator[SEP] identifier[CONSERVATION_DATA] , identifier[PHASTCONS_NAME] , Other[null] , identifier[getTimeStamp] operator[SEP] operator[SEP] , identifier[phastconsUrls] , identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[saveVersionData] operator[SEP] identifier[EtlCommons] operator[SEP] identifier[CONSERVATION_DATA] , identifier[PHYLOP_NAME] , Other[null] , identifier[getTimeStamp] operator[SEP] operator[SEP] , identifier[phyloPUrls] , identifier[conservationFolder] operator[SEP] identifier[resolve] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
|
protected List<ExtensionComponent<T>> load() {
LOGGER.fine(() -> String.format("Loading ExtensionList '%s'", extensionType.getName()));
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.log(Level.FINER, String.format("Loading ExtensionList '%s' from", extensionType.getName()), new Throwable("Only present for stacktrace information"));
}
return jenkins.getPluginManager().getPluginStrategy().findComponents(extensionType, hudson);
} | class class_name[name] begin[{]
method[load, return_type[type[List]], modifier[protected], parameter[]] begin[{]
call[LOGGER.fine, parameter[LambdaExpression(body=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Loading ExtensionList '%s'"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=extensionType, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), parameters=[])]]
if[call[LOGGER.isLoggable, parameter[member[Level.FINER]]]] begin[{]
call[LOGGER.log, parameter[member[Level.FINER], call[String.format, parameter[literal["Loading ExtensionList '%s' from"], call[extensionType.getName, parameter[]]]], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Only present for stacktrace information")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Throwable, sub_type=None))]]
else begin[{]
None
end[}]
return[call[jenkins.getPluginManager, parameter[]]]
end[}]
END[}] | Keyword[protected] identifier[List] operator[<] identifier[ExtensionComponent] operator[<] identifier[T] operator[>] operator[>] identifier[load] operator[SEP] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[fine] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[extensionType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINER] operator[SEP] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINER] , identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[extensionType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] , Keyword[new] identifier[Throwable] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[jenkins] operator[SEP] identifier[getPluginManager] operator[SEP] operator[SEP] operator[SEP] identifier[getPluginStrategy] operator[SEP] operator[SEP] operator[SEP] identifier[findComponents] operator[SEP] identifier[extensionType] , identifier[hudson] operator[SEP] operator[SEP]
}
|
@Override
public void cacheResult(List<CommerceRegion> commerceRegions) {
for (CommerceRegion commerceRegion : commerceRegions) {
if (entityCache.getResult(
CommerceRegionModelImpl.ENTITY_CACHE_ENABLED,
CommerceRegionImpl.class, commerceRegion.getPrimaryKey()) == null) {
cacheResult(commerceRegion);
}
else {
commerceRegion.resetOriginalValues();
}
}
} | class class_name[name] begin[{]
method[cacheResult, return_type[void], modifier[public], parameter[commerceRegions]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ENTITY_CACHE_ENABLED, postfix_operators=[], prefix_operators=[], qualifier=CommerceRegionModelImpl, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommerceRegionImpl, sub_type=None)), MethodInvocation(arguments=[], member=getPrimaryKey, postfix_operators=[], prefix_operators=[], qualifier=commerceRegion, selectors=[], type_arguments=None)], member=getResult, postfix_operators=[], prefix_operators=[], qualifier=entityCache, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=resetOriginalValues, postfix_operators=[], prefix_operators=[], qualifier=commerceRegion, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=commerceRegion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cacheResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=commerceRegions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=commerceRegion)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommerceRegion, sub_type=None))), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[cacheResult] operator[SEP] identifier[List] operator[<] identifier[CommerceRegion] operator[>] identifier[commerceRegions] operator[SEP] {
Keyword[for] operator[SEP] identifier[CommerceRegion] identifier[commerceRegion] operator[:] identifier[commerceRegions] operator[SEP] {
Keyword[if] operator[SEP] identifier[entityCache] operator[SEP] identifier[getResult] operator[SEP] identifier[CommerceRegionModelImpl] operator[SEP] identifier[ENTITY_CACHE_ENABLED] , identifier[CommerceRegionImpl] operator[SEP] Keyword[class] , identifier[commerceRegion] operator[SEP] identifier[getPrimaryKey] operator[SEP] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[cacheResult] operator[SEP] identifier[commerceRegion] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[commerceRegion] operator[SEP] identifier[resetOriginalValues] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public FessMessages addErrorsLoginFailure(String property) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_LOGIN_FAILURE));
return this;
} | class class_name[name] begin[{]
method[addErrorsLoginFailure, return_type[type[FessMessages]], modifier[public], parameter[property]] begin[{]
call[.assertPropertyNotNull, parameter[member[.property]]]
call[.add, parameter[member[.property], ClassCreator(arguments=[MemberReference(member=ERRORS_LOGIN_FAILURE, 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=UserMessage, sub_type=None))]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[FessMessages] identifier[addErrorsLoginFailure] operator[SEP] identifier[String] identifier[property] operator[SEP] {
identifier[assertPropertyNotNull] operator[SEP] identifier[property] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[property] , Keyword[new] identifier[UserMessage] operator[SEP] identifier[ERRORS_LOGIN_FAILURE] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public EEnum getIfcTransportElementTypeEnum() {
if (ifcTransportElementTypeEnumEEnum == null) {
ifcTransportElementTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(920);
}
return ifcTransportElementTypeEnumEEnum;
} | class class_name[name] begin[{]
method[getIfcTransportElementTypeEnum, return_type[type[EEnum]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcTransportElementTypeEnumEEnum], ==, literal[null]]] begin[{]
assign[member[.ifcTransportElementTypeEnumEEnum], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=920)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EEnum, sub_type=None))]
else begin[{]
None
end[}]
return[member[.ifcTransportElementTypeEnumEEnum]]
end[}]
END[}] | Keyword[public] identifier[EEnum] identifier[getIfcTransportElementTypeEnum] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcTransportElementTypeEnumEEnum] operator[==] Other[null] operator[SEP] {
identifier[ifcTransportElementTypeEnumEEnum] operator[=] operator[SEP] identifier[EEnum] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[920] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcTransportElementTypeEnumEEnum] operator[SEP]
}
|
protected void entity() {
nextChar();
String name = null;
if (ch == '#') {
int namep = bp;
nextChar();
if (isDecimalDigit(ch)) {
nextChar();
while (isDecimalDigit(ch))
nextChar();
name = new String(buf, namep, bp - namep);
} else if (ch == 'x' || ch == 'X') {
nextChar();
if (isHexDigit(ch)) {
nextChar();
while (isHexDigit(ch))
nextChar();
name = new String(buf, namep, bp - namep);
}
}
} else if (isIdentifierStart(ch)) {
name = readIdentifier();
}
if (name != null) {
if (ch != ';')
return;
nextChar();
}
} | class class_name[name] begin[{]
method[entity, return_type[void], modifier[protected], parameter[]] begin[{]
call[.nextChar, parameter[]]
local_variable[type[String], name]
if[binary_operation[member[.ch], ==, literal['#']]] begin[{]
local_variable[type[int], namep]
call[.nextChar, parameter[]]
if[call[.isDecimalDigit, parameter[member[.ch]]]] begin[{]
call[.nextChar, parameter[]]
while[call[.isDecimalDigit, parameter[member[.ch]]]] begin[{]
call[.nextChar, parameter[]]
end[}]
assign[member[.name], ClassCreator(arguments=[MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=namep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=bp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=namep, 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=String, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.ch], ==, literal['x']], ||, binary_operation[member[.ch], ==, literal['X']]]] begin[{]
call[.nextChar, parameter[]]
if[call[.isHexDigit, parameter[member[.ch]]]] begin[{]
call[.nextChar, parameter[]]
while[call[.isHexDigit, parameter[member[.ch]]]] begin[{]
call[.nextChar, parameter[]]
end[}]
assign[member[.name], ClassCreator(arguments=[MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=namep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=bp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=namep, 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=String, sub_type=None))]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
else begin[{]
if[call[.isIdentifierStart, parameter[member[.ch]]]] begin[{]
assign[member[.name], call[.readIdentifier, parameter[]]]
else begin[{]
None
end[}]
end[}]
if[binary_operation[member[.name], !=, literal[null]]] begin[{]
if[binary_operation[member[.ch], !=, literal[';']]] begin[{]
return[None]
else begin[{]
None
end[}]
call[.nextChar, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[entity] operator[SEP] operator[SEP] {
identifier[nextChar] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[==] literal[String] operator[SEP] {
Keyword[int] identifier[namep] operator[=] identifier[bp] operator[SEP] identifier[nextChar] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isDecimalDigit] operator[SEP] identifier[ch] operator[SEP] operator[SEP] {
identifier[nextChar] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[isDecimalDigit] operator[SEP] identifier[ch] operator[SEP] operator[SEP] identifier[nextChar] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[buf] , identifier[namep] , identifier[bp] operator[-] identifier[namep] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[ch] operator[==] literal[String] operator[||] identifier[ch] operator[==] literal[String] operator[SEP] {
identifier[nextChar] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isHexDigit] operator[SEP] identifier[ch] operator[SEP] operator[SEP] {
identifier[nextChar] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[isHexDigit] operator[SEP] identifier[ch] operator[SEP] operator[SEP] identifier[nextChar] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[buf] , identifier[namep] , identifier[bp] operator[-] identifier[namep] operator[SEP] operator[SEP]
}
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[isIdentifierStart] operator[SEP] identifier[ch] operator[SEP] operator[SEP] {
identifier[name] operator[=] identifier[readIdentifier] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[name] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[ch] operator[!=] literal[String] operator[SEP] Keyword[return] operator[SEP] identifier[nextChar] operator[SEP] operator[SEP] operator[SEP]
}
}
|
static void closeLink(CommsConnection conn) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "closeLink", conn);
conn.setSchemaSet(null);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "closeLink");
} | class class_name[name] begin[{]
method[closeLink, return_type[void], modifier[static], parameter[conn]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["closeLink"], member[.conn]]]
else begin[{]
None
end[}]
call[conn.setSchemaSet, parameter[literal[null]]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["closeLink"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[static] Keyword[void] identifier[closeLink] operator[SEP] identifier[CommsConnection] identifier[conn] 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[conn] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[setSchemaSet] operator[SEP] Other[null] 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]
}
|
private Object composeColumnValue(CqlMetadata cqlMetadata, byte[] thriftColumnValue, byte[] thriftColumnName) {
Map<ByteBuffer, String> schemaTypes = cqlMetadata.getValue_types();
AbstractType<?> type = null;
try {
type = TypeParser.parse(schemaTypes.get(ByteBuffer.wrap(thriftColumnName)));
} catch (SyntaxException | ConfigurationException ex) {
log.error(ex.getMessage());
throw new KunderaException("Error while deserializing column value " + ex);
}
if (type.isCollection()) {
return ((CollectionSerializer) type.getSerializer())
.deserializeForNativeProtocol(ByteBuffer.wrap(thriftColumnValue), ProtocolVersion.V2);
}
return type.compose(ByteBuffer.wrap(thriftColumnValue));
} | class class_name[name] begin[{]
method[composeColumnValue, return_type[type[Object]], modifier[private], parameter[cqlMetadata, thriftColumnValue, thriftColumnName]] begin[{]
local_variable[type[Map], schemaTypes]
local_variable[type[AbstractType], type]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=thriftColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=ByteBuffer, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=schemaTypes, selectors=[], type_arguments=None)], member=parse, postfix_operators=[], prefix_operators=[], qualifier=TypeParser, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while deserializing column value "), operandr=MemberReference(member=ex, 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=KunderaException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SyntaxException', 'ConfigurationException']))], finally_block=None, label=None, resources=None)
if[call[type.isCollection, parameter[]]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[], member=getSerializer, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CollectionSerializer, sub_type=None))]
else begin[{]
None
end[}]
return[call[type.compose, parameter[call[ByteBuffer.wrap, parameter[member[.thriftColumnValue]]]]]]
end[}]
END[}] | Keyword[private] identifier[Object] identifier[composeColumnValue] operator[SEP] identifier[CqlMetadata] identifier[cqlMetadata] , Keyword[byte] operator[SEP] operator[SEP] identifier[thriftColumnValue] , Keyword[byte] operator[SEP] operator[SEP] identifier[thriftColumnName] operator[SEP] {
identifier[Map] operator[<] identifier[ByteBuffer] , identifier[String] operator[>] identifier[schemaTypes] operator[=] identifier[cqlMetadata] operator[SEP] identifier[getValue_types] operator[SEP] operator[SEP] operator[SEP] identifier[AbstractType] operator[<] operator[?] operator[>] identifier[type] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[type] operator[=] identifier[TypeParser] operator[SEP] identifier[parse] operator[SEP] identifier[schemaTypes] operator[SEP] identifier[get] operator[SEP] identifier[ByteBuffer] operator[SEP] identifier[wrap] operator[SEP] identifier[thriftColumnName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SyntaxException] operator[|] identifier[ConfigurationException] identifier[ex] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[KunderaException] operator[SEP] literal[String] operator[+] identifier[ex] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[isCollection] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[CollectionSerializer] operator[SEP] identifier[type] operator[SEP] identifier[getSerializer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[deserializeForNativeProtocol] operator[SEP] identifier[ByteBuffer] operator[SEP] identifier[wrap] operator[SEP] identifier[thriftColumnValue] operator[SEP] , identifier[ProtocolVersion] operator[SEP] identifier[V2] operator[SEP] operator[SEP]
}
Keyword[return] identifier[type] operator[SEP] identifier[compose] operator[SEP] identifier[ByteBuffer] operator[SEP] identifier[wrap] operator[SEP] identifier[thriftColumnValue] operator[SEP] operator[SEP] operator[SEP]
}
|
@Nullable
public static BigDecimal parseBigDecimal (@Nullable final String sStr,
@Nonnegative final int nScale,
@Nonnull final RoundingMode eRoundingMode)
{
return parseBigDecimal (sStr, nScale, eRoundingMode, null);
} | class class_name[name] begin[{]
method[parseBigDecimal, return_type[type[BigDecimal]], modifier[public static], parameter[sStr, nScale, eRoundingMode]] begin[{]
return[call[.parseBigDecimal, parameter[member[.sStr], member[.nScale], member[.eRoundingMode], literal[null]]]]
end[}]
END[}] | annotation[@] identifier[Nullable] Keyword[public] Keyword[static] identifier[BigDecimal] identifier[parseBigDecimal] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[String] identifier[sStr] , annotation[@] identifier[Nonnegative] Keyword[final] Keyword[int] identifier[nScale] , annotation[@] identifier[Nonnull] Keyword[final] identifier[RoundingMode] identifier[eRoundingMode] operator[SEP] {
Keyword[return] identifier[parseBigDecimal] operator[SEP] identifier[sStr] , identifier[nScale] , identifier[eRoundingMode] , Other[null] operator[SEP] operator[SEP]
}
|
public Hop withParameter(String name, Object value) {
Assert.hasText(name, "Name must not be null or empty!");
HashMap<String, Object> parameters = new HashMap<>(this.parameters);
parameters.put(name, value);
return new Hop(this.rel, parameters, this.headers);
} | class class_name[name] begin[{]
method[withParameter, return_type[type[Hop]], modifier[public], parameter[name, value]] begin[{]
call[Assert.hasText, parameter[member[.name], literal["Name must not be null or empty!"]]]
local_variable[type[HashMap], parameters]
call[parameters.put, parameter[member[.name], member[.value]]]
return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=rel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=headers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Hop, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[Hop] identifier[withParameter] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[value] operator[SEP] {
identifier[Assert] operator[SEP] identifier[hasText] operator[SEP] identifier[name] , literal[String] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[parameters] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] Keyword[this] operator[SEP] identifier[parameters] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Hop] operator[SEP] Keyword[this] operator[SEP] identifier[rel] , identifier[parameters] , Keyword[this] operator[SEP] identifier[headers] operator[SEP] operator[SEP]
}
|
public ListenableFuture<Results> verify(Iterable<Dataset> datasets) {
return this.exeSvc.submit(getRunner(datasets));
} | class class_name[name] begin[{]
method[verify, return_type[type[ListenableFuture]], modifier[public], parameter[datasets]] begin[{]
return[THIS[member[None.exeSvc]call[None.submit, parameter[call[.getRunner, parameter[member[.datasets]]]]]]]
end[}]
END[}] | Keyword[public] identifier[ListenableFuture] operator[<] identifier[Results] operator[>] identifier[verify] operator[SEP] identifier[Iterable] operator[<] identifier[Dataset] operator[>] identifier[datasets] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[exeSvc] operator[SEP] identifier[submit] operator[SEP] identifier[getRunner] operator[SEP] identifier[datasets] operator[SEP] operator[SEP] operator[SEP]
}
|
public static SparkValueFunction fromConfig(Config config, String key) {
return fromPatternList(config.getConfigList(key));
} | class class_name[name] begin[{]
method[fromConfig, return_type[type[SparkValueFunction]], modifier[public static], parameter[config, key]] begin[{]
return[call[.fromPatternList, parameter[call[config.getConfigList, parameter[member[.key]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[SparkValueFunction] identifier[fromConfig] operator[SEP] identifier[Config] identifier[config] , identifier[String] identifier[key] operator[SEP] {
Keyword[return] identifier[fromPatternList] operator[SEP] identifier[config] operator[SEP] identifier[getConfigList] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP]
}
|
public boolean setPosition(float position) {
if (playing) {
requiredPosition = -1;
positioning = true;
playing = false;
boolean result = sound.setPosition(position);
playing = true;
positioning = false;
return result;
} else {
requiredPosition = position;
return false;
}
} | class class_name[name] begin[{]
method[setPosition, return_type[type[boolean]], modifier[public], parameter[position]] begin[{]
if[member[.playing]] begin[{]
assign[member[.requiredPosition], literal[1]]
assign[member[.positioning], literal[true]]
assign[member[.playing], literal[false]]
local_variable[type[boolean], result]
assign[member[.playing], literal[true]]
assign[member[.positioning], literal[false]]
return[member[.result]]
else begin[{]
assign[member[.requiredPosition], member[.position]]
return[literal[false]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[setPosition] operator[SEP] Keyword[float] identifier[position] operator[SEP] {
Keyword[if] operator[SEP] identifier[playing] operator[SEP] {
identifier[requiredPosition] operator[=] operator[-] Other[1] operator[SEP] identifier[positioning] operator[=] literal[boolean] operator[SEP] identifier[playing] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[result] operator[=] identifier[sound] operator[SEP] identifier[setPosition] operator[SEP] identifier[position] operator[SEP] operator[SEP] identifier[playing] operator[=] literal[boolean] operator[SEP] identifier[positioning] operator[=] literal[boolean] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
Keyword[else] {
identifier[requiredPosition] operator[=] identifier[position] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
}
|
public void setDiscoveredResourceList(java.util.Collection<DiscoveredResource> discoveredResourceList) {
if (discoveredResourceList == null) {
this.discoveredResourceList = null;
return;
}
this.discoveredResourceList = new java.util.ArrayList<DiscoveredResource>(discoveredResourceList);
} | class class_name[name] begin[{]
method[setDiscoveredResourceList, return_type[void], modifier[public], parameter[discoveredResourceList]] begin[{]
if[binary_operation[member[.discoveredResourceList], ==, literal[null]]] begin[{]
assign[THIS[member[None.discoveredResourceList]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.discoveredResourceList]], ClassCreator(arguments=[MemberReference(member=discoveredResourceList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DiscoveredResource, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setDiscoveredResourceList] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[DiscoveredResource] operator[>] identifier[discoveredResourceList] operator[SEP] {
Keyword[if] operator[SEP] identifier[discoveredResourceList] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[discoveredResourceList] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[discoveredResourceList] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[DiscoveredResource] operator[>] operator[SEP] identifier[discoveredResourceList] operator[SEP] operator[SEP]
}
|
public void log(String msg) {
if (theLog != null) {
theLog.println(msg);
} else {
System.err.println(msg);
}
} | class class_name[name] begin[{]
method[log, return_type[void], modifier[public], parameter[msg]] begin[{]
if[binary_operation[member[.theLog], !=, literal[null]]] begin[{]
call[theLog.println, parameter[member[.msg]]]
else begin[{]
call[System.err.println, parameter[member[.msg]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[log] operator[SEP] identifier[String] identifier[msg] operator[SEP] {
Keyword[if] operator[SEP] identifier[theLog] operator[!=] Other[null] operator[SEP] {
identifier[theLog] operator[SEP] identifier[println] operator[SEP] identifier[msg] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] identifier[msg] operator[SEP] operator[SEP]
}
}
|
public Object getFirst(String name) {
Object value = get(name);
if (value instanceof Collection<?>) {
@SuppressWarnings("unchecked")
Collection<Object> collectionValue = (Collection<Object>) value;
Iterator<Object> iterator = collectionValue.iterator();
return iterator.hasNext() ? iterator.next() : null;
}
return value;
} | class class_name[name] begin[{]
method[getFirst, return_type[type[Object]], modifier[public], parameter[name]] begin[{]
local_variable[type[Object], value]
if[binary_operation[member[.value], instanceof, type[Collection]]] begin[{]
local_variable[type[Collection], collectionValue]
local_variable[type[Iterator], iterator]
return[TernaryExpression(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None))]
else begin[{]
None
end[}]
return[member[.value]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[getFirst] operator[SEP] identifier[String] identifier[name] operator[SEP] {
identifier[Object] identifier[value] operator[=] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Collection] operator[<] operator[?] operator[>] operator[SEP] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Collection] operator[<] identifier[Object] operator[>] identifier[collectionValue] operator[=] operator[SEP] identifier[Collection] operator[<] identifier[Object] operator[>] operator[SEP] identifier[value] operator[SEP] identifier[Iterator] operator[<] identifier[Object] operator[>] identifier[iterator] operator[=] identifier[collectionValue] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[?] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP]
}
Keyword[return] identifier[value] operator[SEP]
}
|
public static BooleanCliParam fromDef(BooleanParamDef def) {
return new BooleanCliParam(def.getIdentifier(), def.getDefaultValueSupplier(), def.isNullable());
} | class class_name[name] begin[{]
method[fromDef, return_type[type[BooleanCliParam]], modifier[public static], parameter[def]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getIdentifier, postfix_operators=[], prefix_operators=[], qualifier=def, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getDefaultValueSupplier, postfix_operators=[], prefix_operators=[], qualifier=def, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=isNullable, postfix_operators=[], prefix_operators=[], qualifier=def, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BooleanCliParam, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[BooleanCliParam] identifier[fromDef] operator[SEP] identifier[BooleanParamDef] identifier[def] operator[SEP] {
Keyword[return] Keyword[new] identifier[BooleanCliParam] operator[SEP] identifier[def] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] , identifier[def] operator[SEP] identifier[getDefaultValueSupplier] operator[SEP] operator[SEP] , identifier[def] operator[SEP] identifier[isNullable] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public QueryParams buildQueryParams(QueryParamsParserContext context) {
try {
return queryParamsParser.parse(context);
} catch (KatharsisException e) {
throw e;
} catch (RuntimeException e) {
throw new ParametersDeserializationException(e.getMessage(), e);
}
} | class class_name[name] begin[{]
method[buildQueryParams, return_type[type[QueryParams]], modifier[public], parameter[context]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=queryParamsParser, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['KatharsisException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), 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=ParametersDeserializationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RuntimeException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[QueryParams] identifier[buildQueryParams] operator[SEP] identifier[QueryParamsParserContext] identifier[context] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[queryParamsParser] operator[SEP] identifier[parse] operator[SEP] identifier[context] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[KatharsisException] identifier[e] operator[SEP] {
Keyword[throw] identifier[e] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RuntimeException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ParametersDeserializationException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public Closeable onSubscribeChannelEvent(final Consumer<BitfinexStreamSymbol> listener) {
subscribeChannelConsumers.offer(listener);
return () -> subscribeChannelConsumers.remove(listener);
} | class class_name[name] begin[{]
method[onSubscribeChannelEvent, return_type[type[Closeable]], modifier[public], parameter[listener]] begin[{]
call[subscribeChannelConsumers.offer, parameter[member[.listener]]]
return[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=listener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=subscribeChannelConsumers, selectors=[], type_arguments=None), parameters=[])]
end[}]
END[}] | Keyword[public] identifier[Closeable] identifier[onSubscribeChannelEvent] operator[SEP] Keyword[final] identifier[Consumer] operator[<] identifier[BitfinexStreamSymbol] operator[>] identifier[listener] operator[SEP] {
identifier[subscribeChannelConsumers] operator[SEP] identifier[offer] operator[SEP] identifier[listener] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] operator[->] identifier[subscribeChannelConsumers] operator[SEP] identifier[remove] operator[SEP] identifier[listener] operator[SEP] operator[SEP]
}
|
public static pqpolicy get(nitro_service service, String policyname) throws Exception{
pqpolicy obj = new pqpolicy();
obj.set_policyname(policyname);
pqpolicy response = (pqpolicy) obj.get_resource(service);
return response;
} | class class_name[name] begin[{]
method[get, return_type[type[pqpolicy]], modifier[public static], parameter[service, policyname]] begin[{]
local_variable[type[pqpolicy], obj]
call[obj.set_policyname, parameter[member[.policyname]]]
local_variable[type[pqpolicy], response]
return[member[.response]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[pqpolicy] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[policyname] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[pqpolicy] identifier[obj] operator[=] Keyword[new] identifier[pqpolicy] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_policyname] operator[SEP] identifier[policyname] operator[SEP] operator[SEP] identifier[pqpolicy] identifier[response] operator[=] operator[SEP] identifier[pqpolicy] operator[SEP] identifier[obj] operator[SEP] identifier[get_resource] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP]
}
|
public static Geometry geometryFromWkt(String wkt, int importFlags,
Geometry.Type geometryType) {
OperatorImportFromWkt op = (OperatorImportFromWkt) factory
.getOperator(Operator.Type.ImportFromWkt);
return op.execute(importFlags, geometryType, wkt, null);
} | class class_name[name] begin[{]
method[geometryFromWkt, return_type[type[Geometry]], modifier[public static], parameter[wkt, importFlags, geometryType]] begin[{]
local_variable[type[OperatorImportFromWkt], op]
return[call[op.execute, parameter[member[.importFlags], member[.geometryType], member[.wkt], literal[null]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Geometry] identifier[geometryFromWkt] operator[SEP] identifier[String] identifier[wkt] , Keyword[int] identifier[importFlags] , identifier[Geometry] operator[SEP] identifier[Type] identifier[geometryType] operator[SEP] {
identifier[OperatorImportFromWkt] identifier[op] operator[=] operator[SEP] identifier[OperatorImportFromWkt] operator[SEP] identifier[factory] operator[SEP] identifier[getOperator] operator[SEP] identifier[Operator] operator[SEP] identifier[Type] operator[SEP] identifier[ImportFromWkt] operator[SEP] operator[SEP] Keyword[return] identifier[op] operator[SEP] identifier[execute] operator[SEP] identifier[importFlags] , identifier[geometryType] , identifier[wkt] , Other[null] operator[SEP] operator[SEP]
}
|
public static void main(String arg[]) {
UtmProjection utm = new UtmProjection(17, true);
LatLonPoint ll = utm.projToLatLon(577.8000000000001, 2951.8);
System.out.printf("%15.12f %15.12f%n", ll.getLatitude(), ll.getLongitude());
assert Misc.nearlyEquals(ll.getLongitude(), -80.21802662821469, 1.0e-8);
assert Misc.nearlyEquals(ll.getLatitude(), 26.685132668190793, 1.0e-8);
} | class class_name[name] begin[{]
method[main, return_type[void], modifier[public static], parameter[arg]] begin[{]
local_variable[type[UtmProjection], utm]
local_variable[type[LatLonPoint], ll]
call[System.out.printf, parameter[literal["%15.12f %15.12f%n"], call[ll.getLatitude, parameter[]], call[ll.getLongitude, parameter[]]]]
AssertStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLongitude, postfix_operators=[], prefix_operators=[], qualifier=ll, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=80.21802662821469), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0e-8)], member=nearlyEquals, postfix_operators=[], prefix_operators=[], qualifier=Misc, selectors=[], type_arguments=None), label=None, value=None)
AssertStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLatitude, postfix_operators=[], prefix_operators=[], qualifier=ll, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=26.685132668190793), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0e-8)], member=nearlyEquals, postfix_operators=[], prefix_operators=[], qualifier=Misc, selectors=[], type_arguments=None), label=None, value=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] identifier[arg] operator[SEP] operator[SEP] operator[SEP] {
identifier[UtmProjection] identifier[utm] operator[=] Keyword[new] identifier[UtmProjection] operator[SEP] Other[17] , literal[boolean] operator[SEP] operator[SEP] identifier[LatLonPoint] identifier[ll] operator[=] identifier[utm] operator[SEP] identifier[projToLatLon] operator[SEP] literal[Float] , literal[Float] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[ll] operator[SEP] identifier[getLatitude] operator[SEP] operator[SEP] , identifier[ll] operator[SEP] identifier[getLongitude] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] identifier[Misc] operator[SEP] identifier[nearlyEquals] operator[SEP] identifier[ll] operator[SEP] identifier[getLongitude] operator[SEP] operator[SEP] , operator[-] literal[Float] , literal[Float] operator[SEP] operator[SEP] Keyword[assert] identifier[Misc] operator[SEP] identifier[nearlyEquals] operator[SEP] identifier[ll] operator[SEP] identifier[getLatitude] operator[SEP] operator[SEP] , literal[Float] , literal[Float] operator[SEP] operator[SEP]
}
|
private String escape(String rawActivityName) {
boolean lastIsUnderScore = false;
StringBuffer sb = new StringBuffer();
for (int i=0; i<rawActivityName.length(); i++) {
char ch = rawActivityName.charAt(i);
if (Character.isLetterOrDigit(ch)) {
sb.append(ch);
lastIsUnderScore = false;
} else if (!lastIsUnderScore) {
sb.append(UNDERSCORE);
lastIsUnderScore = true;
}
}
return sb.toString();
} | class class_name[name] begin[{]
method[escape, return_type[type[String]], modifier[private], parameter[rawActivityName]] begin[{]
local_variable[type[boolean], lastIsUnderScore]
local_variable[type[StringBuffer], sb]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=rawActivityName, selectors=[], type_arguments=None), name=ch)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isLetterOrDigit, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MemberReference(member=lastIsUnderScore, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=UNDERSCORE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastIsUnderScore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastIsUnderScore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=rawActivityName, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[call[sb.toString, parameter[]]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[escape] operator[SEP] identifier[String] identifier[rawActivityName] operator[SEP] {
Keyword[boolean] identifier[lastIsUnderScore] operator[=] literal[boolean] operator[SEP] identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[rawActivityName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[char] identifier[ch] operator[=] identifier[rawActivityName] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isLetterOrDigit] operator[SEP] identifier[ch] operator[SEP] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[ch] operator[SEP] operator[SEP] identifier[lastIsUnderScore] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[lastIsUnderScore] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[UNDERSCORE] operator[SEP] operator[SEP] identifier[lastIsUnderScore] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static MultiTaskListener instance(Context context) {
MultiTaskListener instance = context.get(taskListenerKey);
if (instance == null)
instance = new MultiTaskListener(context);
return instance;
} | class class_name[name] begin[{]
method[instance, return_type[type[MultiTaskListener]], modifier[public static], parameter[context]] begin[{]
local_variable[type[MultiTaskListener], instance]
if[binary_operation[member[.instance], ==, literal[null]]] begin[{]
assign[member[.instance], ClassCreator(arguments=[MemberReference(member=context, 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=MultiTaskListener, sub_type=None))]
else begin[{]
None
end[}]
return[member[.instance]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[MultiTaskListener] identifier[instance] operator[SEP] identifier[Context] identifier[context] operator[SEP] {
identifier[MultiTaskListener] identifier[instance] operator[=] identifier[context] operator[SEP] identifier[get] operator[SEP] identifier[taskListenerKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[instance] operator[==] Other[null] operator[SEP] identifier[instance] operator[=] Keyword[new] identifier[MultiTaskListener] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[return] identifier[instance] operator[SEP]
}
|
private ParseTree parseThrowStatement() {
SourcePosition start = getTreeStartLocation();
eat(TokenType.THROW);
ParseTree value = null;
if (peekImplicitSemiColon()) {
reportError("semicolon/newline not allowed after 'throw'");
} else {
value = parseExpression();
}
eatPossibleImplicitSemiColon();
return new ThrowStatementTree(getTreeLocation(start), value);
} | class class_name[name] begin[{]
method[parseThrowStatement, return_type[type[ParseTree]], modifier[private], parameter[]] begin[{]
local_variable[type[SourcePosition], start]
call[.eat, parameter[member[TokenType.THROW]]]
local_variable[type[ParseTree], value]
if[call[.peekImplicitSemiColon, parameter[]]] begin[{]
call[.reportError, parameter[literal["semicolon/newline not allowed after 'throw'"]]]
else begin[{]
assign[member[.value], call[.parseExpression, parameter[]]]
end[}]
call[.eatPossibleImplicitSemiColon, parameter[]]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTreeLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), 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=ThrowStatementTree, sub_type=None))]
end[}]
END[}] | Keyword[private] identifier[ParseTree] identifier[parseThrowStatement] operator[SEP] operator[SEP] {
identifier[SourcePosition] identifier[start] operator[=] identifier[getTreeStartLocation] operator[SEP] operator[SEP] operator[SEP] identifier[eat] operator[SEP] identifier[TokenType] operator[SEP] identifier[THROW] operator[SEP] operator[SEP] identifier[ParseTree] identifier[value] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[peekImplicitSemiColon] operator[SEP] operator[SEP] operator[SEP] {
identifier[reportError] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[value] operator[=] identifier[parseExpression] operator[SEP] operator[SEP] operator[SEP]
}
identifier[eatPossibleImplicitSemiColon] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ThrowStatementTree] operator[SEP] identifier[getTreeLocation] operator[SEP] identifier[start] operator[SEP] , identifier[value] operator[SEP] operator[SEP]
}
|
private void rollback(Transaction txn, Exception cause) throws Exception {
try {
txn.rollback();
} catch (Exception e) {
logger.debug(e, "Error while rolling back transaction " + txn);
} finally {
throw cause;
}
} | class class_name[name] begin[{]
method[rollback, return_type[void], modifier[private], parameter[txn, cause]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=rollback, postfix_operators=[], prefix_operators=[], qualifier=txn, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while rolling back transaction "), operandr=MemberReference(member=txn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, 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=[ThrowStatement(expression=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[rollback] operator[SEP] identifier[Transaction] identifier[txn] , identifier[Exception] identifier[cause] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[try] {
identifier[txn] operator[SEP] identifier[rollback] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[e] , literal[String] operator[+] identifier[txn] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[throw] identifier[cause] operator[SEP]
}
}
|
public Coin getValueSentFromMe(TransactionBag wallet) throws ScriptException {
// This is tested in WalletTest.
Coin v = Coin.ZERO;
for (TransactionInput input : inputs) {
// This input is taking value from a transaction in our wallet. To discover the value,
// we must find the connected transaction.
TransactionOutput connected = input.getConnectedOutput(wallet.getTransactionPool(Pool.UNSPENT));
if (connected == null)
connected = input.getConnectedOutput(wallet.getTransactionPool(Pool.SPENT));
if (connected == null)
connected = input.getConnectedOutput(wallet.getTransactionPool(Pool.PENDING));
if (connected == null)
continue;
// The connected output may be the change to the sender of a previous input sent to this wallet. In this
// case we ignore it.
if (!connected.isMineOrWatched(wallet))
continue;
v = v.add(connected.getValue());
}
return v;
} | class class_name[name] begin[{]
method[getValueSentFromMe, return_type[type[Coin]], modifier[public], parameter[wallet]] begin[{]
local_variable[type[Coin], v]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=UNSPENT, postfix_operators=[], prefix_operators=[], qualifier=Pool, selectors=[])], member=getTransactionPool, postfix_operators=[], prefix_operators=[], qualifier=wallet, selectors=[], type_arguments=None)], member=getConnectedOutput, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=connected)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TransactionOutput, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=connected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=connected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=SPENT, postfix_operators=[], prefix_operators=[], qualifier=Pool, selectors=[])], member=getTransactionPool, postfix_operators=[], prefix_operators=[], qualifier=wallet, selectors=[], type_arguments=None)], member=getConnectedOutput, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=connected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=connected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=PENDING, postfix_operators=[], prefix_operators=[], qualifier=Pool, selectors=[])], member=getTransactionPool, postfix_operators=[], prefix_operators=[], qualifier=wallet, selectors=[], type_arguments=None)], member=getConnectedOutput, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=connected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=wallet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isMineOrWatched, postfix_operators=[], prefix_operators=['!'], qualifier=connected, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=connected, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=inputs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=input)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TransactionInput, sub_type=None))), label=None)
return[member[.v]]
end[}]
END[}] | Keyword[public] identifier[Coin] identifier[getValueSentFromMe] operator[SEP] identifier[TransactionBag] identifier[wallet] operator[SEP] Keyword[throws] identifier[ScriptException] {
identifier[Coin] identifier[v] operator[=] identifier[Coin] operator[SEP] identifier[ZERO] operator[SEP] Keyword[for] operator[SEP] identifier[TransactionInput] identifier[input] operator[:] identifier[inputs] operator[SEP] {
identifier[TransactionOutput] identifier[connected] operator[=] identifier[input] operator[SEP] identifier[getConnectedOutput] operator[SEP] identifier[wallet] operator[SEP] identifier[getTransactionPool] operator[SEP] identifier[Pool] operator[SEP] identifier[UNSPENT] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[connected] operator[==] Other[null] operator[SEP] identifier[connected] operator[=] identifier[input] operator[SEP] identifier[getConnectedOutput] operator[SEP] identifier[wallet] operator[SEP] identifier[getTransactionPool] operator[SEP] identifier[Pool] operator[SEP] identifier[SPENT] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[connected] operator[==] Other[null] operator[SEP] identifier[connected] operator[=] identifier[input] operator[SEP] identifier[getConnectedOutput] operator[SEP] identifier[wallet] operator[SEP] identifier[getTransactionPool] operator[SEP] identifier[Pool] operator[SEP] identifier[PENDING] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[connected] operator[==] Other[null] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[connected] operator[SEP] identifier[isMineOrWatched] operator[SEP] identifier[wallet] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[v] operator[=] identifier[v] operator[SEP] identifier[add] operator[SEP] identifier[connected] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[v] operator[SEP]
}
|
public final String callMethod(String method) {
parent.assertConnected();
return debugger.callFunctionOnObject(method, objectId);
} | class class_name[name] begin[{]
method[callMethod, return_type[type[String]], modifier[final public], parameter[method]] begin[{]
call[parent.assertConnected, parameter[]]
return[call[debugger.callFunctionOnObject, parameter[member[.method], member[.objectId]]]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[String] identifier[callMethod] operator[SEP] identifier[String] identifier[method] operator[SEP] {
identifier[parent] operator[SEP] identifier[assertConnected] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[debugger] operator[SEP] identifier[callFunctionOnObject] operator[SEP] identifier[method] , identifier[objectId] operator[SEP] operator[SEP]
}
|
Rule MeterNum() {
return Sequence(
MeterNum2(),
OptionalS(
Sequence(
OneOrMore(SP()),
MeterNum2()
)
)
).label(MeterNum).suppressSubnodes();
} | class class_name[name] begin[{]
method[MeterNum, return_type[type[Rule]], modifier[default], parameter[]] begin[{]
return[call[.Sequence, parameter[call[.MeterNum2, parameter[]], call[.OptionalS, parameter[call[.Sequence, parameter[call[.OneOrMore, parameter[call[.SP, parameter[]]]], call[.MeterNum2, parameter[]]]]]]]]]
end[}]
END[}] | identifier[Rule] identifier[MeterNum] operator[SEP] operator[SEP] {
Keyword[return] identifier[Sequence] operator[SEP] identifier[MeterNum2] operator[SEP] operator[SEP] , identifier[OptionalS] operator[SEP] identifier[Sequence] operator[SEP] identifier[OneOrMore] operator[SEP] identifier[SP] operator[SEP] operator[SEP] operator[SEP] , identifier[MeterNum2] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[label] operator[SEP] identifier[MeterNum] operator[SEP] operator[SEP] identifier[suppressSubnodes] operator[SEP] operator[SEP] operator[SEP]
}
|
public View getIdenticalView(View view) {
if(view == null){
return null;
}
View viewToReturn = null;
List<? extends View> visibleViews = RobotiumUtils.removeInvisibleViews(getCurrentViews(view.getClass(), true));
for(View v : visibleViews){
if(areViewsIdentical(v, view)){
viewToReturn = v;
break;
}
}
return viewToReturn;
} | class class_name[name] begin[{]
method[getIdenticalView, return_type[type[View]], modifier[public], parameter[view]] begin[{]
if[binary_operation[member[.view], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[View], viewToReturn]
local_variable[type[List], visibleViews]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=areViewsIdentical, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=viewToReturn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=visibleViews, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=v)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=View, sub_type=None))), label=None)
return[member[.viewToReturn]]
end[}]
END[}] | Keyword[public] identifier[View] identifier[getIdenticalView] operator[SEP] identifier[View] identifier[view] operator[SEP] {
Keyword[if] operator[SEP] identifier[view] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[View] identifier[viewToReturn] operator[=] Other[null] operator[SEP] identifier[List] operator[<] operator[?] Keyword[extends] identifier[View] operator[>] identifier[visibleViews] operator[=] identifier[RobotiumUtils] operator[SEP] identifier[removeInvisibleViews] operator[SEP] identifier[getCurrentViews] operator[SEP] identifier[view] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[View] identifier[v] operator[:] identifier[visibleViews] operator[SEP] {
Keyword[if] operator[SEP] identifier[areViewsIdentical] operator[SEP] identifier[v] , identifier[view] operator[SEP] operator[SEP] {
identifier[viewToReturn] operator[=] identifier[v] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[return] identifier[viewToReturn] operator[SEP]
}
|
private void currentDatasourceChange() {
OBDADataSource source = obdaModel.getDatasource();
comboListener.setNotify(false);
String driverClass = source.getParameter(RDBMSourceParameterConstants.DATABASE_DRIVER);
if(driverClass == null || driverClass.isEmpty())
{
txtJdbcDriver.setSelectedIndex(0);
}
else
{
txtJdbcDriver.setSelectedItem(driverClass);
}
txtDatabaseUsername.setText(source.getParameter(RDBMSourceParameterConstants.DATABASE_USERNAME));
txtDatabasePassword.setText(source.getParameter(RDBMSourceParameterConstants.DATABASE_PASSWORD));
txtJdbcUrl.setText(source.getParameter(RDBMSourceParameterConstants.DATABASE_URL));
lblConnectionStatus.setText("");
comboListener.setNotify(true);
} | class class_name[name] begin[{]
method[currentDatasourceChange, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[OBDADataSource], source]
call[comboListener.setNotify, parameter[literal[false]]]
local_variable[type[String], driverClass]
if[binary_operation[binary_operation[member[.driverClass], ==, literal[null]], ||, call[driverClass.isEmpty, parameter[]]]] begin[{]
call[txtJdbcDriver.setSelectedIndex, parameter[literal[0]]]
else begin[{]
call[txtJdbcDriver.setSelectedItem, parameter[member[.driverClass]]]
end[}]
call[txtDatabaseUsername.setText, parameter[call[source.getParameter, parameter[member[RDBMSourceParameterConstants.DATABASE_USERNAME]]]]]
call[txtDatabasePassword.setText, parameter[call[source.getParameter, parameter[member[RDBMSourceParameterConstants.DATABASE_PASSWORD]]]]]
call[txtJdbcUrl.setText, parameter[call[source.getParameter, parameter[member[RDBMSourceParameterConstants.DATABASE_URL]]]]]
call[lblConnectionStatus.setText, parameter[literal[""]]]
call[comboListener.setNotify, parameter[literal[true]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[currentDatasourceChange] operator[SEP] operator[SEP] {
identifier[OBDADataSource] identifier[source] operator[=] identifier[obdaModel] operator[SEP] identifier[getDatasource] operator[SEP] operator[SEP] operator[SEP] identifier[comboListener] operator[SEP] identifier[setNotify] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[String] identifier[driverClass] operator[=] identifier[source] operator[SEP] identifier[getParameter] operator[SEP] identifier[RDBMSourceParameterConstants] operator[SEP] identifier[DATABASE_DRIVER] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[driverClass] operator[==] Other[null] operator[||] identifier[driverClass] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[txtJdbcDriver] operator[SEP] identifier[setSelectedIndex] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[txtJdbcDriver] operator[SEP] identifier[setSelectedItem] operator[SEP] identifier[driverClass] operator[SEP] operator[SEP]
}
identifier[txtDatabaseUsername] operator[SEP] identifier[setText] operator[SEP] identifier[source] operator[SEP] identifier[getParameter] operator[SEP] identifier[RDBMSourceParameterConstants] operator[SEP] identifier[DATABASE_USERNAME] operator[SEP] operator[SEP] operator[SEP] identifier[txtDatabasePassword] operator[SEP] identifier[setText] operator[SEP] identifier[source] operator[SEP] identifier[getParameter] operator[SEP] identifier[RDBMSourceParameterConstants] operator[SEP] identifier[DATABASE_PASSWORD] operator[SEP] operator[SEP] operator[SEP] identifier[txtJdbcUrl] operator[SEP] identifier[setText] operator[SEP] identifier[source] operator[SEP] identifier[getParameter] operator[SEP] identifier[RDBMSourceParameterConstants] operator[SEP] identifier[DATABASE_URL] operator[SEP] operator[SEP] operator[SEP] identifier[lblConnectionStatus] operator[SEP] identifier[setText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[comboListener] operator[SEP] identifier[setNotify] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
|
@Override
public WorkItemHandlerModel setClazz(Class<?> clazz) {
String c = clazz != null ? clazz.getName() : null;
setModelAttribute("class", c);
return this;
} | class class_name[name] begin[{]
method[setClazz, return_type[type[WorkItemHandlerModel]], modifier[public], parameter[clazz]] begin[{]
local_variable[type[String], c]
call[.setModelAttribute, parameter[literal["class"], member[.c]]]
return[THIS[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[WorkItemHandlerModel] identifier[setClazz] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] {
identifier[String] identifier[c] operator[=] identifier[clazz] operator[!=] Other[null] operator[?] identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] identifier[setModelAttribute] operator[SEP] literal[String] , identifier[c] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public OvhSetting xdsl_setting_GET() throws IOException {
String qPath = "/me/xdsl/setting";
StringBuilder sb = path(qPath);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhSetting.class);
} | class class_name[name] begin[{]
method[xdsl_setting_GET, return_type[type[OvhSetting]], modifier[public], parameter[]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
local_variable[type[String], resp]
return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhSetting, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[OvhSetting] identifier[xdsl_setting_GET] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhSetting] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
private void updateCoord(MouseEvent event)
{
oldX = x;
oldY = y;
x = event.getXOnScreen();
y = event.getYOnScreen();
wx = event.getX();
wy = event.getY();
mx = x - oldX;
my = y - oldY;
} | class class_name[name] begin[{]
method[updateCoord, return_type[void], modifier[private], parameter[event]] begin[{]
assign[member[.oldX], member[.x]]
assign[member[.oldY], member[.y]]
assign[member[.x], call[event.getXOnScreen, parameter[]]]
assign[member[.y], call[event.getYOnScreen, parameter[]]]
assign[member[.wx], call[event.getX, parameter[]]]
assign[member[.wy], call[event.getY, parameter[]]]
assign[member[.mx], binary_operation[member[.x], -, member[.oldX]]]
assign[member[.my], binary_operation[member[.y], -, member[.oldY]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[updateCoord] operator[SEP] identifier[MouseEvent] identifier[event] operator[SEP] {
identifier[oldX] operator[=] identifier[x] operator[SEP] identifier[oldY] operator[=] identifier[y] operator[SEP] identifier[x] operator[=] identifier[event] operator[SEP] identifier[getXOnScreen] operator[SEP] operator[SEP] operator[SEP] identifier[y] operator[=] identifier[event] operator[SEP] identifier[getYOnScreen] operator[SEP] operator[SEP] operator[SEP] identifier[wx] operator[=] identifier[event] operator[SEP] identifier[getX] operator[SEP] operator[SEP] operator[SEP] identifier[wy] operator[=] identifier[event] operator[SEP] identifier[getY] operator[SEP] operator[SEP] operator[SEP] identifier[mx] operator[=] identifier[x] operator[-] identifier[oldX] operator[SEP] identifier[my] operator[=] identifier[y] operator[-] identifier[oldY] operator[SEP]
}
|
@CanIgnoreReturnValue
@Override
public V put(R rowKey, C columnKey, @NullableDecl V value) {
checkNotNull(rowKey);
checkNotNull(columnKey);
Integer rowIndex = rowKeyToIndex.get(rowKey);
checkArgument(rowIndex != null, "Row %s not in %s", rowKey, rowList);
Integer columnIndex = columnKeyToIndex.get(columnKey);
checkArgument(columnIndex != null, "Column %s not in %s", columnKey, columnList);
return set(rowIndex, columnIndex, value);
} | class class_name[name] begin[{]
method[put, return_type[type[V]], modifier[public], parameter[rowKey, columnKey, value]] begin[{]
call[.checkNotNull, parameter[member[.rowKey]]]
call[.checkNotNull, parameter[member[.columnKey]]]
local_variable[type[Integer], rowIndex]
call[.checkArgument, parameter[binary_operation[member[.rowIndex], !=, literal[null]], literal["Row %s not in %s"], member[.rowKey], member[.rowList]]]
local_variable[type[Integer], columnIndex]
call[.checkArgument, parameter[binary_operation[member[.columnIndex], !=, literal[null]], literal["Column %s not in %s"], member[.columnKey], member[.columnList]]]
return[call[.set, parameter[member[.rowIndex], member[.columnIndex], member[.value]]]]
end[}]
END[}] | annotation[@] identifier[CanIgnoreReturnValue] annotation[@] identifier[Override] Keyword[public] identifier[V] identifier[put] operator[SEP] identifier[R] identifier[rowKey] , identifier[C] identifier[columnKey] , annotation[@] identifier[NullableDecl] identifier[V] identifier[value] operator[SEP] {
identifier[checkNotNull] operator[SEP] identifier[rowKey] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[columnKey] operator[SEP] operator[SEP] identifier[Integer] identifier[rowIndex] operator[=] identifier[rowKeyToIndex] operator[SEP] identifier[get] operator[SEP] identifier[rowKey] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] identifier[rowIndex] operator[!=] Other[null] , literal[String] , identifier[rowKey] , identifier[rowList] operator[SEP] operator[SEP] identifier[Integer] identifier[columnIndex] operator[=] identifier[columnKeyToIndex] operator[SEP] identifier[get] operator[SEP] identifier[columnKey] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] identifier[columnIndex] operator[!=] Other[null] , literal[String] , identifier[columnKey] , identifier[columnList] operator[SEP] operator[SEP] Keyword[return] identifier[set] operator[SEP] identifier[rowIndex] , identifier[columnIndex] , identifier[value] operator[SEP] operator[SEP]
}
|
@Nullable
@Override
public final List<Difference> visitAnnotation(@Nullable JavaAnnotationElement oldAnnotation,
@Nullable JavaAnnotationElement newAnnotation) {
depth++;
List<Difference> ret = doVisitAnnotation(oldAnnotation, newAnnotation);
depth--;
return ret;
} | class class_name[name] begin[{]
method[visitAnnotation, return_type[type[List]], modifier[final public], parameter[oldAnnotation, newAnnotation]] begin[{]
member[.depth]
local_variable[type[List], ret]
member[.depth]
return[member[.ret]]
end[}]
END[}] | annotation[@] identifier[Nullable] annotation[@] identifier[Override] Keyword[public] Keyword[final] identifier[List] operator[<] identifier[Difference] operator[>] identifier[visitAnnotation] operator[SEP] annotation[@] identifier[Nullable] identifier[JavaAnnotationElement] identifier[oldAnnotation] , annotation[@] identifier[Nullable] identifier[JavaAnnotationElement] identifier[newAnnotation] operator[SEP] {
identifier[depth] operator[++] operator[SEP] identifier[List] operator[<] identifier[Difference] operator[>] identifier[ret] operator[=] identifier[doVisitAnnotation] operator[SEP] identifier[oldAnnotation] , identifier[newAnnotation] operator[SEP] operator[SEP] identifier[depth] operator[--] operator[SEP] Keyword[return] identifier[ret] operator[SEP]
}
|
public Element createElementNS(String namespaceURI, String qualifiedName)
throws DOMException
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
} | class class_name[name] begin[{]
method[createElementNS, return_type[type[Element]], modifier[public], parameter[namespaceURI, qualifiedName]] begin[{]
call[.error, parameter[member[XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED]]]
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[Element] identifier[createElementNS] operator[SEP] identifier[String] identifier[namespaceURI] , identifier[String] identifier[qualifiedName] operator[SEP] Keyword[throws] identifier[DOMException] {
identifier[error] operator[SEP] identifier[XMLErrorResources] operator[SEP] identifier[ER_FUNCTION_NOT_SUPPORTED] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
@Deprecated
public static boolean setCipherSuite(long ctx, String ciphers) throws Exception {
return setCipherSuite(ctx, ciphers, false);
} | class class_name[name] begin[{]
method[setCipherSuite, return_type[type[boolean]], modifier[public static], parameter[ctx, ciphers]] begin[{]
return[call[.setCipherSuite, parameter[member[.ctx], member[.ciphers], literal[false]]]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] Keyword[boolean] identifier[setCipherSuite] operator[SEP] Keyword[long] identifier[ctx] , identifier[String] identifier[ciphers] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[return] identifier[setCipherSuite] operator[SEP] identifier[ctx] , identifier[ciphers] , literal[boolean] operator[SEP] operator[SEP]
}
|
public static String generateLink(Geometry geom, boolean withMarker) {
if (geom == null) {
return null;
}
Envelope env = geom.getEnvelopeInternal();
StringBuilder sb = new StringBuilder("http://www.openstreetmap.org/?");
sb.append("minlon=").append(env.getMinX());
sb.append("&minlat=").append(env.getMinY());
sb.append("&maxlon=").append(env.getMaxX());
sb.append("&maxlat=").append(env.getMaxY());
if (withMarker) {
Coordinate centre = env.centre();
sb.append("&mlat=").append(centre.y);
sb.append("&mlon=").append(centre.x);
}
return sb.toString();
} | class class_name[name] begin[{]
method[generateLink, return_type[type[String]], modifier[public static], parameter[geom, withMarker]] begin[{]
if[binary_operation[member[.geom], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[Envelope], env]
local_variable[type[StringBuilder], sb]
call[sb.append, parameter[literal["minlon="]]]
call[sb.append, parameter[literal["&minlat="]]]
call[sb.append, parameter[literal["&maxlon="]]]
call[sb.append, parameter[literal["&maxlat="]]]
if[member[.withMarker]] begin[{]
local_variable[type[Coordinate], centre]
call[sb.append, parameter[literal["&mlat="]]]
call[sb.append, parameter[literal["&mlon="]]]
else begin[{]
None
end[}]
return[call[sb.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[generateLink] operator[SEP] identifier[Geometry] identifier[geom] , Keyword[boolean] identifier[withMarker] operator[SEP] {
Keyword[if] operator[SEP] identifier[geom] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[Envelope] identifier[env] operator[=] identifier[geom] operator[SEP] identifier[getEnvelopeInternal] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[env] operator[SEP] identifier[getMinX] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[env] operator[SEP] identifier[getMinY] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[env] operator[SEP] identifier[getMaxX] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[env] operator[SEP] identifier[getMaxY] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[withMarker] operator[SEP] {
identifier[Coordinate] identifier[centre] operator[=] identifier[env] operator[SEP] identifier[centre] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[centre] operator[SEP] identifier[y] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[centre] operator[SEP] identifier[x] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static final String crypt(String original) {
java.util.Random randomGenerator = new java.util.Random();
int numSaltChars = saltChars.length;
String salt;
salt = (new StringBuffer()).append(saltChars[Math.abs(randomGenerator.nextInt()) % numSaltChars]).append(saltChars[Math.abs(randomGenerator.nextInt()) % numSaltChars])
.toString();
return crypt(salt, original);
} | class class_name[name] begin[{]
method[crypt, return_type[type[String]], modifier[final public static], parameter[original]] begin[{]
local_variable[type[java], randomGenerator]
local_variable[type[int], numSaltChars]
local_variable[type[String], salt]
assign[member[.salt], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=saltChars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=randomGenerator, selectors=[], type_arguments=None)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operandr=MemberReference(member=numSaltChars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%))])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=saltChars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=randomGenerator, selectors=[], type_arguments=None)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operandr=MemberReference(member=numSaltChars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%))])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuffer, sub_type=None))]
return[call[.crypt, parameter[member[.salt], member[.original]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] identifier[String] identifier[crypt] operator[SEP] identifier[String] identifier[original] operator[SEP] {
identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Random] identifier[randomGenerator] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Random] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[numSaltChars] operator[=] identifier[saltChars] operator[SEP] identifier[length] operator[SEP] identifier[String] identifier[salt] operator[SEP] identifier[salt] operator[=] operator[SEP] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[saltChars] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[randomGenerator] operator[SEP] identifier[nextInt] operator[SEP] operator[SEP] operator[SEP] operator[%] identifier[numSaltChars] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[saltChars] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[randomGenerator] operator[SEP] identifier[nextInt] operator[SEP] operator[SEP] operator[SEP] operator[%] identifier[numSaltChars] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[crypt] operator[SEP] identifier[salt] , identifier[original] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.